From 069b1571433fc07d5ce1ed250c6dff189249781d Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Wed, 28 Aug 2024 20:34:31 +0200 Subject: [PATCH] Unify Slint project version in CMake build --- .github/workflows/upgrade_version.yaml | 1 - api/cpp/CMakeLists.txt | 6 ++---- api/cpp/cmake/SlintConfig.cmake.in | 2 +- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/.github/workflows/upgrade_version.yaml b/.github/workflows/upgrade_version.yaml index 1717fd474..e996ca0ea 100644 --- a/.github/workflows/upgrade_version.yaml +++ b/.github/workflows/upgrade_version.yaml @@ -24,7 +24,6 @@ jobs: # Update the version in CmakeLists.txt sed -i 's/ VERSION [0-9]*\.[0-9]*\.[0-9]*$/ VERSION ${{ github.event.inputs.new_version }}/' api/cpp/CMakeLists.txt - sed -i 's/SLINT_VERSION [0-9]*\.[0-9]*\.[0-9]*$/SLINT_VERSION ${{ github.event.inputs.new_version }}/' api/cpp/CMakeLists.txt sed -i "s/(CPACK_PACKAGE_VERSION_MAJOR [0-9]*)/(CPACK_PACKAGE_VERSION_MAJOR `echo ${{ github.event.inputs.new_version }} | sed "s/\([0-9]*\)\.\([0-9]*\).\([0-9]*\)/\1/"`)/" api/cpp/CMakeLists.txt sed -i "s/(CPACK_PACKAGE_VERSION_MINOR [0-9]*)/(CPACK_PACKAGE_VERSION_MINOR `echo ${{ github.event.inputs.new_version }} | sed "s/\([0-9]*\)\.\([0-9]*\).\([0-9]*\)/\2/"`)/" api/cpp/CMakeLists.txt sed -i "s/(CPACK_PACKAGE_VERSION_PATCH [0-9]*)/(CPACK_PACKAGE_VERSION_PATCH `echo ${{ github.event.inputs.new_version }} | sed "s/\([0-9]*\)\.\([0-9]*\).\([0-9]*\)/\3/"`)/" api/cpp/CMakeLists.txt diff --git a/api/cpp/CMakeLists.txt b/api/cpp/CMakeLists.txt index 0ef8f32e6..8b6ea1c27 100644 --- a/api/cpp/CMakeLists.txt +++ b/api/cpp/CMakeLists.txt @@ -4,7 +4,7 @@ cmake_minimum_required(VERSION 3.21) # Select C++ and C as languages, as Corrosion needs ${CMAKE_C_COMPILER} # for linking -project(Slint HOMEPAGE_URL "https://slint.dev/" LANGUAGES C CXX VERSION 1.0.0) +project(Slint HOMEPAGE_URL "https://slint.dev/" LANGUAGES C CXX VERSION 1.8.0) include(FeatureSummary) include(CMakeDependentOption) @@ -436,8 +436,6 @@ if(SLINT_BUILD_RUNTIME) cmake_path(GET _slint_compiler_location FILENAME SLINT_COMPILER_FILE_NAME) endif() - set(SLINT_VERSION 1.8.0) - configure_package_config_file("cmake/SlintConfig.cmake.in" "${CMAKE_CURRENT_BINARY_DIR}/lib/cmake/Slint/SlintConfig.cmake" INSTALL_DESTINATION lib/cmake/Slint) endfunction() @@ -445,7 +443,7 @@ if(SLINT_BUILD_RUNTIME) write_basic_package_version_file( ${CMAKE_CURRENT_BINARY_DIR}/lib/cmake/Slint/SlintConfigVersion.cmake - VERSION 1.8.0 + VERSION ${PROJECT_VERSION} COMPATIBILITY SameMinorVersion ) diff --git a/api/cpp/cmake/SlintConfig.cmake.in b/api/cpp/cmake/SlintConfig.cmake.in index 73f1764be..7fd982a61 100644 --- a/api/cpp/cmake/SlintConfig.cmake.in +++ b/api/cpp/cmake/SlintConfig.cmake.in @@ -15,7 +15,7 @@ add_library(@slint_cpp_impl@ @cmake_lib_type@ IMPORTED) set_target_properties(@slint_cpp_impl@ PROPERTIES @SLINT_LIB_PROPERTIES@) function(_slint_download_compiler_and_cache) - set(SLINT_GITHUB_RELEASE @SLINT_VERSION@ CACHE STRING "GitHub Release to use for Slint Binary Artifact Downloads") + set(SLINT_GITHUB_RELEASE @PROJECT_VERSION@ CACHE STRING "GitHub Release to use for Slint Binary Artifact Downloads") if (CMAKE_HOST_WIN32) set(compiler_exe_suffix ".exe")