Skip to content

Commit 945e884

Browse files
Merge pull request #95 from Tehada/master
Add check for boost version to set appropriate c++ standard.
2 parents 2763f04 + 0e83af9 commit 945e884

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

cmake/SetCXXStandard.cmake

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,14 @@
11

2+
find_package(Boost 1.56.0 REQUIRED)
3+
if(Boost_VERSION VERSION_LESS "1.72.0")
4+
set(CMAKE_CXX_STANDARD 11 CACHE INTERNAL "specifies the C++ standard whose features are requested to build this target")
5+
else()
6+
set(CMAKE_CXX_STANDARD 14 CACHE INTERNAL "specifies the C++ standard whose features are requested to build this target")
7+
endif()
28

3-
set(CMAKE_CXX_STANDARD 11 CACHE INTERNAL "specifies the C++ standard whose features are requested to build this target")
49
set(CMAKE_CXX_STANDARD_REQUIRED ON)
510
if (NOT "${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
611
### Even though CMAKE_CXX_STANDARD_REQUIRED is supported since CMake 3.1, it doesn't work for Emscripten em++ together with
712
### Cmake 3.6.
8-
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++${CMAKE_CXX_STANDARD}")
13+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++${CMAKE_CXX_STANDARD}")
914
endif()

0 commit comments

Comments
 (0)