Updated: Build tests, fixed some unit tests. Floating points still off.
parent
4eff178352
commit
b78a29650e
|
@ -196,12 +196,9 @@ 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(${target_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)
|
||||
|
@ -242,11 +239,8 @@ macro(gtsamAddTestsGlob_impl groupName globPatterns excludedFiles linkLibraries)
|
|||
# Add TOPSRCDIR
|
||||
set_property(SOURCE ${script_srcs} 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'
|
||||
if(NOT QNX OR NOT DEFINED ENV{QNX_BUILD_TESTS})
|
||||
set_target_properties(${target_name} PROPERTIES EXCLUDE_FROM_ALL ON)
|
||||
endif()
|
||||
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
file(GLOB ceres_headers "${CMAKE_CURRENT_SOURCE_DIR}/*.h")
|
||||
if(QNX)
|
||||
install(FILES ${ceres_headers} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/gtsam/3rdparty/ceres)
|
||||
else()
|
||||
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()
|
|
@ -1,5 +1,6 @@
|
|||
if(QNX)
|
||||
install(FILES metis.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/gtsam/3rdparty/metis)
|
||||
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()
|
|
@ -83,7 +83,7 @@ ENDIF(MSVC)
|
|||
|
||||
# Generate and install config and dllexport files
|
||||
#For config.in searches
|
||||
if(DEFINED ENV{QNX})
|
||||
if(QNX)
|
||||
set(QNX_TARGET_DATASET_DIR "$ENV{QNX_TARGET_DATASET_DIR}")
|
||||
endif()
|
||||
configure_file(config.h.in config.h)
|
||||
|
|
|
@ -1,23 +1,19 @@
|
|||
# Install headers
|
||||
# Header groups
|
||||
file(GLOB base_headers "*.h")
|
||||
if(QNX)
|
||||
install(FILES ${base_headers} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/gtsam/base)
|
||||
else()
|
||||
install(FILES ${base_headers} DESTINATION include/gtsam/base)
|
||||
endif()
|
||||
|
||||
file(GLOB base_headers_tree "treeTraversal/*.h")
|
||||
if(QNX)
|
||||
install(FILES ${base_headers_tree} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/gtsam/base/treeTraversal)
|
||||
else()
|
||||
install(FILES ${base_headers_tree} DESTINATION include/gtsam/base/treeTraversal)
|
||||
endif()
|
||||
|
||||
file(GLOB deprecated_headers "deprecated/*.h")
|
||||
if(QNX)
|
||||
install(FILES ${deprecated_headers} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/gtsam/base/deprecated)
|
||||
else()
|
||||
|
||||
# Installation
|
||||
if(NOT QNX)
|
||||
install(FILES ${base_headers} DESTINATION include/gtsam/base)
|
||||
install(FILES ${base_headers_tree} DESTINATION include/gtsam/base/treeTraversal)
|
||||
install(FILES ${deprecated_headers} DESTINATION include/gtsam/base/deprecated)
|
||||
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)
|
||||
install(FILES ${deprecated_headers} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/gtsam/base/deprecated)
|
||||
endif()
|
||||
|
||||
# Build tests
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
# Install headers
|
||||
file(GLOB basis_headers "*.h")
|
||||
if(QNX)
|
||||
install(FILES ${basis_headers} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/gtsam/basis)
|
||||
else()
|
||||
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
|
||||
|
|
|
@ -26,9 +26,11 @@
|
|||
|
||||
// Paths to example datasets distributed with GTSAM
|
||||
#define GTSAM_SOURCE_TREE_DATASET_DIR "@GTSAM_SOURCE_DIR@/examples/Data"
|
||||
#ifndef __QNX__
|
||||
#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"
|
||||
#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)
|
||||
|
|
|
@ -270,7 +270,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( 0 4 1)
|
||||
|
|
|
@ -69,9 +69,6 @@ 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;
|
||||
|
|
|
@ -731,7 +731,7 @@ TEST(SymbolicBayesTree, COLAMDvsMETIS) {
|
|||
{
|
||||
Ordering ordering = Ordering::Create(Ordering::METIS, sfg);
|
||||
// Linux and Mac split differently when using mettis
|
||||
#if !defined(__APPLE__)
|
||||
#if !defined(__APPLE__) && !defined(__QNX__)
|
||||
EXPECT(assert_equal(Ordering(list_of(3)(2)(5)(0)(4)(1)), ordering));
|
||||
#else
|
||||
EXPECT(assert_equal(Ordering(list_of(5)(4)(2)(1)(0)(3)), ordering));
|
||||
|
@ -742,7 +742,7 @@ TEST(SymbolicBayesTree, COLAMDvsMETIS) {
|
|||
// | | - P( 5 | 0 4)
|
||||
// | - P( 2 | 1 3)
|
||||
SymbolicBayesTree expected;
|
||||
#if !defined(__APPLE__)
|
||||
#if !defined(__APPLE__) && !defined(__QNX__)
|
||||
expected.insertRoot(
|
||||
MakeClique(list_of(2)(4)(1), 3,
|
||||
list_of(
|
||||
|
|
|
@ -14,8 +14,3 @@ 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()
|
Loading…
Reference in New Issue