Skip to content

Commit

Permalink
[INFRA] Ship CPM with CPack
Browse files Browse the repository at this point in the history
  • Loading branch information
eseiler committed Nov 8, 2023
1 parent 7432161 commit dd38bdd
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 1 deletion.
15 changes: 14 additions & 1 deletion cmake/cpack.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,19 @@ set (CPACK_RESOURCE_FILE_README "${HIBF_SOURCE_DIR}/README.md")

# Source Package
set (CPACK_SOURCE_GENERATOR "TXZ")
set (CPACK_SOURCE_IGNORE_FILES "\\\\.git($|/)")
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/")
list (APPEND CPACK_SOURCE_IGNORE_FILES "/cmake/CPM.cmake")

# Already being called on source package
if (NOT CPM_DOWNLOAD_LOCATION)
set (CPM_DOWNLOAD_LOCATION "${HIBF_SOURCE_DIR}/cmake/CPM.cmake")
endif ()

configure_file (cmake/cpack_install.cmake.in cpack_install.cmake @ONLY)
set (CPACK_INSTALL_SCRIPT "${CMAKE_CURRENT_BINARY_DIR}/cpack_install.cmake")

include (CPack)
7 changes: 7 additions & 0 deletions cmake/cpack_install.cmake.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# SPDX-FileCopyrightText: 2006-2023, Knut Reinert & Freie Universität Berlin
# SPDX-FileCopyrightText: 2016-2023, Knut Reinert & MPI für molekulare Genetik
# SPDX-License-Identifier: BSD-3-Clause

if (CPACK_SOURCE_INSTALLED_DIRECTORIES)
configure_file ("@CPM_DOWNLOAD_LOCATION@" "${CMAKE_CURRENT_BINARY_DIR}/cmake/CPM.cmake" COPYONLY)
endif ()
1 change: 1 addition & 0 deletions cmake/install.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,4 @@ write_basic_package_version_file (
install (FILES ${version_file} DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/hibf)

install (FILES "${HIBF_SOURCE_DIR}/LICENSE.md" "${HIBF_SOURCE_DIR}/README.md" TYPE DOC)
install (DIRECTORY "${HIBF_SOURCE_DIR}/LICENSES" TYPE DOC)

0 comments on commit dd38bdd

Please sign in to comment.