diff --git a/CMakeLists.txt b/CMakeLists.txt index c842ba5..7d0253b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -14,9 +14,6 @@ endif() include(${CMAKE_BINARY_DIR}/conan.cmake) -set(CMAKE_CXX_STANDARD 17) -set(CMAKE_CXX_STANDARD_REQUIRED ON) - set(LIBS_DIR ${CMAKE_CURRENT_BINARY_DIR}/libs) set(EIGEN_MATIO_URL https://raw.githubusercontent.com/tesch1/eigen-matio/master/MATio) set(EIGEN_MATIO_DIR ${LIBS_DIR}/include) @@ -48,6 +45,8 @@ find_package(Eigen3 REQUIRED) add_library(example STATIC src/example.cpp include/example.hpp) target_include_directories(example PRIVATE ${EIGEN_MATIO_DIR}) target_link_libraries(example PRIVATE matio::matio Eigen3::Eigen) +target_compile_features(example PUBLIC cxx_std_17) +set_target_properties(example PROPERTIES CXX_EXTENSIONS OFF) enable_testing() diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 1e17398..d2ef933 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -27,6 +27,8 @@ foreach(file ${TEST_SOURCES}) add_executable(${test_name}_Tests ${file}) target_include_directories(${test_name}_Tests PRIVATE "${CMAKE_SOURCE_DIR}/include") target_link_libraries(${test_name}_Tests PRIVATE example GTest::GTest) + target_compile_features(${test_name}_Tests PUBLIC cxx_std_17) + set_target_properties(${test_name}_Tests PROPERTIES CXX_EXTENSIONS OFF) gtest_add_tests( TARGET ${test_name}_Tests WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}/test")