Skip to content

Commit 977a4cf

Browse files
Merge pull request danielaparker#612 from SwooshyCueb/609
Update CMake policy usage to 3.14
2 parents d279f58 + d396ec8 commit 977a4cf

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

CMakeLists.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
cmake_minimum_required(VERSION 3.5)
1+
cmake_minimum_required(VERSION 3.5...3.14)
22

33
project(jsoncons CXX)
44

@@ -60,7 +60,7 @@ configure_package_config_file(cmake/Config.cmake
6060

6161
# jsoncons is header-only and does not depend on the architecture.
6262

63-
if (${CMAKE_VERSION} VERSION_LESS "3.14.0")
63+
if (CMAKE_VERSION VERSION_LESS "3.14.0")
6464
write_basic_package_version_file(${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake
6565
VERSION ${${PROJECT_NAME}_VERSION}
6666
COMPATIBILITY AnyNewerVersion)

examples/build/cmake/CMakeLists.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# jsoncons examples CMake file
44
#
55

6-
cmake_minimum_required (VERSION 2.8)
6+
cmake_minimum_required(VERSION 3.5...3.14)
77

88
# load global config
99
include (../../build/cmake/Config.cmake)
@@ -27,7 +27,7 @@ foreach(example_file ${Example_sources})
2727
# Create an executable with the example name and file
2828
add_executable(${example_name} ${example_file})
2929

30-
if (${CMAKE_SYSTEM_NAME} STREQUAL "Linux" AND ${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang")
30+
if ((CMAKE_SYSTEM_NAME STREQUAL "Linux") AND (CMAKE_CXX_COMPILER_ID STREQUAL "Clang"))
3131
# special link option on Linux because llvm stl rely on GNU stl
3232
target_link_libraries(${example_name} -Wl,-lstdc++)
3333
endif()

test/CMakeLists.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ set(JSONCONS_THIRD_PARTY_INCLUDE_DIR ${JSONCONS_TESTS_DIR}/thirdparty)
5050
set(CATCH_INCLUDE_DIR ${JSONCONS_THIRD_PARTY_INCLUDE_DIR}/catch)
5151
add_library(catch INTERFACE)
5252

53-
if (${CMAKE_VERSION} VERSION_LESS "3.8.0")
53+
if (CMAKE_VERSION VERSION_LESS "3.8.0")
5454
target_compile_features(catch INTERFACE cxx_range_for) # for C++11 - flags
5555
else()
5656
target_compile_features(catch INTERFACE cxx_std_11)
@@ -198,7 +198,7 @@ add_executable(unit_tests
198198
corelib/src/testmain.cpp
199199
)
200200

201-
if (${CMAKE_VERSION} VERSION_LESS "3.8.0")
201+
if (CMAKE_VERSION VERSION_LESS "3.8.0")
202202
target_compile_features(unit_tests INTERFACE cxx_range_for) # for C++11 - flags
203203
else()
204204
target_compile_features(unit_tests INTERFACE cxx_std_11)

0 commit comments

Comments
 (0)