Skip to content

Commit

Permalink
Add compatibility with older 2.8 version of CMake
Browse files Browse the repository at this point in the history
Some legacy systems (Ubuntu 14.04, RHEL7.2) have older versions of CMake.
  • Loading branch information
akira-miasato authored Apr 26, 2017
1 parent a147e63 commit e19ef2b
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,13 +1,22 @@
cmake_minimum_required(VERSION 3.2)
project(json11 VERSION 1.0.0 LANGUAGES CXX)
cmake_minimum_required(VERSION 2.8)
if (CMAKE_VERSION VERSION_LESS "3")
project(json11 CXX)
else()
project(json11 VERSION 1.0.0 LANGUAGES CXX)
endif()

enable_testing()

option(JSON11_BUILD_TESTS "Build unit tests" OFF)
option(JSON11_ENABLE_DR1467_CANARY "Enable canary test for DR 1467" OFF)

set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
if(CMAKE_VERSION VERSION_LESS "3")
add_definitions(-std=c++11)
else()
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
endif()

if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
set(CMAKE_INSTALL_PREFIX /usr)
endif()
Expand Down

0 comments on commit e19ef2b

Please sign in to comment.