diff --git a/CMakeLists.txt b/CMakeLists.txt index 94d6c2c..14743ad 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,6 +2,8 @@ cmake_minimum_required(VERSION "3.28") project("cpackexample" VERSION 0.1.0) +include(GNUInstallDirs) + FIND_PACKAGE(deal.II 9.5 REQUIRED HINTS ${DEAL_II_DIR} ../ ../../ $ENV{DEAL_II_DIR} ) @@ -18,5 +20,42 @@ add_executable("${PROJECT_NAME}" main.cpp) target_link_libraries("${PROJECT_NAME}" cpackexamplelib) target_link_libraries(cpackexamplelib Boost::filesystem ${YAML_CPP_LIBRARIES}) +target_include_directories(cpackexamplelib + PUBLIC + $ + $ + ) + +install(TARGETS "${PROJECT_NAME}" cpackexamplelib + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} + ) + +install(DIRECTORY fem filesystem flatset yamlParser + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/cpackexamplelib + FILES_MATCHING PATTERN "*.hpp" + ) + +install(FILES README.md + DESTINATION ${CMAKE_INSTALL_DOCDIR} + ) + +install(FILES LICENSE + DESTINATION ${CMAKE_INSTALL_DOCDIR} + RENAME copyright + ) + +install(FILES debian/changelog.Debian.gz + DESTINATION ${CMAKE_INSTALL_DOCDIR} + RENAME changelog.Debian.gz + ) + +install(FILES docs/cpackexample.1.gz + DESTINATION ${CMAKE_INSTALL_MANDIR}/man1 + ) + DEAL_II_SETUP_TARGET("${PROJECT_NAME}") DEAL_II_SETUP_TARGET(cpackexamplelib) + +include(cmake/CPackConfig.cmake) diff --git a/cmake/CPackConfig.cmake b/cmake/CPackConfig.cmake new file mode 100644 index 0000000..88035eb --- /dev/null +++ b/cmake/CPackConfig.cmake @@ -0,0 +1,22 @@ +set(CPACK_PACKAGE_NAME "${PROJECT_NAME}") +set(CPACK_PACKAGE_VENDOR "gufarui") +set(CPACK_PACKAGE_CONTACT "gufarui ") +set(CPACK_PACKAGE_MAINTAINER "gufarui ") +set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Example FEM/Boost/yaml-cpp project packaged for the SSE exercise") +set(CPACK_PACKAGE_DESCRIPTION "Exercises the deal.II FEM solver, Boost containers/filesystem, and yaml-cpp parser.") +set(CPACK_PACKAGE_HOMEPAGE_URL "https://github.com/gufarui/cpack-exercise-wt2526") +set(CPACK_PACKAGE_VERSION "${PROJECT_VERSION}") + +set(CPACK_GENERATOR "TGZ;DEB") +set(CPACK_STRIP_FILES TRUE) +set(CPACK_DEBIAN_PACKAGE_RELEASE 1) + +set(CPACK_DEBIAN_PACKAGE_SECTION "science") +set(CPACK_DEBIAN_PACKAGE_DESCRIPTION + "Example code for the Simulation Software Engineering course.") +set(CPACK_DEBIAN_PACKAGE_MAINTAINER "gufarui ") +set(CPACK_DEBIAN_PACKAGE_SHLIBDEPS ON) +set(CPACK_DEBIAN_FILE_NAME DEB-DEFAULT) +set(CPACK_DEBIAN_PACKAGE_HOMEPAGE "${CPACK_PACKAGE_HOMEPAGE_URL}") + +include(CPack) diff --git a/debian/changelog.Debian b/debian/changelog.Debian new file mode 100644 index 0000000..b3a25c9 --- /dev/null +++ b/debian/changelog.Debian @@ -0,0 +1,7 @@ +cpackexample (0.1.0) unstable; urgency=medium + + * Initial binary package for the Packaging with CPack exercise. Provides + the sample FEM/Boost/yaml-cpp playground from the Simulation Software + Engineering course material. + + -- gufarui Sun, 07 Dec 2025 15:00:00 +0100 diff --git a/debian/changelog.Debian.gz b/debian/changelog.Debian.gz new file mode 100644 index 0000000..097d307 Binary files /dev/null and b/debian/changelog.Debian.gz differ diff --git a/docs/cpackexample.1 b/docs/cpackexample.1 new file mode 100644 index 0000000..3febb56 --- /dev/null +++ b/docs/cpackexample.1 @@ -0,0 +1,32 @@ +.TH cpackexample 1 "December 2025" "cpackexample 0.1.0" +.SH NAME +cpackexample \- Demonstration binary packaged for the Simulation Software Engineering exercise +.SH SYNOPSIS +.B cpackexample +.RI [ YAMLFILE ] +.SH DESCRIPTION +The +.B cpackexample +executable is a small driver that ties together several sample modules used in +the Simulation Software Engineering course. It showcases a Poisson solver based +on deal.II, a Boost flat set playground, a Boost filesystem demo, and a +yaml-cpp configuration parser. +.PP +When a +.I YAMLFILE +argument is provided, the program attempts to parse it using yaml-cpp and print +the discovered configuration options. Without the argument it prints a short +usage hint. +.SH OPTIONS +.TP +.I YAMLFILE +Optional path to a YAML configuration file that should be parsed with +yaml-cpp. +.SH FILES +.TP +.I /usr/share/doc/cpackexample +Contains documentation such as the MIT license and Debian changelog for the +package. +.SH AUTHOR +Packaged by gufarui for the Packaging with +CPack exercise at the University of Stuttgart. diff --git a/docs/cpackexample.1.gz b/docs/cpackexample.1.gz new file mode 100644 index 0000000..fd10de1 Binary files /dev/null and b/docs/cpackexample.1.gz differ