Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 32 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -65,14 +65,25 @@ add_library(
${megamimes_SOURCE_DIR}/src/MegaMimes.c
)

target_include_directories(hyperpage PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}
target_include_directories(
hyperpage
PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
$<INSTALL_INTERFACE:include>
PRIVATE
${megamimes_SOURCE_DIR}/src)

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(<name> <directory>)
Expand Down Expand Up @@ -147,4 +158,23 @@ endif()

if(HYPERPAGE_DOCS)
add_subdirectory(docs)
endif()
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
)
9 changes: 9 additions & 0 deletions hyperpage-config.cmake
Original file line number Diff line number Diff line change
@@ -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)