From f07a43dd0c2adfc58e150fb4f0a405ee88ab8aaa Mon Sep 17 00:00:00 2001 From: Simon Merkle Date: Mon, 8 Dec 2025 14:47:14 +0100 Subject: [PATCH] edited CMakeLists.txt and CPackConfig.cmake to complete exercise --- CMakeLists.txt | 21 +++++++++++++++++++++ cmake/CPackConfig.cmake | 20 ++++++++++++++++++++ 2 files changed, 41 insertions(+) create mode 100644 cmake/CPackConfig.cmake diff --git a/CMakeLists.txt b/CMakeLists.txt index 94d6c2c..728eff1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -20,3 +20,24 @@ target_link_libraries(cpackexamplelib Boost::filesystem ${YAML_CPP_LIBRARIES}) DEAL_II_SETUP_TARGET("${PROJECT_NAME}") DEAL_II_SETUP_TARGET(cpackexamplelib) + +# Executables to bin/ and librarries to lib/ +install(TARGETS cpackexample cpackexamplelib + RUNTIME DESTINATION bin + LIBRARY DESTINATION lib + ARCHIVE DESTINATION lib +) + +# Header files to inlcude/cpackexamplelib/ +install(FILES + fem/fem.hpp + filesystem/filesystem.hpp + flatset/flatset.hpp + yamlParser/yamlParser.hpp + DESTINATION include/cpackexamplelib +) + +# Adding other cmake modules (standard like this) +set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake") +# Include our packaging module (standard like this) +include(CPackConfig) diff --git a/cmake/CPackConfig.cmake b/cmake/CPackConfig.cmake new file mode 100644 index 0000000..2a458cc --- /dev/null +++ b/cmake/CPackConfig.cmake @@ -0,0 +1,20 @@ +set(CPACK_PACKAGE_NAME "${PROJECT_NAME}") +set(CPACK_PACKAGE_VENDOR "Simonandy28") +set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "SSE CPack Exercise" + CACHE STRING "Exercise about the usage of CPack and CMake") +set(CPACK_PACKAGE_HOMEPAGE_URL "https://github.com/Simonandy28/cpack-exercise-wt2526") +set(CPACK_PACKAGE_CONTACT "Simon Merkle ") + +# TAR.GZ and eb package +set(CPACK_GENERATOR "TGZ;DEB") +set(CPACK_DEBIAN_FILE_NAME DEB-DEFAULT) +set(CPACK_DEBIAN_PACKAGE_SHLIBDEPS ON) +set(CPACK_PACKAGING_INSTALL_PREFIX "/usr") + +set(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_SOURCE_DIR}/README.md") +set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_SOURCE_DIR}/LICENSE") + +# Strip compiled code +set(CPACK_STRIP_FILES TRUE) + +include(CPack) \ No newline at end of file