From e1d4050ad9ba8b487a51e16f7a1ee64ca801a537 Mon Sep 17 00:00:00 2001 From: Axel Huebl Date: Sat, 7 Apr 2018 18:06:04 +0200 Subject: [PATCH] C++11: Target Compile Property Express the C++11 dependency as public compile property rather than a CMake project-wide flag. --- CMakeLists.txt | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index b467b2fe66..906bbcecaa 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -9,10 +9,6 @@ set(openPMD_STANDARD_VERSION 1.1.0) set(CMAKE_MODULE_PATH "${openPMD_SOURCE_DIR}/cmake") -# Force C++11 -set(CMAKE_CXX_STANDARD 11) -set(CMAKE_CXX_STANDARD_REQUIRED True) - # Project structure ########################################################### # @@ -234,6 +230,9 @@ set(IO_SOURCE add_Library(openPMD ${CORE_SOURCE} ${IO_SOURCE}) # properties +target_compile_features(openPMD + PUBLIC cxx_std_11 +) set_target_properties(openPMD PROPERTIES POSITION_INDEPENDENT_CODE ON )