From 204c49d6f5b8cbd43b91b763d9f5a8a385de5281 Mon Sep 17 00:00:00 2001 From: Enrico Seiler Date: Tue, 15 Oct 2024 14:47:59 +0200 Subject: [PATCH] [INFRA] Update cpack target --- build_system/cpack_install.cmake.in | 18 ++++++++++++++++++ build_system/seqan3-package.cmake | 21 ++++++++++++++++++++- 2 files changed, 38 insertions(+), 1 deletion(-) create mode 100644 build_system/cpack_install.cmake.in diff --git a/build_system/cpack_install.cmake.in b/build_system/cpack_install.cmake.in new file mode 100644 index 0000000000..f35e80488e --- /dev/null +++ b/build_system/cpack_install.cmake.in @@ -0,0 +1,18 @@ +# SPDX-FileCopyrightText: 2006-2024, Knut Reinert & Freie Universität Berlin +# SPDX-FileCopyrightText: 2016-2024, Knut Reinert & MPI für molekulare Genetik +# SPDX-License-Identifier: BSD-3-Clause + +# Only if creating the source package (`make package_source`): +# Copy dependency include directories into package's staging folder +if (CPACK_SOURCE_INSTALLED_DIRECTORIES) + file (COPY "@SEQAN3_SDSL_INCLUDE_DIR@/" DESTINATION "${CMAKE_CURRENT_BINARY_DIR}/include/seqan3/vendor") + file (COPY "@SEQAN3_CEREAL_INCLUDE_DIR@/" DESTINATION "${CMAKE_CURRENT_BINARY_DIR}/include/seqan3/vendor") + configure_file ("@CPM_DOWNLOAD_LOCATION@" "${CMAKE_CURRENT_BINARY_DIR}/build_system/CPM.cmake" COPYONLY) + if ("@use_ccache_ADDED@" STREQUAL "YES") + configure_file ("@use_ccache_SOURCE_DIR@/ccache/CMakeLists.txt" + "${CMAKE_CURRENT_BINARY_DIR}/test/cmake/seqan3_require_ccache.cmake" COPYONLY) + endif () + if ("@doxygen_awesome_ADDED@" STREQUAL "YES") + file (COPY "@doxygen_awesome_SOURCE_DIR@/" DESTINATION "${CMAKE_CURRENT_BINARY_DIR}/test/documentation/doxygen_awesome") + endif () +endif () diff --git a/build_system/seqan3-package.cmake b/build_system/seqan3-package.cmake index ed4b97dfd0..80ca1b5769 100644 --- a/build_system/seqan3-package.cmake +++ b/build_system/seqan3-package.cmake @@ -17,8 +17,27 @@ set (CPACK_PACKAGE_ICON "${SEQAN3_CLONE_DIR}/test/documentation/seqan_logo.svg") set (CPACK_RESOURCE_FILE_LICENSE "${SEQAN3_CLONE_DIR}/LICENSE.md") set (CPACK_RESOURCE_FILE_README "${SEQAN3_CLONE_DIR}/README.md") +# Already being called on source package, i.e. CPM is already downloaded. +if (NOT CPM_DOWNLOAD_LOCATION) + set (CPM_DOWNLOAD_LOCATION "${SEQAN3_CLONE_DIR}/build_system/CPM.cmake") +else () + CPMGetPackage (use_ccache) + CPMGetPackage (doxygen_awesome) +endif () + +configure_file ("${SEQAN3_CLONE_DIR}/build_system/cpack_install.cmake.in" + "${CMAKE_CURRENT_BINARY_DIR}/cpack_install.cmake" @ONLY) +set (CPACK_INSTALL_SCRIPT "${CMAKE_CURRENT_BINARY_DIR}/cpack_install.cmake") + # Source Package set (CPACK_SOURCE_GENERATOR "TXZ") -set (CPACK_SOURCE_IGNORE_FILES "\\\\.git($|/)") +# Next 2 lines would overwrite copy in cpack_install.cmake +list (APPEND CPACK_SOURCE_IGNORE_FILES "/build_system/CPM.cmake") +list (APPEND CPACK_SOURCE_IGNORE_FILES "/test/cmake/seqan3_require_ccache.cmake") +list (APPEND CPACK_SOURCE_IGNORE_FILES "/\.git($|/)") +list (APPEND CPACK_SOURCE_IGNORE_FILES "/\.github/") +list (APPEND CPACK_SOURCE_IGNORE_FILES "/\.vscode/") +list (APPEND CPACK_SOURCE_IGNORE_FILES "/build/") +list (APPEND CPACK_SOURCE_IGNORE_FILES "/submodules/") include (CPack)