diff --git a/CMakeLists.txt b/CMakeLists.txt index d363f0735e..070320abec 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -49,26 +49,31 @@ set(CMAKE_CXX_STANDARD "23" CMAKE_CXX_STANDARD_REQUIRED ON CMAKE_CXX_EXTENSIONS include(CTest) include(FetchContent) +include(GNUInstallDirs) FetchContent_Declare( eigen URL "https://gitlab.com/libeigen/eigen/-/archive/3.4.0/eigen-3.4.0.tar.bz2" - URL_HASH MD5=132dde48fe2b563211675626d29f1707) + URL_HASH MD5=132dde48fe2b563211675626d29f1707 + FIND_PACKAGE_ARGS NAMES Eigen3 3.4 REQUIRED NO_MODULE) FetchContent_Declare( fmt URL "https://github.com/fmtlib/fmt/archive/refs/tags/9.1.0.tar.gz" - URL_HASH MD5=21fac48cae8f3b4a5783ae06b443973a) + URL_HASH MD5=21fac48cae8f3b4a5783ae06b443973a + FIND_PACKAGE_ARGS NAMES FMT) FetchContent_Declare( google_benchmark URL "https://github.com/google/benchmark/archive/refs/tags/v1.6.2.tar.gz" - URL_HASH MD5=14d14849e075af116143a161bc3b927b) + URL_HASH MD5=14d14849e075af116143a161bc3b927b + FIND_PACKAGE_ARGS NAMES benchmark) FetchContent_Declare( google_test URL "https://github.com/google/googletest/archive/refs/tags/release-1.12.1.tar.gz" - URL_HASH MD5=e82199374acdfda3f425331028eb4e2a) + URL_HASH MD5=e82199374acdfda3f425331028eb4e2a + FIND_PACKAGE_ARGS NAMES GTest) FetchContent_MakeAvailable(eigen fmt google_test google_benchmark) @@ -78,3 +83,6 @@ add_subdirectory(sample) add_subdirectory(source) add_subdirectory(support) add_subdirectory(test) + +install(DIRECTORY "include/fcarouge" + DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}") diff --git a/INSTALL.md b/INSTALL.md index 1f94fc6f8f..aad3e8889a 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -21,7 +21,7 @@ Build and run the tests and samples on all platforms: git clone --depth 1 https://github.com/FrancoisCarouge/Kalman.git "kalman" cmake -S "kalman" -B "build" -G "Ninja Multi-Config" cmake --build "build" --config "Debug" --parallel -ctest --test-dir "build" --tests-regex "kalman_(test|sample)" --output-on-failure --parallel +ctest --test-dir "build" --build-config "Debug" --tests-regex "kalman_(test|sample)" --output-on-failure --parallel ``` ## Benchmarks diff --git a/benchmark/CMakeLists.txt b/benchmark/CMakeLists.txt index 48b0c0c01f..ee2dbfc765 100644 --- a/benchmark/CMakeLists.txt +++ b/benchmark/CMakeLists.txt @@ -59,7 +59,7 @@ foreach(BENCHMARK ${SOURCES}) "include") target_link_libraries( kalman_benchmark_${NAME}_driver - PRIVATE eigen kalman benchmark::benchmark_main benchmark::benchmark) + PRIVATE Eigen3::Eigen kalman benchmark::benchmark_main benchmark::benchmark) add_test(kalman_benchmark_${NAME} kalman_benchmark_${NAME}_driver "--benchmark_out=${NAME}.json") endforeach() diff --git a/include/CMakeLists.txt b/include/CMakeLists.txt index 2e983a8680..96e00f6f81 100644 --- a/include/CMakeLists.txt +++ b/include/CMakeLists.txt @@ -72,5 +72,5 @@ endif() add_library(kalman INTERFACE) target_include_directories(kalman INTERFACE ".") -target_link_libraries(kalman INTERFACE ${LIBRARIES}) +target_link_libraries(kalman INTERFACE ${LIBRARIES} Eigen3::Eigen) target_compile_options(kalman INTERFACE ${OPTIONS}) diff --git a/sample/CMakeLists.txt b/sample/CMakeLists.txt index cb08f69a94..8744410264 100644 --- a/sample/CMakeLists.txt +++ b/sample/CMakeLists.txt @@ -48,6 +48,7 @@ set(SOURCES foreach(SAMPLE ${SOURCES}) get_filename_component(NAME ${SAMPLE} NAME_WE) add_executable(kalman_sample_${NAME}_driver ${SAMPLE}) - target_link_libraries(kalman_sample_${NAME}_driver PRIVATE eigen kalman main) + target_link_libraries(kalman_sample_${NAME}_driver PRIVATE Eigen3::Eigen + kalman main) add_test(kalman_sample_${NAME} kalman_sample_${NAME}_driver) endforeach() diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 38cff3090b..644341e0d5 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -48,6 +48,7 @@ set(SOURCES foreach(TEST ${SOURCES}) get_filename_component(NAME ${TEST} NAME_WE) add_executable(kalman_test_${NAME}_driver ${TEST}) - target_link_libraries(kalman_test_${NAME}_driver PRIVATE eigen kalman main) + target_link_libraries(kalman_test_${NAME}_driver PRIVATE Eigen3::Eigen kalman + main) add_test(kalman_test_${NAME} kalman_test_${NAME}_driver) endforeach()