From f73e66d376566f8b54feadc967e11d86537cd2bc Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Sun, 14 Jul 2019 09:31:03 +0200 Subject: [PATCH] Fix building of matio_test when building with c++17 --- src/tests/CMakeLists.txt | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/tests/CMakeLists.txt b/src/tests/CMakeLists.txt index 5259370d2..8a4fb8943 100644 --- a/src/tests/CMakeLists.txt +++ b/src/tests/CMakeLists.txt @@ -744,6 +744,16 @@ add_executable(matio_test ${CMAKE_CURRENT_SOURCE_DIR}/unit-tests/arithmetic/matio_test.cc ) +if(${FILESYSTEM_FOUND}) + target_compile_definitions(matio_test PRIVATE -DHAS_STD_FILESYSTEM=1) + if(${find_experimental}) + target_compile_definitions(matio_test PRIVATE -DHAS_STD_FILESYSTEM_EXPERIMENTAL=1) + endif() + target_link_libraries(matio_test PRIVATE std::filesystem) +else() + target_link_libraries(matio_test PRIVATE Boost::filesystem Boost::system) +endif() + target_link_libraries(matio_test PUBLIC Gflags::gflags