diff --git a/cmake/cpack.cmake b/cmake/cpack.cmake index 568b439f..13c462ca 100644 --- a/cmake/cpack.cmake +++ b/cmake/cpack.cmake @@ -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) diff --git a/cmake/cpack_install.cmake.in b/cmake/cpack_install.cmake.in new file mode 100644 index 00000000..c68d0b5d --- /dev/null +++ b/cmake/cpack_install.cmake.in @@ -0,0 +1,3 @@ +if (CPACK_SOURCE_INSTALLED_DIRECTORIES) + configure_file ("@CPM_DOWNLOAD_LOCATION@" "${CMAKE_CURRENT_BINARY_DIR}/cmake/CPM.cmake" COPYONLY) +endif () diff --git a/cmake/install.cmake b/cmake/install.cmake index 233b5cb5..b08d2def 100644 --- a/cmake/install.cmake +++ b/cmake/install.cmake @@ -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)