From a3d859911c0fd1b8ab451254dc52c4d19c55d146 Mon Sep 17 00:00:00 2001 From: "John R. Patek" Date: Fri, 3 Oct 2025 17:25:41 -0500 Subject: [PATCH 1/3] added install targets and export definitions --- CMakeLists.txt | 21 ++++++++++++++++++++- hyperpage-config.cmake | 9 +++++++++ 2 files changed, 29 insertions(+), 1 deletion(-) create mode 100644 hyperpage-config.cmake diff --git a/CMakeLists.txt b/CMakeLists.txt index c25ad4a..a28e497 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -147,4 +147,23 @@ endif() if(HYPERPAGE_DOCS) add_subdirectory(docs) -endif() \ No newline at end of file +endif() + +install (TARGETS hyperpage hyperpack + EXPORT hyperpage-targets + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} +) + +install(EXPORT hyperpage-targets + FILE hyperpage-targets.cmake + NAMESPACE hyperpage:: + DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/hyperpage +) + +install(FILES + ${CMAKE_CURRENT_SOURCE_DIR}/hyperpage-config.cmake + DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/hyperpage +) \ No newline at end of file diff --git a/hyperpage-config.cmake b/hyperpage-config.cmake new file mode 100644 index 0000000..949e4bd --- /dev/null +++ b/hyperpage-config.cmake @@ -0,0 +1,9 @@ +get_filename_component(HYPERPAGE_CMAKE_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH) + +list(APPEND CMAKE_MODULE_PATH ${HYPERPAGE_CMAKE_DIR}) + +if(NOT TARGET hyperpage::hyperpage) + include("${HYPERPAGE_CMAKE_DIR}/hyperpage-targets.cmake") +endif() + +set(hyperpage_LIBRARIES hyperpage::hyperpage) From ce354c60db21020bcce7dcd4583a669e01ad3a57 Mon Sep 17 00:00:00 2001 From: "John R. Patek" Date: Fri, 3 Oct 2025 17:31:35 -0500 Subject: [PATCH 2/3] attempting to modify the include paths to support export --- CMakeLists.txt | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index a28e497..7a06ce0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -65,8 +65,14 @@ add_library( ${megamimes_SOURCE_DIR}/src/MegaMimes.c ) -target_include_directories(hyperpage PUBLIC ${CMAKE_CURRENT_SOURCE_DIR} +target_include_directories( + hyperpage + PUBLIC + $ + $ + PRIVATE ${megamimes_SOURCE_DIR}/src) + target_link_libraries(hyperpage PUBLIC SQLite::SQLite3) add_executable(hyperpack ${CMAKE_CURRENT_SOURCE_DIR}/hyperpack.cpp) From 818ed54b51ce96116166901fca3f039fedc89fb4 Mon Sep 17 00:00:00 2001 From: "John R. Patek" Date: Fri, 3 Oct 2025 17:39:26 -0500 Subject: [PATCH 3/3] trying to add public header to export --- CMakeLists.txt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 7a06ce0..2b914dd 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -75,10 +75,15 @@ target_include_directories( target_link_libraries(hyperpage PUBLIC SQLite::SQLite3) +set_target_properties(hyperpage PROPERTIES + PUBLIC_HEADER "${CMAKE_CURRENT_SOURCE_DIR}/hyperpage.hpp" +) + add_executable(hyperpack ${CMAKE_CURRENT_SOURCE_DIR}/hyperpack.cpp) target_include_directories(hyperpack PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}) target_link_libraries(hyperpack PRIVATE argparse hyperpage mio::mio) + # CMake function for creating hyperpack archives # # Usage: hyperpage_add_archive( )