|
|
|
@ -153,14 +153,28 @@ if(WIN32) |
|
|
|
|
endif() |
|
|
|
|
|
|
|
|
|
# Use C99 standard |
|
|
|
|
set(CMAKE_C_STANDARD 99) |
|
|
|
|
if (NOT DEFINED CMAKE_C_STANDARD) |
|
|
|
|
set(CMAKE_C_STANDARD 99) |
|
|
|
|
endif() |
|
|
|
|
|
|
|
|
|
# Add c++11 flags |
|
|
|
|
set(CMAKE_CXX_STANDARD 11) |
|
|
|
|
set(CMAKE_CXX_STANDARD_REQUIRED ON) |
|
|
|
|
set(CMAKE_CXX_EXTENSIONS OFF) |
|
|
|
|
if (NOT DEFINED CMAKE_CXX_STANDARD) |
|
|
|
|
set(CMAKE_CXX_STANDARD 11) |
|
|
|
|
else() |
|
|
|
|
if (CMAKE_CXX_STANDARD LESS 11) |
|
|
|
|
message(FATAL_ERROR "CMAKE_CXX_STANDARD is less than 11, please specify at least SET(CMAKE_CXX_STANDARD 11)") |
|
|
|
|
endif() |
|
|
|
|
endif() |
|
|
|
|
if (NOT DEFINED CMAKE_CXX_STANDARD_REQUIRED) |
|
|
|
|
set(CMAKE_CXX_STANDARD_REQUIRED ON) |
|
|
|
|
endif() |
|
|
|
|
if (NOT DEFINED CMAKE_CXX_EXTENSIONS) |
|
|
|
|
set(CMAKE_CXX_EXTENSIONS OFF) |
|
|
|
|
endif() |
|
|
|
|
|
|
|
|
|
set(CMAKE_POSITION_INDEPENDENT_CODE TRUE) |
|
|
|
|
if (NOT DEFINED CMAKE_POSITION_INDEPENDENT_CODE) |
|
|
|
|
set(CMAKE_POSITION_INDEPENDENT_CODE TRUE) |
|
|
|
|
endif() |
|
|
|
|
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules") |
|
|
|
|
|
|
|
|
|
if(MSVC) |
|
|
|
|