[libxslt] Use CMake PROJECT_VERSION



commit 242f19684953ecca80db4582753bd04c1684ca00
Author: Markus Rickert <rickert fortiss org>
Date:   Mon Feb 22 21:12:55 2021 +0100

    Use CMake PROJECT_VERSION

 CMakeLists.txt | 56 ++++++++++++++++++++++++++++----------------------------
 1 file changed, 28 insertions(+), 28 deletions(-)
---
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 4a88a44c..a352bc0e 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,6 +1,6 @@
 cmake_minimum_required(VERSION 3.15)
 
-project(libxslt1 C)
+project(libxslt1 VERSION 1.1.34 LANGUAGES C)
 
 list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR})
 
@@ -12,25 +12,6 @@ include(CheckSymbolExists)
 include(CMakePackageConfigHelpers)
 include(GNUInstallDirs)
 
-set(LIBEXSLT_MAJOR_VERSION 0)
-set(LIBEXSLT_MINOR_VERSION 8)
-set(LIBEXSLT_MICRO_VERSION 20)
-
-set(LIBEXSLT_DOTTED_VERSION ${LIBEXSLT_MAJOR_VERSION}.${LIBEXSLT_MINOR_VERSION}.${LIBEXSLT_MICRO_VERSION})
-math(EXPR LIBEXSLT_VERSION_NUMBER "${LIBEXSLT_MAJOR_VERSION} * 10000 + ${LIBEXSLT_MINOR_VERSION} * 100 + 
${LIBEXSLT_MICRO_VERSION}")
-set(LIBEXSLT_VERSION_EXTRA "")
-
-set(LIBXSLT_MAJOR_VERSION 1)
-set(LIBXSLT_MINOR_VERSION 1)
-set(LIBXSLT_MICRO_VERSION 34)
-
-set(LIBXSLT_DOTTED_VERSION "${LIBXSLT_MAJOR_VERSION}.${LIBXSLT_MINOR_VERSION}.${LIBXSLT_MICRO_VERSION}")
-math(EXPR LIBXSLT_VERSION_NUMBER "${LIBXSLT_MAJOR_VERSION} * 10000 + ${LIBXSLT_MINOR_VERSION} * 100 + 
${LIBXSLT_MICRO_VERSION}")
-set(LIBXSLT_VERSION_EXTRA "")
-
-set(VERSION ${LIBXSLT_DOTTED_VERSION})
-set(LIBEXSLT_VERSION ${LIBEXSLT_DOTTED_VERSION})
-
 find_package(LibXml2 CONFIG REQUIRED)
 
 option(BUILD_SHARED_LIBS "Build shared libraries" ON)
@@ -75,6 +56,25 @@ foreach(VARIABLE IN ITEMS WITH_CRYPTO WITH_DEBUGGER WITH_MEM_DEBUG WITH_MODULES
        endif()
 endforeach()
 
+set(LIBEXSLT_MAJOR_VERSION 0)
+set(LIBEXSLT_MINOR_VERSION 8)
+set(LIBEXSLT_MICRO_VERSION 20)
+
+set(LIBEXSLT_DOTTED_VERSION ${LIBEXSLT_MAJOR_VERSION}.${LIBEXSLT_MINOR_VERSION}.${LIBEXSLT_MICRO_VERSION})
+math(EXPR LIBEXSLT_VERSION_NUMBER "${LIBEXSLT_MAJOR_VERSION} * 10000 + ${LIBEXSLT_MINOR_VERSION} * 100 + 
${LIBEXSLT_MICRO_VERSION}")
+set(LIBEXSLT_VERSION_EXTRA "")
+
+set(LIBXSLT_MAJOR_VERSION ${PROJECT_VERSION_MAJOR})
+set(LIBXSLT_MINOR_VERSION ${PROJECT_VERSION_MINOR})
+set(LIBXSLT_MICRO_VERSION ${PROJECT_VERSION_PATCH})
+
+set(LIBXSLT_DOTTED_VERSION "${LIBXSLT_MAJOR_VERSION}.${LIBXSLT_MINOR_VERSION}.${LIBXSLT_MICRO_VERSION}")
+math(EXPR LIBXSLT_VERSION_NUMBER "${LIBXSLT_MAJOR_VERSION} * 10000 + ${LIBXSLT_MINOR_VERSION} * 100 + 
${LIBXSLT_MICRO_VERSION}")
+set(LIBXSLT_VERSION_EXTRA "")
+
+set(VERSION ${LIBXSLT_DOTTED_VERSION})
+set(LIBEXSLT_VERSION ${LIBEXSLT_DOTTED_VERSION})
+
 set(MODULE_EXTENSION "${CMAKE_SHARED_LIBRARY_SUFFIX}")
 
 if(LIBXSLT_WITH_CRYPTO)
@@ -240,7 +240,7 @@ set_target_properties(
        OUTPUT_NAME xslt
        POSITION_INDEPENDENT_CODE ON
        PREFIX lib
-       VERSION ${VERSION}
+       VERSION ${PROJECT_VERSION}
 )
 
 if(WIN32)
@@ -410,7 +410,7 @@ if(LIBXSLT_WITH_PYTHON)
                IMPORT_PREFIX lib
                OUTPUT_NAME xsltmod
                PREFIX lib
-               VERSION ${VERSION}
+               VERSION ${PROJECT_VERSION}
        )
        install(
                TARGETS LibXsltMod
@@ -430,35 +430,35 @@ install(FILES doc/xsltproc.1 DESTINATION ${CMAKE_INSTALL_MANDIR}/man1 COMPONENT
 install(DIRECTORY doc/ DESTINATION ${CMAKE_INSTALL_DATADIR}/doc/libxslt COMPONENT documentation PATTERN 
Makefile.* EXCLUDE)
 
 if(LIBXSLT_WITH_CRYPTO)
-       install(FILES FindGcrypt.cmake DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/libxslt-${VERSION} COMPONENT 
development)
+       install(FILES FindGcrypt.cmake DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/libxslt-${PROJECT_VERSION} 
COMPONENT development)
 endif()
 
 configure_package_config_file(
        libxslt-config.cmake.cmake.in libxslt-config.cmake
-       INSTALL_DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/libxslt-${VERSION}
+       INSTALL_DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/libxslt-${PROJECT_VERSION}
 )
 
 install(
        FILES ${CMAKE_CURRENT_BINARY_DIR}/libxslt-config.cmake
-       DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/libxslt-${VERSION}
+       DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/libxslt-${PROJECT_VERSION}
        COMPONENT development
 )
 
 write_basic_package_version_file(
        ${CMAKE_CURRENT_BINARY_DIR}/libxslt-config-version.cmake
-       VERSION ${VERSION}
+       VERSION ${PROJECT_VERSION}
        COMPATIBILITY ExactVersion
 )
 
 install(
        FILES ${CMAKE_CURRENT_BINARY_DIR}/libxslt-config-version.cmake
-       DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/libxslt-${VERSION}
+       DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/libxslt-${PROJECT_VERSION}
        COMPONENT development
 )
 
 install(
        EXPORT LibXslt
-       DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/libxslt-${VERSION}
+       DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/libxslt-${PROJECT_VERSION}
        NAMESPACE LibXslt::
        FILE libxslt-export.cmake
        COMPONENT development


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]