2021-11-22 02:20:10 +01:00
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
2019-04-14 21:07:42 +02:00
project ( basalt )
set ( CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake_modules/" ${ CMAKE_MODULE_PATH } )
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
if ( NOT EIGEN_ROOT )
set ( EIGEN_ROOT "${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/basalt-headers/thirdparty/eigen" )
endif ( )
2019-04-14 21:07:42 +02:00
string ( TOLOWER "${PROJECT_NAME}" PROJECT_NAME_LOWERCASE )
find_program ( DPKG_PROGRAM dpkg DOC "dpkg program of Debian-based systems" )
if ( DPKG_PROGRAM )
execute_process (
C O M M A N D $ { D P K G _ P R O G R A M } - - p r i n t - a r c h i t e c t u r e
O U T P U T _ V A R I A B L E C P A C K _ D E B I A N _ P A C K A G E _ A R C H I T E C T U R E
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
O U T P U T _ S T R I P _ T R A I L I N G _ W H I T E S P A C E )
2019-04-14 21:07:42 +02:00
endif ( DPKG_PROGRAM )
find_program ( LSB_RELEASE_PROGRAM lsb_release DOC "lsb_release program of Debian-based systems" )
if ( LSB_RELEASE_PROGRAM )
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
execute_process ( COMMAND ${ LSB_RELEASE_PROGRAM } -rs
2019-04-14 21:07:42 +02:00
O U T P U T _ V A R I A B L E L S B _ R E L E A S E _ I D _ S H O R T
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
O U T P U T _ S T R I P _ T R A I L I N G _ W H I T E S P A C E )
2019-04-14 21:07:42 +02:00
2020-04-28 15:14:22 +02:00
if ( ${ LSB_RELEASE_ID_SHORT } EQUAL "20.04" )
2020-04-28 15:58:09 +02:00
set ( DEBIAN_DEPENDS "libtbb2, liblz4-1, libbz2-1.0, libboost-filesystem1.71.0, libboost-date-time1.71.0, libboost-program-options1.71.0, libboost-regex1.71.0, libopencv-dev, libglew2.1, libjpeg8, libpng16-16, librealsense2, librealsense2-dkms, librealsense2-gl, librealsense2-utils" )
2020-04-28 15:14:22 +02:00
elseif ( ${ LSB_RELEASE_ID_SHORT } EQUAL "18.04" )
2019-06-13 15:45:55 +02:00
set ( DEBIAN_DEPENDS "libtbb2, liblz4-1, libbz2-1.0, libboost-filesystem1.65.1, libboost-date-time1.65.1, libboost-program-options1.65.1, libboost-regex1.65.1, libopencv-dev, libglew2.0, libjpeg8, libpng16-16, librealsense2, librealsense2-dkms, librealsense2-gl, librealsense2-utils" )
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
elseif ( ${ LSB_RELEASE_ID_SHORT } EQUAL "16.04" )
2019-06-13 16:17:55 +02:00
set ( DEBIAN_DEPENDS "libtbb2, liblz4-1, libbz2-1.0, libboost-filesystem1.58.0, libboost-date-time1.58.0, libboost-program-options1.58.0, libboost-regex1.58.0, libopencv-dev, libglew1.13, libjpeg8, libpng12-0, libstdc++6, librealsense2, librealsense2-dkms, librealsense2-gl, librealsense2-utils" )
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 ( )
2019-04-14 21:07:42 +02:00
endif ( LSB_RELEASE_PROGRAM )
string ( TIMESTAMP PROJECT_VERSION_REVISION "%Y%m%d%H%M" )
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 ( CPACK_GENERATOR "DEB" )
set ( CPACK_DEBIAN_PACKAGE_MAINTAINER "Vladyslav Usenko <vlad.usenko@tum.de>" )
set ( CPACK_PACKAGE_VERSION_MAJOR "0" )
set ( CPACK_PACKAGE_VERSION_MINOR "1" )
set ( CPACK_PACKAGE_VERSION_PATCH "0-${PROJECT_VERSION_REVISION}~${LSB_RELEASE_ID_SHORT}" )
set ( CPACK_DEBIAN_PACKAGE_DEPENDS ${ DEBIAN_DEPENDS } )
set ( CPACK_PACKAGE_FILE_NAME "${PROJECT_NAME_LOWERCASE}_${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}_${CPACK_DEBIAN_PACKAGE_ARCHITECTURE}" )
set ( CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/LICENSE" )
2019-04-14 21:07:42 +02:00
include ( CPack )
# Configure CCache if available
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
if ( NOT CMAKE_C_COMPILER_LAUNCHER AND NOT CMAKE_CXX_COMPILER_LAUNCHER )
find_program ( CCACHE_PROGRAM ccache )
if ( CCACHE_PROGRAM )
message ( STATUS "Found ccache: ${CCACHE_PROGRAM}" )
set ( CMAKE_C_COMPILER_LAUNCHER ${ CCACHE_PROGRAM } )
set ( CMAKE_CXX_COMPILER_LAUNCHER ${ CCACHE_PROGRAM } )
else ( )
message ( STATUS "Dind't find ccache" )
endif ( )
else ( )
message ( STATUS "Compiler launcher already set. Not configuring ccache." )
message ( STATUS "CMAKE_C_COMPILER_LAUNCHER: ${CMAKE_C_COMPILER_LAUNCHER}" )
message ( STATUS "CMAKE_CXX_COMPILER_LAUNCHER: ${CMAKE_CXX_COMPILER_LAUNCHER}" )
endif ( )
2019-04-14 21:07:42 +02:00
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
if ( NOT CMAKE_BUILD_TYPE )
set ( CMAKE_BUILD_TYPE Release )
endif ( )
if ( NOT CXX_MARCH )
set ( CXX_MARCH native )
endif ( )
2019-04-14 21:07:42 +02:00
2021-11-21 18:27:34 +01:00
IF ( NOT APPLE OR NOT CMAKE_SYSTEM_PROCESSOR STREQUAL "arm64" )
set ( BASALT_MARCH_FLAGS "-march=${CXX_MARCH}" )
ELSE ( )
message ( STATUS "Running on Apple ${CMAKE_SYSTEM_PROCESSOR}. Disabled -march flag." )
ENDIF ( )
2019-04-14 21:07:42 +02:00
set ( CMAKE_CXX_STANDARD 17 )
set ( CMAKE_CXX_STANDARD_REQUIRED ON )
set ( CMAKE_CXX_EXTENSIONS OFF )
set ( CMAKE_POSITION_INDEPENDENT_CODE ON )
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
2019-04-14 21:07:42 +02:00
# Flags used for CHECK_CXX_SOURCE_COMPILES
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 ( CMAKE_REQUIRED_FLAGS "-Wno-error" )
# save flags passed by user
set ( BASALT_PASSED_CXX_FLAGS "${CMAKE_CXX_FLAGS}" )
set ( CMAKE_CXX_FLAGS_DEBUG "-O0 -g -DEIGEN_INITIALIZE_MATRICES_BY_NAN" ) # cmake default: "-g"
set ( CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O3 -g -DEIGEN_INITIALIZE_MATRICES_BY_NAN" ) # cmake default: "-O2 -g -DNDEBUG"
set ( CMAKE_CXX_FLAGS_RELEASE "-O3 -DNDEBUG" ) # cmake default: "-O3 -DNDEBUG"
2019-06-09 20:49:03 +02:00
set ( CMAKE_CXX_FLAGS_CIDEBUG "-O0 -DEIGEN_INITIALIZE_MATRICES_BY_NAN" ) # CI version with no debug symbols
set ( CMAKE_CXX_FLAGS_CIRELWITHDEBINFO "-O3 -DEIGEN_INITIALIZE_MATRICES_BY_NAN" ) # CI version with no debug symbols
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
# base set of compile flags
2019-07-16 13:59:09 +02:00
set ( BASALT_CXX_FLAGS "-Wall -Wextra -Werror -Wno-error=unused-parameter -ftemplate-backtrace-limit=0" )
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
# clang-specific compile flags
if ( CMAKE_CXX_COMPILER_ID STREQUAL "Clang" OR CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang" )
2019-11-06 10:38:10 +01:00
set ( BASALT_CXX_FLAGS "${BASALT_CXX_FLAGS} -Wno-exceptions -fcolor-diagnostics -frelaxed-template-template-args -Wno-error=deprecated-declarations" )
2019-11-10 15:48:45 +01:00
2020-04-28 15:14:22 +02:00
if ( CMAKE_CXX_COMPILER_ID STREQUAL "Clang" AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 10 )
# These are disabled to avoid lot's of warnings in Eigen code with clang 10
2020-06-24 12:19:55 +02:00
set ( BASALT_CXX_FLAGS "${BASALT_CXX_FLAGS} -Wno-misleading-indentation -Wno-error=deprecated-copy" )
2020-04-28 15:14:22 +02:00
endif ( )
2019-11-10 15:48:45 +01:00
# - Added TBB_USE_GLIBCXX_VERSION macro to specify the version of GNU
# libstdc++ when it cannot be properly recognized, e.g. when used
# with Clang on Linux* OS. Adopted from https://github.com/wjakob/tbb
if ( NOT TBB_USE_GLIBCXX_VERSION AND UNIX AND NOT APPLE )
if ( "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" )
string ( REPLACE "." "0" TBB_USE_GLIBCXX_VERSION ${ CMAKE_CXX_COMPILER_VERSION } )
endif ( )
add_definitions ( -DTBB_USE_GLIBCXX_VERSION= ${ TBB_USE_GLIBCXX_VERSION } )
endif ( )
2019-07-16 14:06:32 +02:00
else ( )
2019-11-10 13:48:54 +01:00
set ( BASALT_CXX_FLAGS "${BASALT_CXX_FLAGS} -Wno-error=maybe-uninitialized -Wno-error=implicit-fallthrough" )
2020-04-28 15:14:22 +02:00
if ( CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 9 )
# These are disabled to avoid lot's of warnings in Eigen code with gcc-9
2020-06-24 12:19:55 +02:00
set ( BASALT_CXX_FLAGS "${BASALT_CXX_FLAGS} -Wno-error=deprecated-copy" )
2020-04-28 15:14:22 +02:00
endif ( )
2021-10-15 14:50:02 +02:00
if ( CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 10.0 )
# These are disabled due to warnings in pangolin
#set(BASALT_CXX_FLAGS "${BASALT_CXX_FLAGS} -Wno-error=parentheses")
set ( BASALT_CXX_FLAGS "${BASALT_CXX_FLAGS} -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
endif ( )
# Set platform / compiler specific compile flags and checks
if ( APPLE )
# Need to investigate how to reliably detect and use OpenMP on macOS...
2021-01-29 15:14:58 +01:00
# set(USE_OPENMP_DEFAULT OFF)
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
# Among others, setting CMAKE_FIND_FRAMEWORK to LAST fixed issues
# with installed Mono that contains old headers (libpng, ...).
# See: https://github.com/openMVG/openMVG/issues/1349#issuecomment-401492811
set ( CMAKE_FIND_FRAMEWORK LAST )
2020-04-17 21:17:51 +02:00
if ( CMAKE_SYSTEM_VERSION VERSION_LESS 19.0.0 )
2019-11-07 17:42:02 +01:00
# use brewed llvm's libc++
2020-04-17 21:17:51 +02:00
include_directories ( "/usr/local/opt/llvm/include/c++/v1" )
link_directories ( "/usr/local/opt/llvm/lib" )
add_compile_options ( "-nostdinc++" )
2020-04-18 07:36:48 +02:00
#set(STD_CXX_FS c++fs)
2019-11-07 17:42:02 +01:00
2019-12-26 21:43:43 +01:00
# Workaround for cmake not to filter the manually added standard include path
# See: https://gitlab.kitware.com/cmake/cmake/issues/19227#note_669894
2020-04-17 21:17:51 +02:00
list ( REMOVE_ITEM CMAKE_CXX_IMPLICIT_INCLUDE_DIRECTORIES "/usr/local/opt/llvm/include/c++/v1" )
endif ( )
2019-11-07 17:42:02 +01:00
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
if ( CMAKE_CXX_COMPILER_ID STREQUAL "Clang" )
message ( STATUS "Detected macOS with non-Apple clang" )
elseif ( CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang" )
message ( STATUS "Detected macOS with Apple clang" )
# Apple clang on macOS < 10.14 Mojave is too old
if ( CMAKE_SYSTEM_VERSION VERSION_LESS 18.0.0 )
message ( WARNING "Detected Darwin version ${CMAKE_SYSTEM_VERSION}, which is earlier than macos 10.14 Mojave. Apple clang is too old and not supported. Use clang from homebrew." )
endif ( )
else ( )
message ( WARNING "Detected macOS with unsupported compiler ${CMAKE_CXX_COMPILER_ID}" )
endif ( )
elseif ( UNIX )
2021-01-29 15:14:58 +01:00
# set(USE_OPENMP_DEFAULT ON)
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
# assume libstdc++
set ( STD_CXX_FS stdc++fs )
if ( CMAKE_CXX_COMPILER_ID STREQUAL "Clang" )
message ( STATUS "Detected Linux with clang." )
2021-10-15 17:32:53 +02:00
# Note: Whatever the issue was, this seems to not be an issue any more, at least with more recent clang and Ubuntu versions (tested clang-12 and Ubuntu 18.04)
#message(WARNING "Clang on Linux is currently not fully supported. You'll likely need to get a recent version of TBB.")
#set(LINUX_CLANG 1)
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
elseif ( CMAKE_CXX_COMPILER_ID STREQUAL "GNU" )
message ( STATUS "Detected Linux with gcc." )
else ( )
message ( WARNING "Detected Linux with unsupported compiler ${CMAKE_CXX_COMPILER_ID}" )
endif ( )
else ( )
message ( WARNING "Only Linux and macOS are currently supported" )
endif ( )
# OpenMP option and compile flags
2021-01-29 15:14:58 +01:00
#
# Note: OpenMP and TBB don't mix well, so we disable Eigen's parallelization.
# It's trying to paralellize matrix products during SC, which we run in a parallel_reduce using TBB.
# Turns out using OpenMP can slow down the computby factor 10-100x! So for now we discable it completely.
# One place where Eigen's parallelization could still have been useful is the CG solver in the mapper.
# We could in the future investiagte other implementations (paralellized with TBB) or selectively enabling
# Eigen's parallelization just for CG, setting number of threads to 1 everywhere else.
# Another way to ensure Eigen doesn't use OpenMP regardless of how it was built is setting the environment
# variable OMP_NUM_THREADS=1 beofre running the application.
#
# See: https://eigen.tuxfamily.org/dox/TopicMultiThreading.html
#
# If we enable BLAS / LAPACK either directly or via thirdparty libs like ceres,
# make sure to disable OpenMP for the linked BLAS library. In particular on Ubuntu it seems OpenBLAS is often installed,
# and it can have similar issues in multithreaded applications if it's own parallelization with OpenMP is enabled.
# You can set the environment varaibles OPENBLAS_NUM_THREADS=1 or OMP_NUM_THREADS=1. This is also mentioned in the ceres
# installation documentation.
#
# See also: https://github.com/xianyi/OpenBLAS/wiki/faq#multi-threaded
#
# Set EIGEN_DONT_PARALLELIZE to be sure it doesn't use openmp,
# just in case some dependency enables openmp without us noticing.
set ( BASALT_CXX_FLAGS "${BASALT_CXX_FLAGS} -DEIGEN_DONT_PARALLELIZE" )
#option(USE_OPENMP "Use OpenMP (e.g. for parallel computation in Eigen)" ${USE_OPENMP_DEFAULT})
#if(USE_OPENMP)
# message(STATUS "OpenMP Enabled")
# set(BASALT_CXX_FLAGS "${BASALT_CXX_FLAGS} -fopenmp")
#else()
# message(STATUS "OpenMP Disabled")
#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
2021-10-15 14:50:02 +02:00
# Make specialization for double / float optional.
# Disabling them can be useful for better compile times during development.
option ( BASALT_INSTANTIATIONS_DOUBLE "Instatiate templates for Scalar=double." ON )
option ( BASALT_INSTANTIATIONS_FLOAT "Instatiate templates for Scalar=float." ON )
if ( BASALT_INSTANTIATIONS_DOUBLE )
list ( APPEND BASALT_COMPILE_DEFINITIONS BASALT_INSTANTIATIONS_DOUBLE )
endif ( )
if ( BASALT_INSTANTIATIONS_FLOAT )
list ( APPEND BASALT_COMPILE_DEFINITIONS BASALT_INSTANTIATIONS_FLOAT )
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
# setup combined compiler flags
2021-11-21 18:27:34 +01:00
set ( CMAKE_CXX_FLAGS "${BASALT_CXX_FLAGS} ${BASALT_MARCH_FLAGS} ${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
2019-04-14 21:07:42 +02:00
set ( EIGEN_INCLUDE_DIR_HINTS ${ EIGEN_ROOT } )
2021-10-15 14:50:02 +02:00
find_package ( Eigen3 3.4.0 EXACT REQUIRED MODULE )
2019-04-14 21:07:42 +02:00
message ( STATUS "Found Eigen headers in: ${EIGEN3_INCLUDE_DIR}" )
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
if ( NOT EIGEN3_INCLUDE_DIR MATCHES "^${EIGEN_ROOT}" )
message ( WARNING "Found Eigen headers are outside of specified EIGEN_ROOT '${EIGEN_ROOT}'" )
endif ( )
2019-04-14 21:07:42 +02:00
find_package ( TBB REQUIRED )
2021-10-15 16:59:43 +02:00
message ( STATUS "Found TBB ${TBB_VERSION_MAJOR}.${TBB_VERSION_MINOR} (interface version ${TBB_INTERFACE_VERSION}) headers in: ${TBB_INCLUDE_DIRS}" )
2020-06-23 16:58:33 +02:00
if ( TBB_INTERFACE_VERSION LESS 11004 )
# enable global_control header for earlier TBB versions (Ubuntu 16.04, 18.04)
add_definitions ( -DTBB_PREVIEW_GLOBAL_CONTROL )
endif ( )
2019-04-14 21:07:42 +02:00
2021-11-22 02:20:10 +01:00
# NOTE: not specifying version, since 2, 3 or 4 is fine
find_package ( OpenCV REQUIRED COMPONENTS core imgproc calib3d highgui )
message ( STATUS "Found OpenCV ${OpenCV_VERSION} headers in: ${OpenCV_INCLUDE_DIRS}" )
2019-04-14 21:07:42 +02:00
message ( STATUS "Found OpenCV_LIBS: ${OpenCV_LIBS}" )
2021-11-22 02:20:10 +01:00
# Add our own custom scoped opencv target since none is provided by OpenCV itself
add_library ( basalt::opencv INTERFACE IMPORTED )
set_property ( TARGET basalt::opencv PROPERTY INTERFACE_INCLUDE_DIRECTORIES ${ OpenCV_INCLUDE_DIRS } )
set_property ( TARGET basalt::opencv PROPERTY INTERFACE_LINK_LIBRARIES ${ OpenCV_LIBS } )
2021-11-11 16:30:15 +01:00
find_package ( fmt REQUIRED )
2021-11-22 02:20:10 +01:00
message ( STATUS "Found {fmt} ${fmt_VERSION} in: ${fmt_DIR}" )
2019-04-14 21:07:42 +02:00
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 ( thirdparty )
2019-04-14 21:07:42 +02:00
2021-11-22 02:20:10 +01:00
# custom scoped cli11 target
add_library ( basalt::cli11 INTERFACE IMPORTED )
set_property ( TARGET basalt::cli11 PROPERTY INTERFACE_INCLUDE_DIRECTORIES ${ CMAKE_CURRENT_SOURCE_DIR } /thirdparty/CLI11/include )
2019-04-14 21:07:42 +02:00
2021-11-22 02:20:10 +01:00
# custom scoped magic_enum target
add_library ( basalt::magic_enum INTERFACE IMPORTED )
set_property ( TARGET basalt::magic_enum PROPERTY INTERFACE_INCLUDE_DIRECTORIES ${ CMAKE_CURRENT_SOURCE_DIR } /thirdparty/magic_enum/include )
2019-04-14 21:07:42 +02:00
add_library ( basalt SHARED
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
s r c / i o / d a t a s e t _ i o . c p p
s r c / i o / m a r g _ d a t a _ i o . c p p
2019-07-08 18:53:39 +02:00
s r c / c a l i b r a t i o n / a p r i l g r i d . c p p
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
s r c / c a l i b r a t i o n / c a l i b r a i t o n _ h e l p e r . c p p
s r c / c a l i b r a t i o n / v i g n e t t e . c p p
s r c / o p t i c a l _ f l o w / o p t i c a l _ f l o w . c p p
2021-10-15 14:50:02 +02:00
s r c / l i n e a r i z a t i o n / l a n d m a r k _ b l o c k . c p p
s r c / l i n e a r i z a t i o n / l i n e a r i z a t i o n _ b a s e . c p p
s r c / l i n e a r i z a t i o n / l i n e a r i z a t i o n _ a b s _ q r . c p p
s r c / l i n e a r i z a t i o n / l i n e a r i z a t i o n _ a b s _ s c . c p p
s r c / l i n e a r i z a t i o n / l i n e a r i z a t i o n _ r e l _ s c . c p p
s r c / u t i l s / v i o _ c o n f i g . c p p
s r c / u t i l s / s y s t e m _ u t i l s . c p p
s r c / u t i l s / t i m e _ u t i l s . c p p
s r c / u t i l s / k e y p o i n t s . c p p
s r c / v i _ e s t i m a t o r / m a r g _ h e l p e r . c p p
s r c / v i _ e s t i m a t o r / s q r t _ k e y p o i n t _ v i o . c p p
s r c / v i _ e s t i m a t o r / s q r t _ k e y p o i n t _ v o . c p p
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
s r c / v i _ e s t i m a t o r / v i o _ e s t i m a t o r . c p p
s r c / v i _ e s t i m a t o r / b a _ b a s e . c p p
2021-10-15 14:50:02 +02:00
s r c / v i _ e s t i m a t o r / s q r t _ b a _ b a s e . c p p
s r c / v i _ e s t i m a t o r / s c _ b a _ b a s e . c p p
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
s r c / v i _ e s t i m a t o r / n f r _ m a p p e r . c p p
2021-10-15 14:50:02 +02:00
s r c / v i _ e s t i m a t o r / l a n d m a r k _ d a t a b a s e . c p p )
2019-04-14 21:07:42 +02:00
2021-10-15 14:50:02 +02:00
target_link_libraries ( basalt
2021-11-22 02:20:10 +01:00
P U B L I C $ { S T D _ C X X _ F S } b a s a l t : : o p e n c v b a s a l t : : b a s a l t - h e a d e r s T B B : : t b b
P R I V A T E b a s a l t : : m a g i c _ e n u m r o s b a g a p r i l t a g o p e n g v n l o h m a n n : : j s o n f m t : : f m t )
target_include_directories ( basalt PUBLIC ${ CMAKE_CURRENT_SOURCE_DIR } /include )
2021-10-15 14:50:02 +02:00
target_compile_definitions ( basalt PUBLIC ${ BASALT_COMPILE_DEFINITIONS } )
#target_compile_definitions(basalt PUBLIC BASALT_DISABLE_ASSERTS)
2019-04-14 21:07:42 +02:00
2019-07-16 11:42:06 +02:00
add_executable ( basalt_calibrate src/calibrate.cpp src/calibration/cam_calib.cpp )
2021-11-22 02:20:10 +01:00
target_link_libraries ( basalt_calibrate basalt pangolin basalt::cli11 )
2019-04-14 21:07:42 +02:00
2019-07-16 11:42:06 +02:00
add_executable ( basalt_calibrate_imu src/calibrate_imu.cpp src/calibration/cam_imu_calib.cpp )
2021-11-22 02:20:10 +01:00
target_link_libraries ( basalt_calibrate_imu basalt pangolin basalt::cli11 )
2019-04-14 21:07:42 +02:00
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_executable ( basalt_vio_sim src/vio_sim.cpp )
2021-11-22 02:20:10 +01:00
target_link_libraries ( basalt_vio_sim basalt pangolin basalt::cli11 )
2019-04-14 21:07:42 +02:00
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_executable ( basalt_mapper_sim src/mapper_sim.cpp )
2021-11-22 02:20:10 +01:00
target_link_libraries ( basalt_mapper_sim basalt pangolin basalt::cli11 )
2019-04-14 21:07:42 +02:00
2021-10-15 14:50:02 +02:00
# mapper sim native doesn't use template free interface
if ( BASALT_INSTANTIATIONS_DOUBLE )
add_executable ( basalt_mapper_sim_naive src/mapper_sim_naive.cpp )
2021-11-22 02:20:10 +01:00
target_link_libraries ( basalt_mapper_sim_naive basalt pangolin basalt::cli11 )
2021-10-15 14:50:02 +02:00
endif ( )
2019-04-14 21:07:42 +02:00
add_executable ( basalt_mapper src/mapper.cpp )
2021-11-22 02:20:10 +01:00
target_link_libraries ( basalt_mapper basalt pangolin basalt::cli11 )
2019-04-14 21:07:42 +02:00
add_executable ( basalt_opt_flow src/opt_flow.cpp )
2021-11-22 02:20:10 +01:00
target_link_libraries ( basalt_opt_flow basalt pangolin basalt::cli11 )
2019-04-14 21:07:42 +02:00
add_executable ( basalt_vio src/vio.cpp )
2021-11-22 02:20:10 +01:00
target_link_libraries ( basalt_vio basalt pangolin basalt::cli11 )
2019-04-14 21:07:42 +02:00
2019-07-29 15:08:54 +02:00
add_executable ( basalt_time_alignment src/time_alignment.cpp )
2021-11-22 02:20:10 +01:00
target_link_libraries ( basalt_time_alignment basalt pangolin basalt::cli11 )
2019-07-29 15:08:54 +02:00
2019-08-23 10:01:40 +02:00
add_executable ( basalt_kitti_eval src/kitti_eval.cpp )
2021-11-22 02:20:10 +01:00
target_link_libraries ( basalt_kitti_eval basalt::basalt-headers basalt::cli11 )
2019-08-23 10:01:40 +02:00
2019-06-03 13:37:53 +02:00
find_package ( realsense2 QUIET )
if ( realsense2_FOUND )
2019-06-13 13:37:17 +02:00
add_executable ( basalt_rs_t265_record src/rs_t265_record.cpp src/device/rs_t265.cpp )
2021-11-22 02:20:10 +01:00
target_link_libraries ( basalt_rs_t265_record basalt realsense2::realsense2 pangolin basalt::cli11 )
2019-06-13 13:37:17 +02:00
add_executable ( basalt_rs_t265_vio src/rs_t265_vio.cpp src/device/rs_t265.cpp )
2021-11-22 02:20:10 +01:00
target_link_libraries ( basalt_rs_t265_vio basalt realsense2::realsense2 pangolin basalt::cli11 )
2019-06-03 13:37:53 +02:00
endif ( )
2019-04-14 21:07:42 +02:00
2021-10-15 14:50:02 +02:00
install ( TARGETS basalt_calibrate basalt_calibrate_imu basalt_vio_sim basalt_mapper_sim basalt_mapper basalt_opt_flow basalt_vio basalt_kitti_eval basalt_time_alignment basalt
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
E X P O R T B a s a l t T a r g e t s
R U N T I M E D E S T I N A T I O N $ { C M A K E _ I N S T A L L _ P R E F I X } / b i n
L I B R A R Y D E S T I N A T I O N $ { C M A K E _ I N S T A L L _ P R E F I X } / l i b
A R C H I V E D E S T I N A T I O N $ { C M A K E _ I N S T A L L _ P R E F I X } / l i b )
2019-04-14 21:07:42 +02:00
2021-10-15 14:50:02 +02:00
if ( BASALT_INSTANTIATIONS_DOUBLE )
install ( TARGETS basalt_mapper_sim_naive
E X P O R T B a s a l t T a r g e t s
R U N T I M E D E S T I N A T I O N $ { C M A K E _ I N S T A L L _ P R E F I X } / b i n
L I B R A R Y D E S T I N A T I O N $ { C M A K E _ I N S T A L L _ P R E F I X } / l i b
A R C H I V E D E S T I N A T I O N $ { C M A K E _ I N S T A L L _ P R E F I X } / l i b )
endif ( )
2019-06-13 15:45:55 +02:00
if ( realsense2_FOUND )
install ( TARGETS basalt_rs_t265_record basalt_rs_t265_vio
E X P O R T B a s a l t T a r g e t s
R U N T I M E D E S T I N A T I O N $ { C M A K E _ I N S T A L L _ P R E F I X } / b i n
L I B R A R Y D E S T I N A T I O N $ { C M A K E _ I N S T A L L _ P R E F I X } / l i b
A R C H I V E D E S T I N A T I O N $ { C M A K E _ I N S T A L L _ P R E F I X } / l i b )
endif ( )
2019-09-13 11:22:59 +02:00
file ( GLOB SCRIPTS_TO_INSTALL "${CMAKE_CURRENT_SOURCE_DIR}/scripts/basalt_*.py" )
2019-09-12 18:59:42 +02:00
install ( PROGRAMS ${ SCRIPTS_TO_INSTALL } DESTINATION ${ CMAKE_INSTALL_PREFIX } /bin )
2019-06-13 15:45:55 +02:00
2019-04-14 21:07:42 +02:00
file ( GLOB CONFIG_FILES "${CMAKE_CURRENT_SOURCE_DIR}/data/*.json" )
2019-06-07 14:42:18 +02:00
install ( FILES ${ CONFIG_FILES }
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
D E S T I N A T I O N $ { C M A K E _ I N S T A L L _ P R E F I X } / e t c / b a s a l t )
2019-04-14 21:07:42 +02:00
# Replace install() to do-nothing macro.
macro ( install )
endmacro ( )
# Include subproject (or any other CMake code) with "disabled" install().
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
enable_testing ( )
2019-04-14 21:07:42 +02:00
add_subdirectory ( thirdparty/basalt-headers/test )
add_subdirectory ( test )
# Restore original install() behavior.
macro ( install )
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
_install ( ${ ARGN } )
2019-04-14 21:07:42 +02:00
endmacro ( )