summaryrefslogtreecommitdiffstats
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorEndi Sukma Dewata <edewata@redhat.com>2012-09-30 12:21:46 -0500
committerAde Lee <alee@redhat.com>2012-10-01 14:15:44 -0400
commitf81718c563ea12240e161a807013acd2d6eb1f2e (patch)
tree2aa664ed414086ac0a19c7eb6b0ac9e3a57af256 /CMakeLists.txt
parentaa1c7e757ee01759cb08f3dd5d0556cfe2ef8e32 (diff)
downloadpki-f81718c563ea12240e161a807013acd2d6eb1f2e.tar.gz
pki-f81718c563ea12240e161a807013acd2d6eb1f2e.tar.xz
pki-f81718c563ea12240e161a807013acd2d6eb1f2e.zip
Using RPM version number in CMake.
The RPM spec files have been modified to pass the full RPM version number to CMake. The version number contains the product version number, release number, milestone, and platform. The CMake scritps will parse and use this version number to generate Java manifest files. The product version number will be used as the specification version and full version number will be used as the implementation version. Ticket #339
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt10
1 files changed, 7 insertions, 3 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index bf61fbc48..3bb5be00b 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -6,9 +6,13 @@ cmake_minimum_required(VERSION 2.6.0)
# global needed variables
set(APPLICATION_NAME ${PROJECT_NAME})
-set(APPLICATION_VERSION_MAJOR "10")
-set(APPLICATION_VERSION_MINOR "0")
-set(APPLICATION_VERSION_PATCH "0")
+if (NOT ${VERSION})
+ set(VERSION "10.0.0")
+endif(NOT ${VERSION})
+
+string(REGEX REPLACE "^([0-9]+).*" "\\1" APPLICATION_VERSION_MAJOR ${VERSION})
+string(REGEX REPLACE "^[0-9]+\\.([0-9]+).*" "\\1" APPLICATION_VERSION_MINOR ${VERSION})
+string(REGEX REPLACE "^[0-9]+\\.[0-9]+\\.([0-9]+).*" "\\1" APPLICATION_VERSION_PATCH ${VERSION})
option(WITH_JAVADOC "Build with Javadoc" ON)