Skip to content

Commit

Permalink
cmake check for avaible C++ standard. Mininum reqiered standard is C++11
Browse files Browse the repository at this point in the history
  • Loading branch information
zdenop committed Feb 15, 2019
1 parent 5fb2509 commit 7f65afb
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#
###############################################################################

cmake_minimum_required(VERSION 2.8.11)
cmake_minimum_required(VERSION 3.3 FATAL_ERROR)

# In-source builds are disabled.
if ("${CMAKE_CURRENT_SOURCE_DIR}" STREQUAL "${CMAKE_CURRENT_BINARY_DIR}")
Expand Down Expand Up @@ -83,6 +83,18 @@ endif()
#
###############################################################################

# Check for C++ standard to use
get_property(known_features GLOBAL PROPERTY CMAKE_CXX_KNOWN_FEATURES)
if(cxx_std_14 IN_LIST known_features)
set(CMAKE_CXX_STANDARD 14)
message("C++14 support enabled...")
else() # minimum requeired standard
set(CMAKE_CXX_STANDARD 11)
message("C++11 support enabled...")
endif()
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)

set(LIBRARY_TYPE SHARED)
if (STATIC)
set(LIBRARY_TYPE)
Expand Down

0 comments on commit 7f65afb

Please sign in to comment.