summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCorentin Le Molgat <corentinl@google.com>2018-01-29 14:59:08 +0100
committerCorentin Le Molgat <corentinl@google.com>2018-02-06 10:37:26 +0100
commit6b6e38a7d53fe01f42ce34384cf4ba4c50e8cb65 (patch)
treeba2478178f138c334fa2963a82325bbf96446ba2
parent4ef88d510e9af9ed7b875a7d2c292b4cf6502485 (diff)
downloadglog-6b6e38a7d53fe01f42ce34384cf4ba4c50e8cb65.tar.gz
glog-6b6e38a7d53fe01f42ce34384cf4ba4c50e8cb65.tar.bz2
glog-6b6e38a7d53fe01f42ce34384cf4ba4c50e8cb65.zip
Rework CMake glog VERSION management.
- Use of Project version properties instead of custom variables - fix missmatch between VERSION (build version) and SOVERSION (API version) src: https://cmake.org/cmake/help/latest/prop_tgt/VERSION.html#prop_tgt:VERSION
-rw-r--r--CMakeLists.txt23
1 files changed, 8 insertions, 15 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index a3ebe35..0707fba 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -8,21 +8,14 @@ if (POLICY CMP0063)
cmake_policy (SET CMP0063 NEW)
endif (POLICY CMP0063)
-project (glog)
-
-set (GLOG_MAJOR_VERSION 0)
-set (GLOG_MINOR_VERSION 3)
-set (GLOG_PATCH_VERSION 5)
-
-set (GLOG_VERSION
- ${GLOG_MAJOR_VERSION}.${GLOG_MINOR_VERSION}.${GLOG_PATCH_VERSION})
+project(glog VERSION 0.3.5 LANGUAGES C CXX)
set (CPACK_PACKAGE_NAME glog)
set (CPACK_PACKAGE_DESCRIPTION_SUMMARY "")
-set (CPACK_PACKAGE_VERSION_MAJOR ${GLOG_MAJOR_VERSION})
-set (CPACK_PACKAGE_VERSION_MINOR ${GLOG_MINOR_VERSION})
-set (CPACK_PACKAGE_VERSION_PATCH ${GLOG_PATCH_VERSION})
-set (CPACK_PACKAGE_VERSION ${GLOG_VERSION})
+set (CPACK_PACKAGE_VERSION_MAJOR ${PROJECT_VERSION_MAJOR})
+set (CPACK_PACKAGE_VERSION_MINOR ${PROJECT_VERSION_MINOR})
+set (CPACK_PACKAGE_VERSION_PATCH ${PROJECT_VERSION_PATCH})
+set (CPACK_PACKAGE_VERSION ${PROJECT_VERSION})
option (WITH_GFLAGS "Use gflags" ON)
option (WITH_THREADS "Enable multithreading support" ON)
@@ -433,8 +426,8 @@ if (gflags_FOUND)
endif (NOT BUILD_SHARED_LIBS)
endif (gflags_FOUND)
-set_target_properties (glog PROPERTIES VERSION ${GLOG_MAJOR_VERSION})
-set_target_properties (glog PROPERTIES SOVERSION ${GLOG_VERSION})
+set_target_properties (glog PROPERTIES VERSION ${PROJECT_VERSION})
+set_target_properties (glog PROPERTIES SOVERSION ${PROJECT_VERSION_MAJOR})
if (WIN32)
target_compile_definitions (glog PUBLIC GLOG_NO_ABBREVIATED_SEVERITIES)
@@ -618,7 +611,7 @@ configure_package_config_file (glog-config.cmake.in
NO_CHECK_REQUIRED_COMPONENTS_MACRO)
write_basic_package_version_file (glog-config-version.cmake VERSION
- ${GLOG_VERSION} COMPATIBILITY SameMajorVersion)
+ ${PROJECT_VERSION} COMPATIBILITY SameMajorVersion)
export (TARGETS glog NAMESPACE glog:: FILE glog-targets.cmake)
export (PACKAGE glog)