Skip to content

Commit 46d980b

Browse files
committed
fix CMake policy CMP0048 warning Tencent#1154
1 parent c4c6a65 commit 46d980b

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

CMakeLists.txt

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,18 @@ endif()
99

1010
SET(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/CMakeModules)
1111

12-
PROJECT(RapidJSON CXX)
13-
1412
set(LIB_MAJOR_VERSION "1")
1513
set(LIB_MINOR_VERSION "1")
1614
set(LIB_PATCH_VERSION "0")
1715
set(LIB_VERSION_STRING "${LIB_MAJOR_VERSION}.${LIB_MINOR_VERSION}.${LIB_PATCH_VERSION}")
1816

17+
if (CMAKE_VERSION VERSION_LESS 3.0)
18+
PROJECT(RapidJSON CXX)
19+
else()
20+
cmake_policy(SET CMP0048 NEW)
21+
PROJECT(RapidJSON VERSION "${LIB_VERSION_STRING}" LANGUAGES CXX)
22+
endif()
23+
1924
# compile in release with debug info mode by default
2025
if(NOT CMAKE_BUILD_TYPE)
2126
set(CMAKE_BUILD_TYPE "RelWithDebInfo" CACHE STRING "Choose the type of build, options are: Debug Release RelWithDebInfo MinSizeRel." FORCE)

0 commit comments

Comments
 (0)