Skip to content

Commit

Permalink
Updated QNX-relevant paths, removed environment variables. (#2)
Browse files Browse the repository at this point in the history
Updated QNX-relevant paths (will check others next), removed environment variables.
  • Loading branch information
JaiXJM-BB authored Jan 16, 2025
1 parent 074f889 commit d35ff2e
Show file tree
Hide file tree
Showing 26 changed files with 30 additions and 129 deletions.
6 changes: 3 additions & 3 deletions cmake/GtsamTesting.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -197,9 +197,9 @@ macro(gtsamAddTestsGlob_impl groupName globPatterns excludedFiles linkLibraries)

# Add TOPSRCDIR
set_property(SOURCE ${script_src} APPEND PROPERTY COMPILE_DEFINITIONS "TOPSRCDIR=\"${GTSAM_SOURCE_DIR}\"")

# Exclude from 'make all' and 'make install'
if(NOT QNX OR NOT DEFINED ENV{QNX_BUILD_TESTS})
if(NOT QNX)
set_target_properties(${script_name} PROPERTIES EXCLUDE_FROM_ALL ON)
endif()

Expand Down Expand Up @@ -242,7 +242,7 @@ macro(gtsamAddTestsGlob_impl groupName globPatterns excludedFiles linkLibraries)
set_property(SOURCE ${script_srcs} APPEND PROPERTY COMPILE_DEFINITIONS "TOPSRCDIR=\"${GTSAM_SOURCE_DIR}\"")

# Exclude from 'make all' and 'make install'
if(NOT QNX OR NOT DEFINED ENV{QNX_BUILD_TESTS})
if(NOT QNX)
set_target_properties(${target_name} PROPERTIES EXCLUDE_FROM_ALL ON)
endif()

Expand Down
7 changes: 1 addition & 6 deletions gtsam/3rdparty/ceres/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,2 @@
file(GLOB ceres_headers "${CMAKE_CURRENT_SOURCE_DIR}/*.h")
if(NOT QNX)
install(FILES ${ceres_headers} DESTINATION include/gtsam/3rdparty/ceres)
else()
#Install in the install include directory rather than at the install prefix.
install(FILES ${ceres_headers} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/gtsam/3rdparty/ceres)
endif()
install(FILES ${ceres_headers} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/gtsam/3rdparty/ceres)
7 changes: 1 addition & 6 deletions gtsam/3rdparty/metis/include/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1 @@
if(NOT QNX)
install(FILES metis.h DESTINATION include/gtsam/3rdparty/metis)
else()
#Install in the install include directory rather than at the install prefix.
install(FILES metis.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/gtsam/3rdparty/metis)
endif()
install(FILES metis.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/gtsam/3rdparty/metis)
2 changes: 1 addition & 1 deletion gtsam/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ ENDIF(MSVC)
# Generate and install config and dllexport files
#For config.in searches
if(QNX)
set(QNX_TARGET_DATASET_DIR "$ENV{QNX_TARGET_DATASET_DIR}")
set(QNX_TARGET_DATASET_DIR "/data/home/root/qnxuser/test" CACHE STRING "Path to your on-target testing folder.")
endif()
configure_file(config.h.in config.h)
set(library_name GTSAM) # For substitution in dllexport.h.in
Expand Down
14 changes: 3 additions & 11 deletions gtsam/base/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,17 +1,9 @@
# Install headers
# Header groups
file(GLOB base_headers "*.h")
file(GLOB base_headers_tree "treeTraversal/*.h")
install(FILES ${base_headers} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/gtsam/base)

# Installation
if(NOT QNX)
install(FILES ${base_headers} DESTINATION include/gtsam/base)
install(FILES ${base_headers_tree} DESTINATION include/gtsam/base/treeTraversal)
else()
# For QNX, Install in the Installation's Include Directory
install(FILES ${base_headers} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/gtsam/base)
install(FILES ${base_headers_tree} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/gtsam/base/treeTraversal)
endif()
file(GLOB base_headers_tree "treeTraversal/*.h")
install(FILES ${base_headers_tree} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/gtsam/base/treeTraversal)

# Build tests
add_subdirectory(tests)
6 changes: 1 addition & 5 deletions gtsam/basis/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
# Install headers
file(GLOB basis_headers "*.h")
if(NOT QNX)
install(FILES ${basis_headers} DESTINATION include/gtsam/basis)
else()
install(FILES ${basis_headers} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/gtsam/basis)
endif()
install(FILES ${basis_headers} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/gtsam/basis)

# Build tests
add_subdirectory(tests)
6 changes: 1 addition & 5 deletions gtsam/discrete/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,7 @@
set(subdir discrete)
file(GLOB discrete_headers "*.h")
# FIXME: exclude headers
if(QNX)
install(FILES ${discrete_headers} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/gtsam/discrete)
else()
install(FILES ${discrete_headers} DESTINATION include/gtsam/discrete)
endif()
install(FILES ${discrete_headers} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/gtsam/discrete)

# Add all tests
add_subdirectory(tests)
6 changes: 1 addition & 5 deletions gtsam/geometry/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
# Install headers
file(GLOB geometry_headers "*.h")
if(QNX)
install(FILES ${geometry_headers} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/gtsam/geometry)
else()
install(FILES ${geometry_headers} DESTINATION include/gtsam/geometry)
endif()
install(FILES ${geometry_headers} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/gtsam/geometry)

# Build tests
add_subdirectory(tests)
6 changes: 1 addition & 5 deletions gtsam/inference/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
# Install headers
file(GLOB inference_headers "*.h")
if(QNX)
install(FILES ${inference_headers} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/gtsam/inference)
else()
install(FILES ${inference_headers} DESTINATION include/gtsam/inference)
endif()
install(FILES ${inference_headers} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/gtsam/inference)

# Build tests
add_subdirectory(tests)
6 changes: 1 addition & 5 deletions gtsam/linear/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
# Install headers
file(GLOB linear_headers "*.h")
if(QNX)
install(FILES ${linear_headers} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/gtsam/linear)
else()
install(FILES ${linear_headers} DESTINATION include/gtsam/linear)
endif()
install(FILES ${linear_headers} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/gtsam/linear)

# Build tests
add_subdirectory(tests)
6 changes: 1 addition & 5 deletions gtsam/navigation/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
# Install headers
file(GLOB navigation_headers "*.h")
if(QNX)
install(FILES ${navigation_headers} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/gtsam/navigation)
else()
install(FILES ${navigation_headers} DESTINATION include/gtsam/navigation)
endif()
install(FILES ${navigation_headers} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/gtsam/navigation)

# Add all tests
add_subdirectory(tests)
13 changes: 3 additions & 10 deletions gtsam/nonlinear/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,16 +1,9 @@
# Install headers
file(GLOB nonlinear_headers "*.h")
if(QNX)
install(FILES ${nonlinear_headers} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/gtsam/nonlinear)
else()
install(FILES ${nonlinear_headers} DESTINATION include/gtsam/nonlinear)
endif()
install(FILES ${nonlinear_headers} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/gtsam/nonlinear)

file(GLOB nonlinear_headers_internal "internal/*.h")
if(QNX)
install(FILES ${nonlinear_headers_internal} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/gtsam/nonlinear/internal)
else()
install(FILES ${nonlinear_headers_internal} DESTINATION include/gtsam/nonlinear/internal)
endif()
install(FILES ${nonlinear_headers_internal} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/gtsam/nonlinear/internal)

# Build tests
add_subdirectory(tests)
1 change: 0 additions & 1 deletion gtsam/nonlinear/tests/testSerializationNonlinear.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ using namespace std;
using namespace gtsam;
using namespace gtsam::serializationTestHelpers;


/* ************************************************************************* */
// Create GUIDs for Noisemodels
BOOST_CLASS_EXPORT_GUID(gtsam::noiseModel::Diagonal, "gtsam_noiseModel_Diagonal")
Expand Down
6 changes: 1 addition & 5 deletions gtsam/sam/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
# Install headers
file(GLOB sam_headers "*.h")
if(QNX)
install(FILES ${sam_headers} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/gtsam/sam)
else()
install(FILES ${sam_headers} DESTINATION include/gtsam/sam)
endif()
install(FILES ${sam_headers} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/gtsam/sam)

# Build tests
add_subdirectory(tests)
6 changes: 1 addition & 5 deletions gtsam/sfm/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
# Install headers
file(GLOB sfm_headers "*.h")
if(QNX)
install(FILES ${sfm_headers} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/gtsam/sfm)
else()
install(FILES ${sfm_headers} DESTINATION include/gtsam/sfm)
endif()
install(FILES ${sfm_headers} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/gtsam/sfm)

# Build tests
add_subdirectory(tests)
6 changes: 1 addition & 5 deletions gtsam/slam/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,7 @@ set (slam_excluded_headers #"")
)

file(GLOB slam_headers "*.h")
if(QNX)
install(FILES ${slam_headers} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/gtsam/slam)
else()
install(FILES ${slam_headers} DESTINATION include/gtsam/slam)
endif()
install(FILES ${slam_headers} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/gtsam/slam)

# Build tests
add_subdirectory(tests)
6 changes: 1 addition & 5 deletions gtsam/symbolic/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
# Install headers
file(GLOB symbolic_headers "*.h")
if(QNX)
install(FILES ${symbolic_headers} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/gtsam/symbolic)
else()
install(FILES ${symbolic_headers} DESTINATION include/gtsam/symbolic)
endif()
install(FILES ${symbolic_headers} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/gtsam/symbolic)

# Build tests
add_subdirectory(tests)
6 changes: 1 addition & 5 deletions gtsam_unstable/base/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
# Install headers
file(GLOB base_headers "*.h")
if(QNX)
install(FILES ${base_headers} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/gtsam_unstable/base)
else()
install(FILES ${base_headers} DESTINATION include/gtsam_unstable/base)
endif()
install(FILES ${base_headers} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/gtsam_unstable/base)

# Add all tests
add_subdirectory(tests)
6 changes: 1 addition & 5 deletions gtsam_unstable/discrete/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
# Install headers
file(GLOB discrete_headers "*.h")
if(QNX)
install(FILES ${discrete_headers} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/gtsam_unstable/discrete)
else()
install(FILES ${discrete_headers} DESTINATION include/gtsam_unstable/discrete)
endif()
install(FILES ${discrete_headers} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/gtsam_unstable/discrete)

# Add all tests
add_subdirectory(tests)
Expand Down
6 changes: 1 addition & 5 deletions gtsam_unstable/dynamics/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
# Install headers
file(GLOB dynamics_headers "*.h")
if(QNX)
install(FILES ${dynamics_headers} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/gtsam_unstable/dynamics)
else()
install(FILES ${dynamics_headers} DESTINATION include/gtsam_unstable/dynamics)
endif()
install(FILES ${dynamics_headers} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/gtsam_unstable/dynamics)

# Add all tests
add_subdirectory(tests)
6 changes: 1 addition & 5 deletions gtsam_unstable/geometry/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
# Install headers
file(GLOB geometry_headers "*.h")
if(QNX)
install(FILES ${geometry_headers} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/gtsam_unstable/geometry)
else()
install(FILES ${geometry_headers} DESTINATION include/gtsam_unstable/geometry)
endif()
install(FILES ${geometry_headers} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/gtsam_unstable/geometry)

# Add all tests
add_subdirectory(tests)
6 changes: 1 addition & 5 deletions gtsam_unstable/linear/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
# Install headers
file(GLOB linear_headers "*.h")
if(QNX)
install(FILES ${linear_headers} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/gtsam_unstable/linear)
else()
install(FILES ${linear_headers} DESTINATION include/gtsam_unstable/linear)
endif()
install(FILES ${linear_headers} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/gtsam_unstable/linear)

# Add all tests
add_subdirectory(tests)
6 changes: 1 addition & 5 deletions gtsam_unstable/nonlinear/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
# Install headers
file(GLOB nonlinear_headers "*.h")
if(QNX)
install(FILES ${nonlinear_headers} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/gtsam_unstable/nonlinear)
else()
install(FILES ${nonlinear_headers} DESTINATION include/gtsam_unstable/nonlinear)
endif()
install(FILES ${nonlinear_headers} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/gtsam_unstable/nonlinear)

# Add all tests
add_subdirectory(tests)
6 changes: 1 addition & 5 deletions gtsam_unstable/partition/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
# Install headers
file(GLOB partition_headers "*.h")
if(QNX)
install(FILES ${partition_headers} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/gtsam_unstable/partition)
else()
install(FILES ${partition_headers} DESTINATION include/gtsam_unstable/partition)
endif()
install(FILES ${partition_headers} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/gtsam_unstable/partition)

add_subdirectory(tests)
6 changes: 1 addition & 5 deletions gtsam_unstable/slam/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,7 @@ set (slam_excluded_headers #"")

file(GLOB slam_headers "*.h")
list(REMOVE_ITEM slam_headers ${slam_excluded_headers})
if(QNX)
install(FILES ${slam_headers} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/gtsam_unstable/slam)
else()
install(FILES ${slam_headers} DESTINATION include/gtsam_unstable/slam)
endif()
install(FILES ${slam_headers} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/gtsam_unstable/slam)

# Add all tests
add_subdirectory(tests)
1 change: 0 additions & 1 deletion tests/testSerializationSlam.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -634,7 +634,6 @@ TEST(SubgraphSolver, Solves) {
KeyInfo keyInfo(Ab);
std::map<Key, Vector> lambda;
system.build(Ab, keyInfo, lambda);

// Create a perturbed (non-zero) RHS
const auto xbar = system.Rc1().optimize(); // merely for use in zero below
auto values_y = VectorValues::Zero(xbar);
Expand Down

0 comments on commit d35ff2e

Please sign in to comment.