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 d192cfc
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 1 deletion.
14 changes: 13 additions & 1 deletion cmake/cpack.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,18 @@ 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 "/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)
3 changes: 3 additions & 0 deletions cmake/cpack_install.cmake.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
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 d192cfc

Please sign in to comment.