diff --git a/CMakeLists.txt b/CMakeLists.txt index 0275672e0..3b9ac512b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -9,13 +9,18 @@ endif() SET(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/CMakeModules) -PROJECT(RapidJSON CXX) - set(LIB_MAJOR_VERSION "1") set(LIB_MINOR_VERSION "1") set(LIB_PATCH_VERSION "0") set(LIB_VERSION_STRING "${LIB_MAJOR_VERSION}.${LIB_MINOR_VERSION}.${LIB_PATCH_VERSION}") +if (CMAKE_VERSION VERSION_LESS 3.0) + PROJECT(RapidJSON CXX) +else() + cmake_policy(SET CMP0048 NEW) + PROJECT(RapidJSON VERSION "${LIB_VERSION_STRING}" LANGUAGES CXX) +endif() + # compile in release with debug info mode by default if(NOT CMAKE_BUILD_TYPE) set(CMAKE_BUILD_TYPE "RelWithDebInfo" CACHE STRING "Choose the type of build, options are: Debug Release RelWithDebInfo MinSizeRel." FORCE)