ADDED: Test Installation when building with QNX (Review this for upstreaming)
parent
45adc0c8c9
commit
4eff178352
|
@ -196,8 +196,13 @@ macro(gtsamAddTestsGlob_impl groupName globPatterns excludedFiles linkLibraries)
|
||||||
# Add TOPSRCDIR
|
# Add TOPSRCDIR
|
||||||
set_property(SOURCE ${script_src} APPEND PROPERTY COMPILE_DEFINITIONS "TOPSRCDIR=\"${GTSAM_SOURCE_DIR}\"")
|
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'
|
# 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)
|
# Configure target folder (for MSVC and Xcode)
|
||||||
set_property(TARGET ${script_name} PROPERTY FOLDER "Unit tests/${groupName}")
|
set_property(TARGET ${script_name} PROPERTY FOLDER "Unit tests/${groupName}")
|
||||||
|
|
|
@ -82,6 +82,10 @@ IF(MSVC)
|
||||||
ENDIF(MSVC)
|
ENDIF(MSVC)
|
||||||
|
|
||||||
# Generate and install config and dllexport files
|
# 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)
|
configure_file(config.h.in config.h)
|
||||||
set(library_name GTSAM) # For substitution in dllexport.h.in
|
set(library_name GTSAM) # For substitution in dllexport.h.in
|
||||||
configure_file("${GTSAM_SOURCE_DIR}/cmake/dllexport.h.in" "dllexport.h")
|
configure_file("${GTSAM_SOURCE_DIR}/cmake/dllexport.h.in" "dllexport.h")
|
||||||
|
|
|
@ -27,6 +27,9 @@
|
||||||
// Paths to example datasets distributed with GTSAM
|
// Paths to example datasets distributed with GTSAM
|
||||||
#define GTSAM_SOURCE_TREE_DATASET_DIR "@GTSAM_SOURCE_DIR@/examples/Data"
|
#define GTSAM_SOURCE_TREE_DATASET_DIR "@GTSAM_SOURCE_DIR@/examples/Data"
|
||||||
#define GTSAM_INSTALLED_DATASET_DIR "@GTSAM_TOOLBOX_INSTALL_PATH@/gtsam_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)
|
// Whether GTSAM is compiled to use quaternions for Rot3 (otherwise uses rotation matrices)
|
||||||
#cmakedefine GTSAM_USE_QUATERNIONS
|
#cmakedefine GTSAM_USE_QUATERNIONS
|
||||||
|
|
|
@ -69,6 +69,9 @@ string findExampleDataFile(const string &name) {
|
||||||
// Constants below are defined by CMake, see gtsam/gtsam/CMakeLists.txt
|
// Constants below are defined by CMake, see gtsam/gtsam/CMakeLists.txt
|
||||||
rootsToSearch.push_back(GTSAM_SOURCE_TREE_DATASET_DIR);
|
rootsToSearch.push_back(GTSAM_SOURCE_TREE_DATASET_DIR);
|
||||||
rootsToSearch.push_back(GTSAM_INSTALLED_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
|
// Search for filename as given, and with .graph and .txt extensions
|
||||||
vector<string> namesToSearch;
|
vector<string> namesToSearch;
|
||||||
|
|
|
@ -14,3 +14,8 @@ if(MSVC)
|
||||||
set_property(SOURCE "${CMAKE_CURRENT_SOURCE_DIR}/testSerializationSLAM.cpp"
|
set_property(SOURCE "${CMAKE_CURRENT_SOURCE_DIR}/testSerializationSLAM.cpp"
|
||||||
APPEND PROPERTY COMPILE_FLAGS "/bigobj")
|
APPEND PROPERTY COMPILE_FLAGS "/bigobj")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
if(QNX)
|
||||||
|
file(GLOB built_tests "${PROJECT_BINARY_DIR}/tests/test*")
|
||||||
|
install(FILES ${built_tests} DESTINATION ${CMAKE_INSTALL_BINDIR}/gtsam_tests/)
|
||||||
|
endif()
|
Loading…
Reference in New Issue