diff --git a/CMakeLists.txt b/CMakeLists.txt index 3f1c062..577157a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -35,7 +35,7 @@ if(WIN32) endif() # Compiler and Linker Settings -set(CMAKE_CXX_STANDARD 11) +set(CMAKE_CXX_STANDARD 11 CACHE STRING "") set(CMAKE_CXX_STANDARD_REQUIRED True) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC") if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") diff --git a/README.md b/README.md index 2dc62fc..93ff2cc 100644 --- a/README.md +++ b/README.md @@ -41,6 +41,7 @@ There are more cmake options we can use while configuring the build: * `-DUSE_PYTHON=ON` : Build the project with Python support. A pure C++ version will be built if it is turned off. The default value is `ON`. * `-DUSE_PYTHON2=OFF` : Turn it on to use Python2, otherwise Python3 is used by default. * `-DUSE_ROOT=ON` : Build components that depend on ROOT. The default value is `ON`. +* `-DCMAKE_CXX_STANDARD=11|14|17` : specify the C++ standard 11, 14, 17 or newer. Then build and install the result. Default build agent is `make` and you can call it directly. diff --git a/cmake/sniper-config.in b/cmake/sniper-config.in index 7c8467f..e2e6346 100644 --- a/cmake/sniper-config.in +++ b/cmake/sniper-config.in @@ -79,7 +79,7 @@ while test $# -gt 0; do ;; --cflags) - echo "-std=c++11 -fPIC -I$includedir -I@Boost_INCLUDE_DIR@ -I@PYTHON_INCLUDE_DIRS@" + echo "-std=c++@CMAKE_CXX_STANDARD@ -fPIC -I$includedir -I@Boost_INCLUDE_DIR@ -I@PYTHON_INCLUDE_DIRS@" ;; --libdir)