diff --git a/cmake/GtsamBuildTypes.cmake b/cmake/GtsamBuildTypes.cmake index 55ddf61bc..cf0dfdfc7 100644 --- a/cmake/GtsamBuildTypes.cmake +++ b/cmake/GtsamBuildTypes.cmake @@ -207,7 +207,8 @@ if(${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang") endif() endif() -if (NOT MSVC) +if ((NOT MSVC) AND (NOT QNX)) + option(GTSAM_BUILD_WITH_MARCH_NATIVE "Enable/Disable building with all instructions supported by native architecture (binary may not be portable!)" ON) if(GTSAM_BUILD_WITH_MARCH_NATIVE) # Check if Apple OS and compiler is [Apple]Clang if(APPLE AND (${CMAKE_CXX_COMPILER_ID} MATCHES "^(Apple)?Clang$")) diff --git a/cmake/GtsamTesting.cmake b/cmake/GtsamTesting.cmake index 47b059213..3135ffc18 100644 --- a/cmake/GtsamTesting.cmake +++ b/cmake/GtsamTesting.cmake @@ -197,9 +197,11 @@ 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' - set_target_properties(${script_name} PROPERTIES EXCLUDE_FROM_ALL ON) + if(NOT QNX OR NOT DEFINED ENV{QNX_BUILD_TESTS}) + set_target_properties(${script_name} PROPERTIES EXCLUDE_FROM_ALL ON) + endif() # Configure target folder (for MSVC and Xcode) set_property(TARGET ${script_name} PROPERTY FOLDER "Unit tests/${groupName}") @@ -240,8 +242,10 @@ 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' - set_target_properties(${target_name} PROPERTIES EXCLUDE_FROM_ALL ON) - + if(NOT QNX OR NOT DEFINED ENV{QNX_BUILD_TESTS}) + set_target_properties(${target_name} PROPERTIES EXCLUDE_FROM_ALL ON) + endif() + # Configure target folder (for MSVC and Xcode) set_property(TARGET ${script_name} PROPERTY FOLDER "Unit tests") endif() diff --git a/cmake/HandlePrintConfiguration.cmake b/cmake/HandlePrintConfiguration.cmake index ac68be20f..17693e46c 100644 --- a/cmake/HandlePrintConfiguration.cmake +++ b/cmake/HandlePrintConfiguration.cmake @@ -22,7 +22,7 @@ if(GTSAM_UNSTABLE_AVAILABLE) print_enabled_config(${GTSAM_UNSTABLE_INSTALL_MATLAB_TOOLBOX} "Build MATLAB Toolbox for unstable") endif() -if(NOT MSVC AND NOT XCODE_VERSION) +if(NOT MSVC AND NOT XCODE_VERSION AND NOT QNX) print_enabled_config(${GTSAM_BUILD_WITH_MARCH_NATIVE} "Build for native architecture ") print_config("Build type" "${CMAKE_BUILD_TYPE}") print_config("C compilation flags" "${CMAKE_C_FLAGS} ${CMAKE_C_FLAGS_${CMAKE_BUILD_TYPE_UPPER}}") diff --git a/gtsam/3rdparty/ceres/CMakeLists.txt b/gtsam/3rdparty/ceres/CMakeLists.txt index 98b2cffce..e8d39da67 100644 --- a/gtsam/3rdparty/ceres/CMakeLists.txt +++ b/gtsam/3rdparty/ceres/CMakeLists.txt @@ -1,2 +1,7 @@ file(GLOB ceres_headers "${CMAKE_CURRENT_SOURCE_DIR}/*.h") -install(FILES ${ceres_headers} DESTINATION include/gtsam/3rdparty/ceres) \ No newline at end of file +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() \ No newline at end of file diff --git a/gtsam/3rdparty/metis/include/CMakeLists.txt b/gtsam/3rdparty/metis/include/CMakeLists.txt index 73754eebf..0d5af2e83 100644 --- a/gtsam/3rdparty/metis/include/CMakeLists.txt +++ b/gtsam/3rdparty/metis/include/CMakeLists.txt @@ -1 +1,6 @@ -install(FILES metis.h DESTINATION include/gtsam/3rdparty/metis) \ No newline at end of file +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() \ No newline at end of file diff --git a/gtsam/CMakeLists.txt b/gtsam/CMakeLists.txt index 3c2073547..db4a982a0 100644 --- a/gtsam/CMakeLists.txt +++ b/gtsam/CMakeLists.txt @@ -99,6 +99,10 @@ IF(MSVC) 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}") +endif() configure_file(config.h.in config.h) set(library_name GTSAM) # For substitution in dllexport.h.in configure_file("${GTSAM_SOURCE_DIR}/cmake/dllexport.h.in" "dllexport.h") diff --git a/gtsam/base/CMakeLists.txt b/gtsam/base/CMakeLists.txt index 66d3ec721..2989bbaab 100644 --- a/gtsam/base/CMakeLists.txt +++ b/gtsam/base/CMakeLists.txt @@ -1,9 +1,17 @@ # Install headers +# Header groups file(GLOB base_headers "*.h") -install(FILES ${base_headers} DESTINATION include/gtsam/base) - file(GLOB base_headers_tree "treeTraversal/*.h") -install(FILES ${base_headers_tree} DESTINATION include/gtsam/base/treeTraversal) + +# 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() # Build tests add_subdirectory(tests) diff --git a/gtsam/base/std_optional_serialization.h b/gtsam/base/std_optional_serialization.h index 93a5c8dba..e11a167ff 100644 --- a/gtsam/base/std_optional_serialization.h +++ b/gtsam/base/std_optional_serialization.h @@ -52,6 +52,10 @@ namespace boost { namespace serialization { struct U; } } namespace std { template<> struct is_trivially_default_constructible : std::false_type {}; } namespace std { template<> struct is_trivially_copy_constructible : std::false_type {}; } namespace std { template<> struct is_trivially_move_constructible : std::false_type {}; } +// QCC (The QNX GCC-based Compiler) also has this issue, but it also extends to trivial destructor. +#if defined(__QNX__) +namespace std { template<> struct is_trivially_destructible : std::false_type {}; } +#endif #endif #endif diff --git a/gtsam/basis/CMakeLists.txt b/gtsam/basis/CMakeLists.txt index 203fd96a2..98e6076e9 100644 --- a/gtsam/basis/CMakeLists.txt +++ b/gtsam/basis/CMakeLists.txt @@ -1,6 +1,10 @@ # Install headers file(GLOB basis_headers "*.h") -install(FILES ${basis_headers} DESTINATION include/gtsam/basis) +if(NOT QNX) + install(FILES ${basis_headers} DESTINATION include/gtsam/basis) +else() + install(FILES ${basis_headers} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/gtsam/basis) +endif() # Build tests add_subdirectory(tests) diff --git a/gtsam/config.h.in b/gtsam/config.h.in index 58b93ee1c..9ba562cc4 100644 --- a/gtsam/config.h.in +++ b/gtsam/config.h.in @@ -26,7 +26,12 @@ // Paths to example datasets distributed with GTSAM #define GTSAM_SOURCE_TREE_DATASET_DIR "@GTSAM_SOURCE_DIR@/examples/Data" +#if !defined(__QNX__) #define GTSAM_INSTALLED_DATASET_DIR "@GTSAM_TOOLBOX_INSTALL_PATH@/gtsam_examples/Data" +#else +//Set toolbox path to the path on the target. +#define GTSAM_INSTALLED_DATASET_DIR "@QNX_TARGET_DATASET_DIR@/gtsam_examples/Data" +#endif // Whether GTSAM is compiled to use quaternions for Rot3 (otherwise uses rotation matrices) #cmakedefine GTSAM_USE_QUATERNIONS diff --git a/gtsam/discrete/CMakeLists.txt b/gtsam/discrete/CMakeLists.txt index 1c6aa9747..a4b5cc681 100644 --- a/gtsam/discrete/CMakeLists.txt +++ b/gtsam/discrete/CMakeLists.txt @@ -1,7 +1,12 @@ # Install headers set(subdir discrete) file(GLOB discrete_headers "*.h") -install(FILES ${discrete_headers} DESTINATION include/gtsam/discrete) +# 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() # Add all tests add_subdirectory(tests) diff --git a/gtsam/geometry/CMakeLists.txt b/gtsam/geometry/CMakeLists.txt index dabdde45c..fb96d23de 100644 --- a/gtsam/geometry/CMakeLists.txt +++ b/gtsam/geometry/CMakeLists.txt @@ -1,6 +1,10 @@ # Install headers file(GLOB geometry_headers "*.h") -install(FILES ${geometry_headers} DESTINATION include/gtsam/geometry) +if(QNX) + install(FILES ${geometry_headers} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/gtsam/geometry) +else() + install(FILES ${geometry_headers} DESTINATION include/gtsam/geometry) +endif() # Build tests add_subdirectory(tests) diff --git a/gtsam/inference/CMakeLists.txt b/gtsam/inference/CMakeLists.txt index c3df3a989..2344221bc 100644 --- a/gtsam/inference/CMakeLists.txt +++ b/gtsam/inference/CMakeLists.txt @@ -1,6 +1,10 @@ # Install headers file(GLOB inference_headers "*.h") -install(FILES ${inference_headers} DESTINATION include/gtsam/inference) +if(QNX) + install(FILES ${inference_headers} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/gtsam/inference) +else() + install(FILES ${inference_headers} DESTINATION include/gtsam/inference) +endif() # Build tests add_subdirectory(tests) diff --git a/gtsam/inference/tests/testOrdering.cpp b/gtsam/inference/tests/testOrdering.cpp index b6cfcb6ed..7b7628f5b 100644 --- a/gtsam/inference/tests/testOrdering.cpp +++ b/gtsam/inference/tests/testOrdering.cpp @@ -303,7 +303,7 @@ TEST(Ordering, MetisLoop) { symbolicGraph.push_factor(0, 5); // METIS -#if defined(__APPLE__) +#if defined(__APPLE__) || defined(__QNX__) { Ordering actual = Ordering::Create(Ordering::METIS, symbolicGraph); // - P( 1 0 3) diff --git a/gtsam/linear/CMakeLists.txt b/gtsam/linear/CMakeLists.txt index 084c27057..e3947851c 100644 --- a/gtsam/linear/CMakeLists.txt +++ b/gtsam/linear/CMakeLists.txt @@ -1,6 +1,10 @@ # Install headers file(GLOB linear_headers "*.h") -install(FILES ${linear_headers} DESTINATION include/gtsam/linear) +if(QNX) + install(FILES ${linear_headers} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/gtsam/linear) +else() + install(FILES ${linear_headers} DESTINATION include/gtsam/linear) +endif() # Build tests add_subdirectory(tests) diff --git a/gtsam/navigation/CMakeLists.txt b/gtsam/navigation/CMakeLists.txt index e2b2fdce6..c266b353a 100644 --- a/gtsam/navigation/CMakeLists.txt +++ b/gtsam/navigation/CMakeLists.txt @@ -1,6 +1,10 @@ # Install headers file(GLOB navigation_headers "*.h") -install(FILES ${navigation_headers} DESTINATION include/gtsam/navigation) +if(QNX) + install(FILES ${navigation_headers} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/gtsam/navigation) +else() + install(FILES ${navigation_headers} DESTINATION include/gtsam/navigation) +endif() # Add all tests add_subdirectory(tests) diff --git a/gtsam/nonlinear/CMakeLists.txt b/gtsam/nonlinear/CMakeLists.txt index 29ff2efa5..98facc59e 100644 --- a/gtsam/nonlinear/CMakeLists.txt +++ b/gtsam/nonlinear/CMakeLists.txt @@ -1,9 +1,16 @@ # Install headers file(GLOB nonlinear_headers "*.h") -install(FILES ${nonlinear_headers} DESTINATION "include/gtsam/nonlinear") +if(QNX) + install(FILES ${nonlinear_headers} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/gtsam/nonlinear) +else() + install(FILES ${nonlinear_headers} DESTINATION include/gtsam/nonlinear) +endif() file(GLOB nonlinear_headers_internal "internal/*.h") -install(FILES ${nonlinear_headers_internal} DESTINATION "include/gtsam/nonlinear/internal") - +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() # Build tests add_subdirectory(tests) diff --git a/gtsam/nonlinear/tests/testSerializationNonlinear.cpp b/gtsam/nonlinear/tests/testSerializationNonlinear.cpp index d6f693a23..a96ede430 100644 --- a/gtsam/nonlinear/tests/testSerializationNonlinear.cpp +++ b/gtsam/nonlinear/tests/testSerializationNonlinear.cpp @@ -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") @@ -153,9 +152,15 @@ TEST(Serialization, NoiseModelFactor1_backwards_compatibility) { // Deserialize XML PriorFactor factor_deserialized_xml = PriorFactor(); + #if !defined(__QNX__) deserializeFromXMLFile(GTSAM_SOURCE_TREE_DATASET_DIR "/../../gtsam/nonlinear/tests/priorFactor.xml", factor_deserialized_xml); + #else + bool c = deserializeFromXMLFile( + "priorFactor.xml", + factor_deserialized_xml); + #endif EXPECT(assert_equal(factor, factor_deserialized_xml)); #endif } diff --git a/gtsam/sam/CMakeLists.txt b/gtsam/sam/CMakeLists.txt index bf20b751c..0ba13f837 100644 --- a/gtsam/sam/CMakeLists.txt +++ b/gtsam/sam/CMakeLists.txt @@ -1,6 +1,10 @@ # Install headers file(GLOB sam_headers "*.h") -install(FILES ${sam_headers} DESTINATION include/gtsam/sam) +if(QNX) + install(FILES ${sam_headers} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/gtsam/sam) +else() + install(FILES ${sam_headers} DESTINATION include/gtsam/sam) +endif() # Build tests add_subdirectory(tests) diff --git a/gtsam/sfm/CMakeLists.txt b/gtsam/sfm/CMakeLists.txt index fde997840..c3286d81a 100644 --- a/gtsam/sfm/CMakeLists.txt +++ b/gtsam/sfm/CMakeLists.txt @@ -1,6 +1,10 @@ # Install headers file(GLOB sfm_headers "*.h") -install(FILES ${sfm_headers} DESTINATION include/gtsam/sfm) +if(QNX) + install(FILES ${sfm_headers} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/gtsam/sfm) +else() + install(FILES ${sfm_headers} DESTINATION include/gtsam/sfm) +endif() # Build tests add_subdirectory(tests) diff --git a/gtsam/slam/CMakeLists.txt b/gtsam/slam/CMakeLists.txt index 22645973d..b35293912 100644 --- a/gtsam/slam/CMakeLists.txt +++ b/gtsam/slam/CMakeLists.txt @@ -4,7 +4,11 @@ set (slam_excluded_headers #"") ) file(GLOB slam_headers "*.h") -install(FILES ${slam_headers} DESTINATION include/gtsam/slam) +if(QNX) + install(FILES ${slam_headers} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/gtsam/slam) +else() + install(FILES ${slam_headers} DESTINATION include/gtsam/slam) +endif() # Build tests add_subdirectory(tests) diff --git a/gtsam/symbolic/CMakeLists.txt b/gtsam/symbolic/CMakeLists.txt index feb073f69..2c25a0970 100644 --- a/gtsam/symbolic/CMakeLists.txt +++ b/gtsam/symbolic/CMakeLists.txt @@ -1,6 +1,10 @@ # Install headers file(GLOB symbolic_headers "*.h") -install(FILES ${symbolic_headers} DESTINATION include/gtsam/symbolic) +if(QNX) + install(FILES ${symbolic_headers} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/gtsam/symbolic) +else() + install(FILES ${symbolic_headers} DESTINATION include/gtsam/symbolic) +endif() # Build tests add_subdirectory(tests) diff --git a/gtsam/symbolic/tests/testSymbolicBayesTree.cpp b/gtsam/symbolic/tests/testSymbolicBayesTree.cpp index e4a47bdfb..04fe0434b 100644 --- a/gtsam/symbolic/tests/testSymbolicBayesTree.cpp +++ b/gtsam/symbolic/tests/testSymbolicBayesTree.cpp @@ -687,7 +687,7 @@ TEST(SymbolicBayesTree, COLAMDvsMETIS) { { Ordering ordering = Ordering::Create(Ordering::METIS, sfg); // Linux and Mac split differently when using Metis -#if defined(__APPLE__) +#if defined(__APPLE__) || defined(__QNX__) EXPECT(assert_equal(Ordering{5, 4, 2, 1, 0, 3}, ordering)); #elif defined(_WIN32) EXPECT(assert_equal(Ordering{4, 3, 1, 0, 5, 2}, ordering)); @@ -700,7 +700,7 @@ TEST(SymbolicBayesTree, COLAMDvsMETIS) { // | | - P( 5 | 0 4) // | - P( 2 | 1 3) SymbolicBayesTree expected; -#if defined(__APPLE__) +#if defined(__APPLE__) || defined(__QNX__) expected.insertRoot( NodeClique(Keys(1)(0)(3), 3, Children( // diff --git a/gtsam_unstable/base/CMakeLists.txt b/gtsam_unstable/base/CMakeLists.txt index 2cb96be36..b638302d8 100644 --- a/gtsam_unstable/base/CMakeLists.txt +++ b/gtsam_unstable/base/CMakeLists.txt @@ -1,6 +1,10 @@ # Install headers file(GLOB base_headers "*.h") -install(FILES ${base_headers} DESTINATION include/gtsam_unstable/base) +if(QNX) + install(FILES ${base_headers} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/gtsam_unstable/base) +else() + install(FILES ${base_headers} DESTINATION include/gtsam_unstable/base) +endif() # Add all tests add_subdirectory(tests) diff --git a/gtsam_unstable/discrete/CMakeLists.txt b/gtsam_unstable/discrete/CMakeLists.txt index 18346a45a..45e073fab 100644 --- a/gtsam_unstable/discrete/CMakeLists.txt +++ b/gtsam_unstable/discrete/CMakeLists.txt @@ -1,6 +1,10 @@ # Install headers file(GLOB discrete_headers "*.h") -install(FILES ${discrete_headers} DESTINATION include/gtsam_unstable/discrete) +if(QNX) + install(FILES ${discrete_headers} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/gtsam_unstable/discrete) +else() + install(FILES ${discrete_headers} DESTINATION include/gtsam_unstable/discrete) +endif() # Add all tests add_subdirectory(tests) diff --git a/gtsam_unstable/discrete/tests/testScheduler.cpp b/gtsam_unstable/discrete/tests/testScheduler.cpp index 5f9b7f287..ab3a0df05 100644 --- a/gtsam_unstable/discrete/tests/testScheduler.cpp +++ b/gtsam_unstable/discrete/tests/testScheduler.cpp @@ -140,7 +140,11 @@ TEST(schedulingExample, test) { /* ************************************************************************* */ TEST(schedulingExample, smallFromFile) { + #if !defined(__QNX__) string path(TOPSRCDIR "/gtsam_unstable/discrete/examples/"); + #else + string path(""); //Same Directory + #endif Scheduler s(2, path + "small.csv"); // add areas diff --git a/gtsam_unstable/dynamics/CMakeLists.txt b/gtsam_unstable/dynamics/CMakeLists.txt index 66aef9455..bd5469f72 100644 --- a/gtsam_unstable/dynamics/CMakeLists.txt +++ b/gtsam_unstable/dynamics/CMakeLists.txt @@ -1,6 +1,10 @@ # Install headers file(GLOB dynamics_headers "*.h") -install(FILES ${dynamics_headers} DESTINATION include/gtsam_unstable/dynamics) +if(QNX) + install(FILES ${dynamics_headers} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/gtsam_unstable/dynamics) +else() + install(FILES ${dynamics_headers} DESTINATION include/gtsam_unstable/dynamics) +endif() # Add all tests add_subdirectory(tests) diff --git a/gtsam_unstable/geometry/CMakeLists.txt b/gtsam_unstable/geometry/CMakeLists.txt index c8b7e250f..3432bab19 100644 --- a/gtsam_unstable/geometry/CMakeLists.txt +++ b/gtsam_unstable/geometry/CMakeLists.txt @@ -1,6 +1,10 @@ # Install headers file(GLOB geometry_headers "*.h") -install(FILES ${geometry_headers} DESTINATION include/gtsam_unstable/geometry) +if(QNX) + install(FILES ${geometry_headers} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/gtsam_unstable/geometry) +else() + install(FILES ${geometry_headers} DESTINATION include/gtsam_unstable/geometry) +endif() # Add all tests add_subdirectory(tests) diff --git a/gtsam_unstable/linear/CMakeLists.txt b/gtsam_unstable/linear/CMakeLists.txt index 99a4b814e..50f7fb5fd 100644 --- a/gtsam_unstable/linear/CMakeLists.txt +++ b/gtsam_unstable/linear/CMakeLists.txt @@ -1,6 +1,10 @@ # Install headers file(GLOB linear_headers "*.h") -install(FILES ${linear_headers} DESTINATION include/gtsam_unstable/linear) +if(QNX) + install(FILES ${linear_headers} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/gtsam_unstable/linear) +else() + install(FILES ${linear_headers} DESTINATION include/gtsam_unstable/linear) +endif() # Add all tests add_subdirectory(tests) diff --git a/gtsam_unstable/nonlinear/CMakeLists.txt b/gtsam_unstable/nonlinear/CMakeLists.txt index 9e0cb68e1..b8483ecab 100644 --- a/gtsam_unstable/nonlinear/CMakeLists.txt +++ b/gtsam_unstable/nonlinear/CMakeLists.txt @@ -1,6 +1,10 @@ # Install headers file(GLOB nonlinear_headers "*.h") -install(FILES ${nonlinear_headers} DESTINATION include/gtsam_unstable/nonlinear) +if(QNX) + install(FILES ${nonlinear_headers} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/gtsam_unstable/nonlinear) +else() + install(FILES ${nonlinear_headers} DESTINATION include/gtsam_unstable/nonlinear) +endif() # Add all tests add_subdirectory(tests) diff --git a/gtsam_unstable/partition/CMakeLists.txt b/gtsam_unstable/partition/CMakeLists.txt index 74951bf93..f9e36a768 100644 --- a/gtsam_unstable/partition/CMakeLists.txt +++ b/gtsam_unstable/partition/CMakeLists.txt @@ -1,5 +1,9 @@ # Install headers file(GLOB partition_headers "*.h") -install(FILES ${partition_headers} DESTINATION include/gtsam_unstable/partition) +if(QNX) + install(FILES ${partition_headers} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/gtsam_unstable/partition) +else() + install(FILES ${partition_headers} DESTINATION include/gtsam_unstable/partition) +endif() add_subdirectory(tests) diff --git a/gtsam_unstable/partition/tests/testFindSeparator.cpp b/gtsam_unstable/partition/tests/testFindSeparator.cpp index a659c3c22..f425be8c7 100644 --- a/gtsam_unstable/partition/tests/testFindSeparator.cpp +++ b/gtsam_unstable/partition/tests/testFindSeparator.cpp @@ -104,7 +104,13 @@ TEST ( Partition, edgePartitionByMetis2 ) graph.push_back(std::make_shared(1, 2, 1, NODE_POSE_3D, NODE_POSE_3D, 1)); graph.push_back(std::make_shared(2, 3, 2, NODE_POSE_3D, NODE_POSE_3D, 20)); graph.push_back(std::make_shared(3, 4, 3, NODE_POSE_3D, NODE_POSE_3D, 1)); + //QNX Testing: fix tiebreaker to match + #if !defined(__QNX__) std::vector keys{0, 1, 2, 3, 4}; + #else + //Anything where 2 is before 0 will work. + std::vector keys{2, 0, 3, 1, 4}; + #endif WorkSpace workspace(6); std::optional actual = edgePartitionByMetis(graph, keys, diff --git a/gtsam_unstable/slam/CMakeLists.txt b/gtsam_unstable/slam/CMakeLists.txt index a86beac63..780de9051 100644 --- a/gtsam_unstable/slam/CMakeLists.txt +++ b/gtsam_unstable/slam/CMakeLists.txt @@ -5,7 +5,11 @@ set (slam_excluded_headers #"") file(GLOB slam_headers "*.h") list(REMOVE_ITEM slam_headers ${slam_excluded_headers}) -install(FILES ${slam_headers} DESTINATION include/gtsam_unstable/slam) +if(QNX) + install(FILES ${slam_headers} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/gtsam_unstable/slam) +else() + install(FILES ${slam_headers} DESTINATION include/gtsam_unstable/slam) +endif() # Add all tests add_subdirectory(tests) diff --git a/tests/testSerializationSlam.cpp b/tests/testSerializationSlam.cpp index c4170b108..a29485720 100644 --- a/tests/testSerializationSlam.cpp +++ b/tests/testSerializationSlam.cpp @@ -634,7 +634,6 @@ TEST(SubgraphSolver, Solves) { KeyInfo keyInfo(Ab); std::map 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);