basalt/thirdparty/CMakeLists.txt

145 lines
5.3 KiB
CMake
Raw Normal View History

cmake_minimum_required(VERSION 3.10...3.18)
ci and cmake improvements Changes along the line of https://gitlab.com/VladyslavUsenko/basalt-headers/merge_requests/1 and https://gitlab.com/VladyslavUsenko/basalt-headers/merge_requests/2, and more. Warning free builds on macos 10.11 - 10.14, Ubuntu Xenial & Bionic. (macOS 10.14 is not yet in CI, but tested locally.) Changes similar to basalt-headers: - cmake: raise minimum version to 3.10 - cmake: add workarounds to support macOS < 10.14 - cmake: set ccache only if not yet set and print info - cmake: add NDEBUG define (to disable asserts) for release build and EIGEN_INITIALIZE_MATRICES_BY_NAN for others. Add externally supplied CMAKE_CXX_FLAGS at the end to allow overriding the defaults. - tests: add enable_testing() in main CMakeLists.txt, such that we can call 'ctest' from build folder. - tests: simplify gtest / gtest_main linking - tests: use the newer gtest_discover_tests instead of add_test, which adds a separate cmake test for every gtest, even with multiple defined in a single executable. Its not only more reliable and less verbose in the CMakeLists.txt, but also allows to run 'ctest' without -V and still see status for every individual test. - ci: add build jobs for Debug/RelWithDebInfo on Bionic, as well as builds on Xenial and El Capitan. Use templates to simplify .gitlab-ci.yml - ci: clang-format job Additional changes: - cmake: unify formatting - cmake: various diagnostic warnings for situations that are unsupported (should help with gitlab issues). - cmake options to disable openmp, pass custom eigen root, compiler-launcher, additional CXX_FLAGS that can override default flags also for submodules (opengv etc), ... - cmake: moved configuration of submodule libs to `thirdparty/CMakeLists.txt`. This includes various fixes for limiatations of the thirdparty cmake definitions. In particular ensures that correct eigen is used, that opengv respects march and CXX_FLAGS passed from command line. - cmake: simplified linking of executables. Linking `basalt` is enough. - cmake: basalt sources now build with the minimal disabled warnings ("-Wall Wextra -Werror -Wno-unused-parameter -ftemplate-backtrace-limit=0", and additionally "-Wno-exceptions" for clang). Additional flags are now only set for the submodule targets in thirdparty. - tests: Running ctest in build folder now also runs the unit tests from basalt-headers. - ci: in addition to the additional compile jobs and there are now also 'test' jobs, that check that the executables in the deb's work (runs on all branches, not just master).
2019-04-24 14:21:24 +02:00
add_library(nlohmann::json INTERFACE IMPORTED GLOBAL)
set_property(TARGET nlohmann::json PROPERTY INTERFACE_INCLUDE_DIRECTORIES ${CMAKE_CURRENT_SOURCE_DIR}/json/)
add_subdirectory(basalt-headers EXCLUDE_FROM_ALL)
ci and cmake improvements Changes along the line of https://gitlab.com/VladyslavUsenko/basalt-headers/merge_requests/1 and https://gitlab.com/VladyslavUsenko/basalt-headers/merge_requests/2, and more. Warning free builds on macos 10.11 - 10.14, Ubuntu Xenial & Bionic. (macOS 10.14 is not yet in CI, but tested locally.) Changes similar to basalt-headers: - cmake: raise minimum version to 3.10 - cmake: add workarounds to support macOS < 10.14 - cmake: set ccache only if not yet set and print info - cmake: add NDEBUG define (to disable asserts) for release build and EIGEN_INITIALIZE_MATRICES_BY_NAN for others. Add externally supplied CMAKE_CXX_FLAGS at the end to allow overriding the defaults. - tests: add enable_testing() in main CMakeLists.txt, such that we can call 'ctest' from build folder. - tests: simplify gtest / gtest_main linking - tests: use the newer gtest_discover_tests instead of add_test, which adds a separate cmake test for every gtest, even with multiple defined in a single executable. Its not only more reliable and less verbose in the CMakeLists.txt, but also allows to run 'ctest' without -V and still see status for every individual test. - ci: add build jobs for Debug/RelWithDebInfo on Bionic, as well as builds on Xenial and El Capitan. Use templates to simplify .gitlab-ci.yml - ci: clang-format job Additional changes: - cmake: unify formatting - cmake: various diagnostic warnings for situations that are unsupported (should help with gitlab issues). - cmake options to disable openmp, pass custom eigen root, compiler-launcher, additional CXX_FLAGS that can override default flags also for submodules (opengv etc), ... - cmake: moved configuration of submodule libs to `thirdparty/CMakeLists.txt`. This includes various fixes for limiatations of the thirdparty cmake definitions. In particular ensures that correct eigen is used, that opengv respects march and CXX_FLAGS passed from command line. - cmake: simplified linking of executables. Linking `basalt` is enough. - cmake: basalt sources now build with the minimal disabled warnings ("-Wall Wextra -Werror -Wno-unused-parameter -ftemplate-backtrace-limit=0", and additionally "-Wno-exceptions" for clang). Additional flags are now only set for the submodule targets in thirdparty. - tests: Running ctest in build folder now also runs the unit tests from basalt-headers. - ci: in addition to the additional compile jobs and there are now also 'test' jobs, that check that the executables in the deb's work (runs on all branches, not just master).
2019-04-24 14:21:24 +02:00
add_subdirectory(ros EXCLUDE_FROM_ALL)
add_subdirectory(apriltag EXCLUDE_FROM_ALL)
set(BUILD_SHARED_LIBS OFF CACHE BOOL "Enable BUILD_SHARED_LIBS")
set(BUILD_TESTS OFF CACHE BOOL "Enable BUILD_TESTS")
set(BUILD_TOOLS OFF CACHE BOOL "Enable BUILD_TOOLS")
set(CMAKE_EXPORT_NO_PACKAGE_REGISTRY ON)
set(BUILD_PANGOLIN_LIBOPENEXR OFF CACHE BOOL "Enable BUILD_PANGOLIN_LIBOPENEXR")
set(BUILD_PANGOLIN_PYTHON OFF CACHE BOOL "Enable BUILD_PANGOLIN_PYTHON")
set(BUILD_EXAMPLES OFF CACHE BOOL "Enable BUILD_EXAMPLES")
2019-05-16 17:43:28 +02:00
set(BUILD_PANGOLIN_LIBREALSENSE OFF CACHE BOOL "Enable librealsense")
set(BUILD_PANGOLIN_LIBREALSENSE2 OFF CACHE BOOL "Enable librealsense2")
ci and cmake improvements Changes along the line of https://gitlab.com/VladyslavUsenko/basalt-headers/merge_requests/1 and https://gitlab.com/VladyslavUsenko/basalt-headers/merge_requests/2, and more. Warning free builds on macos 10.11 - 10.14, Ubuntu Xenial & Bionic. (macOS 10.14 is not yet in CI, but tested locally.) Changes similar to basalt-headers: - cmake: raise minimum version to 3.10 - cmake: add workarounds to support macOS < 10.14 - cmake: set ccache only if not yet set and print info - cmake: add NDEBUG define (to disable asserts) for release build and EIGEN_INITIALIZE_MATRICES_BY_NAN for others. Add externally supplied CMAKE_CXX_FLAGS at the end to allow overriding the defaults. - tests: add enable_testing() in main CMakeLists.txt, such that we can call 'ctest' from build folder. - tests: simplify gtest / gtest_main linking - tests: use the newer gtest_discover_tests instead of add_test, which adds a separate cmake test for every gtest, even with multiple defined in a single executable. Its not only more reliable and less verbose in the CMakeLists.txt, but also allows to run 'ctest' without -V and still see status for every individual test. - ci: add build jobs for Debug/RelWithDebInfo on Bionic, as well as builds on Xenial and El Capitan. Use templates to simplify .gitlab-ci.yml - ci: clang-format job Additional changes: - cmake: unify formatting - cmake: various diagnostic warnings for situations that are unsupported (should help with gitlab issues). - cmake options to disable openmp, pass custom eigen root, compiler-launcher, additional CXX_FLAGS that can override default flags also for submodules (opengv etc), ... - cmake: moved configuration of submodule libs to `thirdparty/CMakeLists.txt`. This includes various fixes for limiatations of the thirdparty cmake definitions. In particular ensures that correct eigen is used, that opengv respects march and CXX_FLAGS passed from command line. - cmake: simplified linking of executables. Linking `basalt` is enough. - cmake: basalt sources now build with the minimal disabled warnings ("-Wall Wextra -Werror -Wno-unused-parameter -ftemplate-backtrace-limit=0", and additionally "-Wno-exceptions" for clang). Additional flags are now only set for the submodule targets in thirdparty. - tests: Running ctest in build folder now also runs the unit tests from basalt-headers. - ci: in addition to the additional compile jobs and there are now also 'test' jobs, that check that the executables in the deb's work (runs on all branches, not just master).
2019-04-24 14:21:24 +02:00
# disable ffmpeg b/c build is broken on macOS since 2022-02
# see: https://github.com/stevenlovegrove/Pangolin/issues/737
set(BUILD_PANGOLIN_FFMPEG OFF CACHE BOOL "Build support for ffmpeg video input")
ci and cmake improvements Changes along the line of https://gitlab.com/VladyslavUsenko/basalt-headers/merge_requests/1 and https://gitlab.com/VladyslavUsenko/basalt-headers/merge_requests/2, and more. Warning free builds on macos 10.11 - 10.14, Ubuntu Xenial & Bionic. (macOS 10.14 is not yet in CI, but tested locally.) Changes similar to basalt-headers: - cmake: raise minimum version to 3.10 - cmake: add workarounds to support macOS < 10.14 - cmake: set ccache only if not yet set and print info - cmake: add NDEBUG define (to disable asserts) for release build and EIGEN_INITIALIZE_MATRICES_BY_NAN for others. Add externally supplied CMAKE_CXX_FLAGS at the end to allow overriding the defaults. - tests: add enable_testing() in main CMakeLists.txt, such that we can call 'ctest' from build folder. - tests: simplify gtest / gtest_main linking - tests: use the newer gtest_discover_tests instead of add_test, which adds a separate cmake test for every gtest, even with multiple defined in a single executable. Its not only more reliable and less verbose in the CMakeLists.txt, but also allows to run 'ctest' without -V and still see status for every individual test. - ci: add build jobs for Debug/RelWithDebInfo on Bionic, as well as builds on Xenial and El Capitan. Use templates to simplify .gitlab-ci.yml - ci: clang-format job Additional changes: - cmake: unify formatting - cmake: various diagnostic warnings for situations that are unsupported (should help with gitlab issues). - cmake options to disable openmp, pass custom eigen root, compiler-launcher, additional CXX_FLAGS that can override default flags also for submodules (opengv etc), ... - cmake: moved configuration of submodule libs to `thirdparty/CMakeLists.txt`. This includes various fixes for limiatations of the thirdparty cmake definitions. In particular ensures that correct eigen is used, that opengv respects march and CXX_FLAGS passed from command line. - cmake: simplified linking of executables. Linking `basalt` is enough. - cmake: basalt sources now build with the minimal disabled warnings ("-Wall Wextra -Werror -Wno-unused-parameter -ftemplate-backtrace-limit=0", and additionally "-Wno-exceptions" for clang). Additional flags are now only set for the submodule targets in thirdparty. - tests: Running ctest in build folder now also runs the unit tests from basalt-headers. - ci: in addition to the additional compile jobs and there are now also 'test' jobs, that check that the executables in the deb's work (runs on all branches, not just master).
2019-04-24 14:21:24 +02:00
set(EIGEN_INCLUDE_DIR "${EIGEN3_INCLUDE_DIR}")
set(EIGEN_INCLUDE_DIRS "${EIGEN3_INCLUDE_DIR}")
2019-06-18 15:16:24 +02:00
# Hack to disable march=native in opengv
macro(add_definitions)
if(NOT ${ARGV0} STREQUAL "-march=native")
_add_definitions(${ARGN})
endif()
endmacro()
ci and cmake improvements Changes along the line of https://gitlab.com/VladyslavUsenko/basalt-headers/merge_requests/1 and https://gitlab.com/VladyslavUsenko/basalt-headers/merge_requests/2, and more. Warning free builds on macos 10.11 - 10.14, Ubuntu Xenial & Bionic. (macOS 10.14 is not yet in CI, but tested locally.) Changes similar to basalt-headers: - cmake: raise minimum version to 3.10 - cmake: add workarounds to support macOS < 10.14 - cmake: set ccache only if not yet set and print info - cmake: add NDEBUG define (to disable asserts) for release build and EIGEN_INITIALIZE_MATRICES_BY_NAN for others. Add externally supplied CMAKE_CXX_FLAGS at the end to allow overriding the defaults. - tests: add enable_testing() in main CMakeLists.txt, such that we can call 'ctest' from build folder. - tests: simplify gtest / gtest_main linking - tests: use the newer gtest_discover_tests instead of add_test, which adds a separate cmake test for every gtest, even with multiple defined in a single executable. Its not only more reliable and less verbose in the CMakeLists.txt, but also allows to run 'ctest' without -V and still see status for every individual test. - ci: add build jobs for Debug/RelWithDebInfo on Bionic, as well as builds on Xenial and El Capitan. Use templates to simplify .gitlab-ci.yml - ci: clang-format job Additional changes: - cmake: unify formatting - cmake: various diagnostic warnings for situations that are unsupported (should help with gitlab issues). - cmake options to disable openmp, pass custom eigen root, compiler-launcher, additional CXX_FLAGS that can override default flags also for submodules (opengv etc), ... - cmake: moved configuration of submodule libs to `thirdparty/CMakeLists.txt`. This includes various fixes for limiatations of the thirdparty cmake definitions. In particular ensures that correct eigen is used, that opengv respects march and CXX_FLAGS passed from command line. - cmake: simplified linking of executables. Linking `basalt` is enough. - cmake: basalt sources now build with the minimal disabled warnings ("-Wall Wextra -Werror -Wno-unused-parameter -ftemplate-backtrace-limit=0", and additionally "-Wno-exceptions" for clang). Additional flags are now only set for the submodule targets in thirdparty. - tests: Running ctest in build folder now also runs the unit tests from basalt-headers. - ci: in addition to the additional compile jobs and there are now also 'test' jobs, that check that the executables in the deb's work (runs on all branches, not just master).
2019-04-24 14:21:24 +02:00
add_subdirectory(opengv EXCLUDE_FROM_ALL)
# Hack to disable CPack in Pangolin.
macro(include)
if(NOT ${ARGV0} STREQUAL "CPack")
_include(${ARGN})
endif()
endmacro()
add_subdirectory(Pangolin EXCLUDE_FROM_ALL)
# fix aprilgrid
target_compile_options(apriltag PRIVATE "-Wno-unused-private-field")
# fix opengv: c++17 and debug postfix
set_target_properties(opengv PROPERTIES
CXX_STANDARD 17
DEBUG_POSTFIX "")
# fix opengv: compile options (CMAKE_CXX_FLAGS is overwritten by Opengv)
target_compile_options(opengv PRIVATE
-Wno-unused-private-field
2021-11-21 18:27:34 +01:00
${BASALT_MARCH_FLAGS}
"SHELL:${BASALT_PASSED_CXX_FLAGS}")
ci and cmake improvements Changes along the line of https://gitlab.com/VladyslavUsenko/basalt-headers/merge_requests/1 and https://gitlab.com/VladyslavUsenko/basalt-headers/merge_requests/2, and more. Warning free builds on macos 10.11 - 10.14, Ubuntu Xenial & Bionic. (macOS 10.14 is not yet in CI, but tested locally.) Changes similar to basalt-headers: - cmake: raise minimum version to 3.10 - cmake: add workarounds to support macOS < 10.14 - cmake: set ccache only if not yet set and print info - cmake: add NDEBUG define (to disable asserts) for release build and EIGEN_INITIALIZE_MATRICES_BY_NAN for others. Add externally supplied CMAKE_CXX_FLAGS at the end to allow overriding the defaults. - tests: add enable_testing() in main CMakeLists.txt, such that we can call 'ctest' from build folder. - tests: simplify gtest / gtest_main linking - tests: use the newer gtest_discover_tests instead of add_test, which adds a separate cmake test for every gtest, even with multiple defined in a single executable. Its not only more reliable and less verbose in the CMakeLists.txt, but also allows to run 'ctest' without -V and still see status for every individual test. - ci: add build jobs for Debug/RelWithDebInfo on Bionic, as well as builds on Xenial and El Capitan. Use templates to simplify .gitlab-ci.yml - ci: clang-format job Additional changes: - cmake: unify formatting - cmake: various diagnostic warnings for situations that are unsupported (should help with gitlab issues). - cmake options to disable openmp, pass custom eigen root, compiler-launcher, additional CXX_FLAGS that can override default flags also for submodules (opengv etc), ... - cmake: moved configuration of submodule libs to `thirdparty/CMakeLists.txt`. This includes various fixes for limiatations of the thirdparty cmake definitions. In particular ensures that correct eigen is used, that opengv respects march and CXX_FLAGS passed from command line. - cmake: simplified linking of executables. Linking `basalt` is enough. - cmake: basalt sources now build with the minimal disabled warnings ("-Wall Wextra -Werror -Wno-unused-parameter -ftemplate-backtrace-limit=0", and additionally "-Wno-exceptions" for clang). Additional flags are now only set for the submodule targets in thirdparty. - tests: Running ctest in build folder now also runs the unit tests from basalt-headers. - ci: in addition to the additional compile jobs and there are now also 'test' jobs, that check that the executables in the deb's work (runs on all branches, not just master).
2019-04-24 14:21:24 +02:00
# TODO: enable once mpark issue is fixed upstream pangolin
#set_target_properties(pangolin PROPERTIES
# CXX_STANDARD 17)
# fix pangolin: gcc
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
target_compile_options(pangolin PRIVATE "-Wno-implicit-fallthrough")
endif()
# fix pangolin: macOS
if(APPLE)
target_compile_options(pangolin PRIVATE "-Wno-objc-missing-super-calls")
endif()
# fix pangolin: macOS >= 10.14 Mojave
if(APPLE AND CMAKE_SYSTEM_VERSION VERSION_GREATER_EQUAL 18.0.0)
2021-11-21 18:51:55 +01:00
target_compile_options(pangolin PRIVATE "-Wno-deprecated-declarations")
2021-11-21 18:58:56 +01:00
if((CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang" OR CMAKE_CXX_COMPILER_ID STREQUAL "Clang") AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 13.0.0)
2021-11-21 18:51:55 +01:00
target_compile_options(pangolin PRIVATE "-Wno-deprecated-copy")
endif()
ci and cmake improvements Changes along the line of https://gitlab.com/VladyslavUsenko/basalt-headers/merge_requests/1 and https://gitlab.com/VladyslavUsenko/basalt-headers/merge_requests/2, and more. Warning free builds on macos 10.11 - 10.14, Ubuntu Xenial & Bionic. (macOS 10.14 is not yet in CI, but tested locally.) Changes similar to basalt-headers: - cmake: raise minimum version to 3.10 - cmake: add workarounds to support macOS < 10.14 - cmake: set ccache only if not yet set and print info - cmake: add NDEBUG define (to disable asserts) for release build and EIGEN_INITIALIZE_MATRICES_BY_NAN for others. Add externally supplied CMAKE_CXX_FLAGS at the end to allow overriding the defaults. - tests: add enable_testing() in main CMakeLists.txt, such that we can call 'ctest' from build folder. - tests: simplify gtest / gtest_main linking - tests: use the newer gtest_discover_tests instead of add_test, which adds a separate cmake test for every gtest, even with multiple defined in a single executable. Its not only more reliable and less verbose in the CMakeLists.txt, but also allows to run 'ctest' without -V and still see status for every individual test. - ci: add build jobs for Debug/RelWithDebInfo on Bionic, as well as builds on Xenial and El Capitan. Use templates to simplify .gitlab-ci.yml - ci: clang-format job Additional changes: - cmake: unify formatting - cmake: various diagnostic warnings for situations that are unsupported (should help with gitlab issues). - cmake options to disable openmp, pass custom eigen root, compiler-launcher, additional CXX_FLAGS that can override default flags also for submodules (opengv etc), ... - cmake: moved configuration of submodule libs to `thirdparty/CMakeLists.txt`. This includes various fixes for limiatations of the thirdparty cmake definitions. In particular ensures that correct eigen is used, that opengv respects march and CXX_FLAGS passed from command line. - cmake: simplified linking of executables. Linking `basalt` is enough. - cmake: basalt sources now build with the minimal disabled warnings ("-Wall Wextra -Werror -Wno-unused-parameter -ftemplate-backtrace-limit=0", and additionally "-Wno-exceptions" for clang). Additional flags are now only set for the submodule targets in thirdparty. - tests: Running ctest in build folder now also runs the unit tests from basalt-headers. - ci: in addition to the additional compile jobs and there are now also 'test' jobs, that check that the executables in the deb's work (runs on all branches, not just master).
2019-04-24 14:21:24 +02:00
endif()
# fix pangolin: clang
if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang" OR CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang")
target_compile_options(pangolin PRIVATE "-Wno-null-pointer-arithmetic")
endif()
# fix pangolin: clang >= 8.0
if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang" AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 8.0.0)
target_compile_options(pangolin PRIVATE "-Wno-defaulted-function-deleted")
endif()
# fix pangolin: clang >= 10.0
if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang" AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 10.0.0)
target_compile_options(pangolin PRIVATE "-Wno-deprecated-copy")
endif()
2021-11-06 00:45:58 +01:00
# fix pangolin: clang >= 13.0
if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang" AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 13.0.0)
target_compile_options(pangolin PRIVATE "-Wno-unused-but-set-variable;-Wno-null-pointer-subtraction")
endif()
# fix pangolin: GCC >= 9.0
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 9.0)
target_compile_options(pangolin PRIVATE "-Wno-stringop-truncation;-Wno-deprecated-copy")
endif()
# fix pangolin: GCC >= 10.0
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 10.0)
target_compile_options(pangolin PRIVATE "-Wno-parentheses")
endif()
ci and cmake improvements Changes along the line of https://gitlab.com/VladyslavUsenko/basalt-headers/merge_requests/1 and https://gitlab.com/VladyslavUsenko/basalt-headers/merge_requests/2, and more. Warning free builds on macos 10.11 - 10.14, Ubuntu Xenial & Bionic. (macOS 10.14 is not yet in CI, but tested locally.) Changes similar to basalt-headers: - cmake: raise minimum version to 3.10 - cmake: add workarounds to support macOS < 10.14 - cmake: set ccache only if not yet set and print info - cmake: add NDEBUG define (to disable asserts) for release build and EIGEN_INITIALIZE_MATRICES_BY_NAN for others. Add externally supplied CMAKE_CXX_FLAGS at the end to allow overriding the defaults. - tests: add enable_testing() in main CMakeLists.txt, such that we can call 'ctest' from build folder. - tests: simplify gtest / gtest_main linking - tests: use the newer gtest_discover_tests instead of add_test, which adds a separate cmake test for every gtest, even with multiple defined in a single executable. Its not only more reliable and less verbose in the CMakeLists.txt, but also allows to run 'ctest' without -V and still see status for every individual test. - ci: add build jobs for Debug/RelWithDebInfo on Bionic, as well as builds on Xenial and El Capitan. Use templates to simplify .gitlab-ci.yml - ci: clang-format job Additional changes: - cmake: unify formatting - cmake: various diagnostic warnings for situations that are unsupported (should help with gitlab issues). - cmake options to disable openmp, pass custom eigen root, compiler-launcher, additional CXX_FLAGS that can override default flags also for submodules (opengv etc), ... - cmake: moved configuration of submodule libs to `thirdparty/CMakeLists.txt`. This includes various fixes for limiatations of the thirdparty cmake definitions. In particular ensures that correct eigen is used, that opengv respects march and CXX_FLAGS passed from command line. - cmake: simplified linking of executables. Linking `basalt` is enough. - cmake: basalt sources now build with the minimal disabled warnings ("-Wall Wextra -Werror -Wno-unused-parameter -ftemplate-backtrace-limit=0", and additionally "-Wno-exceptions" for clang). Additional flags are now only set for the submodule targets in thirdparty. - tests: Running ctest in build folder now also runs the unit tests from basalt-headers. - ci: in addition to the additional compile jobs and there are now also 'test' jobs, that check that the executables in the deb's work (runs on all branches, not just master).
2019-04-24 14:21:24 +02:00
# check here the directories for the pangolin and opengv targets, and
# confirm that the eigen-related include dirs match.
foreach(_target opengv pangolin)
get_target_property(_include_dirs ${_target} INTERFACE_INCLUDE_DIRECTORIES)
foreach(_dir IN LISTS _include_dirs)
if("${_dir}" MATCHES ".*/eigen3?(/unsupported)?$")
if(NOT _dir MATCHES "^${EIGEN3_INCLUDE_DIR}.*")
endif()
endif()
endforeach()
endforeach()
# opengv and pangolin assume that eigen is found outside the source
# directory and thus include it in INTERFACE_INCLUDE_DIRECTORIES,
# which makes cmake complain that that property contains paths in the
# source folder. Thus, we update the property to only include these
# eigen paths in the "BUILD_INTERFACE" (not "INSTALL").
if (EIGEN3_INCLUDE_DIR MATCHES "^${CMAKE_SOURCE_DIR}.*")
foreach(_target opengv pangolin)
get_target_property(_include_dirs ${_target} INTERFACE_INCLUDE_DIRECTORIES)
set(_include_dirs_new "")
foreach(_dir IN LISTS _include_dirs)
if(_dir MATCHES ".*/eigen(/unsupported)?$")
string(REGEX REPLACE "(^${CMAKE_SOURCE_DIR}.*$)" "$<BUILD_INTERFACE:\\1>" _dir "${_dir}")
endif()
list(APPEND _include_dirs_new "${_dir}")
endforeach()
set_target_properties(${_target} PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${_include_dirs_new}")
endforeach()
endif()