From 9ee88667c4a380fdaf964d45dc6695500782fdfa Mon Sep 17 00:00:00 2001 From: Tim Griesbach Date: Wed, 4 Dec 2024 18:05:09 +0100 Subject: [PATCH 1/3] Use the same cpack generators as in p4est --- cmake/install.cmake | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/cmake/install.cmake b/cmake/install.cmake index edd80125..d18e304e 100644 --- a/cmake/install.cmake +++ b/cmake/install.cmake @@ -29,8 +29,13 @@ NAMESPACE ${PROJECT_NAME}:: ) # --- CPack -set(CPACK_GENERATOR "TBZ2") -set(CPACK_SOURCE_GENERATOR "TBZ2") +if(WIN32) + set(CPACK_GENERATOR "ZIP") + set(CPACK_SOURCE_GENERATOR "ZIP") +else() + set(CPACK_GENERATOR "TGZ") + set(CPACK_SOURCE_GENERATOR "TGZ") +endif() set(CPACK_PACKAGE_VENDOR "Carsten Burstedde") set(CPACK_PACKAGE_CONTACT "Carsten Burstedde") set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/COPYING") From 4298d8194ef92a4f5c01a069bab01410148381b0 Mon Sep 17 00:00:00 2001 From: Tim Griesbach Date: Wed, 4 Dec 2024 18:07:15 +0100 Subject: [PATCH 2/3] Generate .tarball-version --- cmake/install.cmake | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/cmake/install.cmake b/cmake/install.cmake index d18e304e..03c9f041 100644 --- a/cmake/install.cmake +++ b/cmake/install.cmake @@ -42,8 +42,22 @@ set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/COPYING") set(CPACK_RESOURCE_FILE_README "${CMAKE_CURRENT_SOURCE_DIR}/README") set(CPACK_PACKAGE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/package) string(TOLOWER ${CMAKE_SYSTEM_NAME} _sys) -set(CPACK_PACKAGE_FILE_NAME "libsc-${git_version}-${_sys}") -set(CPACK_SOURCE_PACKAGE_FILE_NAME "libsc-${git_version}") +string(TOLOWER ${PROJECT_NAME} _project_lower) + +# Define a variable for the version file +set(VERSION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/.tarball-version") + +# Generate .tarball-version file +add_custom_command( + OUTPUT ${VERSION_FILE} + COMMAND ${CMAKE_COMMAND} -E echo "${PROJECT_VERSION}" > ${VERSION_FILE} + DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt + ) + +add_custom_target(${PROJECT_NAME}_VersionFile ALL DEPENDS ${VERSION_FILE}) + +set(CPACK_PACKAGE_FILE_NAME "${_project_lower}-${PROJECT_VERSION}-${_sys}") +set(CPACK_SOURCE_PACKAGE_FILE_NAME "${_project_lower}-${PROJECT_VERSION}") # not .gitignore as its regex syntax is more advanced than CMake set(CPACK_SOURCE_IGNORE_FILES .git/ .github/ .vscode/ _CPack_Packages/ From 5fcd3710c10bdf6f9662f9b8894433662b184f6c Mon Sep 17 00:00:00 2001 From: Tim Griesbach Date: Thu, 5 Dec 2024 09:33:13 +0100 Subject: [PATCH 3/3] Update release notes --- doc/release_notes.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/release_notes.txt b/doc/release_notes.txt index c7a4f9fe..0edde6c5 100644 --- a/doc/release_notes.txt +++ b/doc/release_notes.txt @@ -27,6 +27,7 @@ - Make sure to use SC_ENABLE_* CMake variables - Adapt CMake CI to matrix of latest compilers - Check for MPI_Aint_diff in CMake and Autoconf + - Fix tarball naming and add a CMake target to generate .tarball-version file ## 2.8.6