Commit 060254d6 authored by Johannes Zarl-Zierl's avatar Johannes Zarl-Zierl
Browse files

Use RELEASE_SERVICE_VERSION and ecm_setup_version

With this change there is now only one source of "versioning-truth" on
the cmake side, and release-tools can automatically increase the version
in the future.
parent 8a0feb77
......@@ -3,7 +3,13 @@ cmake_minimum_required(VERSION 3.5)
# Set minimum OS X target
set(CMAKE_OSX_DEPLOYMENT_TARGET 10.9)
project(marble)
# KDE Application Version, managed by release script
set (RELEASE_SERVICE_VERSION_MAJOR "21")
set (RELEASE_SERVICE_VERSION_MINOR "04")
set (RELEASE_SERVICE_VERSION_MICRO "00")
set (RELEASE_SERVICE_VERSION "${RELEASE_SERVICE_VERSION_MAJOR}.${RELEASE_SERVICE_VERSION_MINOR}.${RELEASE_SERVICE_VERSION_MICRO}")
project(marble VERSION ${RELEASE_SERVICE_VERSION})
####################################################
# CMake Settings
......
PROJECT(astro)
PROJECT(astro VERSION ${RELEASE_SERVICE_VERSION})
INCLUDE_DIRECTORIES(
${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_BINARY_DIR}
)
set(ASTRO_LIB_VERSION "0.17.20")
set(ASTRO_LIB_SOVERSION "1")
set(ASTRO_CMAKECONFIGNAME Astro)
include(ECMSetupVersion)
ecm_setup_version(PROJECT
VARIABLE_PREFIX ASTRO_LIB
VERSION_HEADER "${CMAKE_CURRENT_BINARY_DIR}/astro_version.h"
PACKAGE_VERSION_FILE "${CMAKE_CURRENT_BINARY_DIR}/${ASTRO_CMAKECONFIGNAME}ConfigVersion.cmake"
COMPATIBILITY SameMajorVersion
SOVERSION 1
)
ADD_DEFINITIONS(-O3)
......@@ -39,7 +46,7 @@ endif(WIN32)
if (NOT (CMAKE_SYSTEM_NAME STREQUAL Android))
set_target_properties(astro PROPERTIES
EXPORT_NAME "Astro"
VERSION ${ASTRO_LIB_VERSION}
VERSION ${ASTRO_LIB_VERSION_STRING}
SOVERSION ${ASTRO_LIB_SOVERSION}
)
endif()
......@@ -77,6 +84,7 @@ endif()
planetarySats.h
solarsystem.h
${CMAKE_CURRENT_BINARY_DIR}/astrolib_export.h
${CMAKE_CURRENT_BINARY_DIR}/astro_version.h
DESTINATION ${INCLUDE_INSTALL_DIR}/astro
)
......@@ -85,7 +93,6 @@ endif()
include(CMakePackageConfigHelpers)
set(ASTRO_CMAKECONFIGNAME Astro)
set(ASTRO_INSTALL_CMAKECONFIGDIR ${CMAKE_INSTALL_LIBDIR}/cmake/${ASTRO_CMAKECONFIGNAME})
configure_package_config_file(AstroConfig.cmake.in
......@@ -93,11 +100,6 @@ configure_package_config_file(AstroConfig.cmake.in
INSTALL_DESTINATION ${ASTRO_INSTALL_CMAKECONFIGDIR}
)
write_basic_package_version_file(${CMAKE_CURRENT_BINARY_DIR}/${ASTRO_CMAKECONFIGNAME}ConfigVersion.cmake
VERSION ${ASTRO_LIB_VERSION}
COMPATIBILITY SameMajorVersion
)
install(FILES
${CMAKE_CURRENT_BINARY_DIR}/${ASTRO_CMAKECONFIGNAME}Config.cmake
${CMAKE_CURRENT_BINARY_DIR}/${ASTRO_CMAKECONFIGNAME}ConfigVersion.cmake
......
PROJECT(marblewidget)
PROJECT(marblewidget VERSION ${RELEASE_SERVICE_VERSION})
set(MARBLE_CMAKECONFIGNAME Marble)
macro_optional_find_package(Phonon4Qt5 QUIET)
marble_set_package_properties( Phonon4Qt5 PROPERTIES
......@@ -43,11 +44,14 @@ INCLUDE(graphicsview/CMakeLists.txt)
INCLUDE(layers/CMakeLists.txt)
INCLUDE(osm/CMakeLists.txt)
set(MARBLE_LIB_VERSION_MAJOR "21")
set(MARBLE_LIB_VERSION_MINOR "4")
set(MARBLE_LIB_VERSION_PATCH "0")
set(MARBLE_LIB_VERSION "${MARBLE_LIB_VERSION_MAJOR}.${MARBLE_LIB_VERSION_MINOR}.${MARBLE_LIB_VERSION_PATCH}")
set(MARBLE_ABI_VERSION "28")
include(ECMSetupVersion)
ecm_setup_version(PROJECT
VARIABLE_PREFIX MARBLE_LIB
VERSION_HEADER "${CMAKE_CURRENT_BINARY_DIR}/marble_version.h"
PACKAGE_VERSION_FILE "${CMAKE_CURRENT_BINARY_DIR}/${MARBLE_CMAKECONFIGNAME}ConfigVersion.cmake"
COMPATIBILITY SameMajorVersion
SOVERSION 28
)
########### next target ###############
......@@ -437,8 +441,8 @@ set_target_properties(marblewidget PROPERTIES
if (NOT (CMAKE_SYSTEM_NAME STREQUAL Android))
set_target_properties(marblewidget PROPERTIES
VERSION ${MARBLE_LIB_VERSION}
SOVERSION ${MARBLE_ABI_VERSION}
VERSION ${MARBLE_LIB_VERSION_STRING}
SOVERSION ${MARBLE_LIB_SOVERSION}
)
endif()
......@@ -479,6 +483,7 @@ else()
endif()
install( FILES
${CMAKE_CURRENT_BINARY_DIR}/marble_version.h
${CMAKE_CURRENT_BINARY_DIR}/marble_export.h
${CMAKE_CURRENT_BINARY_DIR}/declarative/marble_declarative_export.h
${graphicsview_HDRS}
......@@ -644,7 +649,6 @@ install( FILES
include(CMakePackageConfigHelpers)
set(MARBLE_CMAKECONFIGNAME Marble)
set(MARBLE_INSTALL_CMAKECONFIGDIR ${CMAKE_INSTALL_LIBDIR}/cmake/${MARBLE_CMAKECONFIGNAME})
configure_package_config_file(MarbleConfig.cmake.in
......@@ -652,11 +656,6 @@ configure_package_config_file(MarbleConfig.cmake.in
INSTALL_DESTINATION ${MARBLE_INSTALL_CMAKECONFIGDIR}
)
write_basic_package_version_file(${CMAKE_CURRENT_BINARY_DIR}/${MARBLE_CMAKECONFIGNAME}ConfigVersion.cmake
VERSION ${MARBLE_LIB_VERSION}
COMPATIBILITY SameMajorVersion
)
install(FILES
${CMAKE_CURRENT_BINARY_DIR}/${MARBLE_CMAKECONFIGNAME}Config.cmake
${CMAKE_CURRENT_BINARY_DIR}/${MARBLE_CMAKECONFIGNAME}ConfigVersion.cmake
......@@ -702,7 +701,7 @@ endif()
file(GENERATE
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/qt_Marble.pri
CONTENT
"QT.Marble.VERSION = ${MARBLE_LIB_VERSION}
"QT.Marble.VERSION = ${MARBLE_LIB_VERSION_STRING}
QT.Marble.MAJOR_VERSION = ${MARBLE_LIB_VERSION_MAJOR}
QT.Marble.MINOR_VERSION = ${MARBLE_LIB_VERSION_MINOR}
QT.Marble.PATCH_VERSION = ${MARBLE_LIB_VERSION_PATCH}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment