ADDED: Test Installation when building with QNX (Review this for upstreaming)

release/4.3a0
Jai Moraes 2024-11-29 16:00:18 -05:00
parent 45adc0c8c9
commit 4eff178352
5 changed files with 21 additions and 1 deletions

View File

@ -196,8 +196,13 @@ macro(gtsamAddTestsGlob_impl groupName globPatterns excludedFiles linkLibraries)
# Add TOPSRCDIR
set_property(SOURCE ${script_src} APPEND PROPERTY COMPILE_DEFINITIONS "TOPSRCDIR=\"${GTSAM_SOURCE_DIR}\"")
if(QNX)
# Do not exclude from 'make all' and 'make install'
set_target_properties(${target_name} PROPERTIES EXCLUDE_FROM_ALL OFF)
else()
# Exclude from 'make all' and 'make install'
set_target_properties(${script_name} PROPERTIES EXCLUDE_FROM_ALL ON)
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/${groupName}")

View File

@ -82,6 +82,10 @@ IF(MSVC)
ENDIF(MSVC)
# Generate and install config and dllexport files
#For config.in searches
if(DEFINED ENV{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")

View File

@ -27,6 +27,9 @@
// Paths to example datasets distributed with GTSAM
#define GTSAM_SOURCE_TREE_DATASET_DIR "@GTSAM_SOURCE_DIR@/examples/Data"
#define GTSAM_INSTALLED_DATASET_DIR "@GTSAM_TOOLBOX_INSTALL_PATH@/gtsam_examples/Data"
#ifdef __QNX__
#define QNX_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

View File

@ -69,6 +69,9 @@ string findExampleDataFile(const string &name) {
// Constants below are defined by CMake, see gtsam/gtsam/CMakeLists.txt
rootsToSearch.push_back(GTSAM_SOURCE_TREE_DATASET_DIR);
rootsToSearch.push_back(GTSAM_INSTALLED_DATASET_DIR);
#ifdef __QNX__
rootsToSearch.push_back(QNX_INSTALLED_DATASET_DIR);
#endif
// Search for filename as given, and with .graph and .txt extensions
vector<string> namesToSearch;

View File

@ -14,3 +14,8 @@ if(MSVC)
set_property(SOURCE "${CMAKE_CURRENT_SOURCE_DIR}/testSerializationSLAM.cpp"
APPEND PROPERTY COMPILE_FLAGS "/bigobj")
endif()
if(QNX)
file(GLOB built_tests "${PROJECT_BINARY_DIR}/tests/test*")
install(FILES ${built_tests} DESTINATION ${CMAKE_INSTALL_BINDIR}/gtsam_tests/)
endif()