Commit 10b40a5e authored by François Grisez's avatar François Grisez

Fix build issue with CMake < 3.1

parent 09e142f0
......@@ -152,7 +152,11 @@ add_definitions("-DHAVE_CONFIG_H")
set(STRICT_OPTIONS_CPP )
set(STRICT_OPTIONS_C )
set(STRICT_OPTIONS_CXX )
if(CMAKE_VERSION VERSION_LESS 3.1 AND NOT APPLE AND NOT MSVC)
set(STRICT_OPTIONS_CXX "-std=c++11")
else()
set(STRICT_OPTIONS_CXX )
endif()
if(MSVC)
if(ENABLE_STRICT)
list(APPEND STRICT_OPTIONS_CPP "/WX")
......
......@@ -62,7 +62,9 @@ if(ENABLE_STATIC)
target_compile_definitions(bctoolbox-static PUBLIC "-DBCTBX_STATIC")
endif()
set_target_properties(bctoolbox-static PROPERTIES LINKER_LANGUAGE "CXX")
set_target_properties(bctoolbox-static PROPERTIES CXX_STANDARD 11 CXX_STANDARD_REQUIRED ON)
if(NOT CMAKE_VERSION VERSION_LESS 3.1)
set_target_properties(bctoolbox-static PROPERTIES CXX_STANDARD 11 CXX_STANDARD_REQUIRED ON)
endif()
set_target_properties(bctoolbox-static PROPERTIES OUTPUT_NAME bctoolbox)
if(HAVE_LIBRT)
target_link_libraries(bctoolbox-static rt)
......@@ -87,7 +89,9 @@ if(ENABLE_SHARED)
target_compile_definitions(bctoolbox PRIVATE "-DBCTBX_EXPORTS")
endif()
set_target_properties(bctoolbox PROPERTIES LINKER_LANGUAGE "CXX")
set_target_properties(bctoolbox PROPERTIES CXX_STANDARD 11 CXX_STANDARD_REQUIRED ON)
if(NOT CMAKE_VERSION VERSION_LESS 3.1)
set_target_properties(bctoolbox PROPERTIES CXX_STANDARD 11 CXX_STANDARD_REQUIRED ON)
endif()
if(ANDROID)
set_target_properties(bctoolbox PROPERTIES OUTPUT_NAME "bctoolbox-${NDK_ARCHITECTURE}")
else()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment