summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Haszlakiewicz <erh+git@nimenees.com>2020-05-30 19:36:54 +0000
committerEric Haszlakiewicz <erh+git@nimenees.com>2020-06-03 03:09:11 +0000
commitee9f67c81a3c2a44557f0cc16dc136c140293252 (patch)
treee38f9056f29987ed5192e7f7672b6617c6d69459
parentcc5c4345c323bcf2357ab0ada86d803e55a98cd3 (diff)
downloadjson-c-0.13.tar.gz
Issue #626: Restore compatibility with cmake 2.8 by explicitly defining the PROJECT_VERSION* variables.json-c-0.13
(cherry picked from commit fe308b886248b1a5fa610b04c9871907f80de3d2)
-rw-r--r--CMakeLists.txt17
1 files changed, 15 insertions, 2 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index c2e653b..710fa6a 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,8 +1,21 @@
#Licensed under the MIT license. See LICENSE file in the project root for full license information.
cmake_minimum_required(VERSION 2.8.7)
-cmake_policy(SET CMP0048 NEW)
-project(json-c VERSION 0.13.1)
+if(POLICY CMP0048)
+ cmake_policy(SET CMP0048 NEW)
+endif()
+
+# JSON-C library is C only project.
+if (CMAKE_VERSION VERSION_LESS 3.0)
+ project(json-c)
+ set(PROJECT_VERSION_MAJOR "0")
+ set(PROJECT_VERSION_MINOR "13")
+ set(PROJECT_VERSION_PATCH "1")
+ set(PROJECT_VERSION "${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}")
+else()
+ project(json-c LANGUAGES C VERSION 0.13.1)
+endif()
+
include(CheckSymbolExists)