build: cmake install targets

This commit is contained in:
Roland Conybeare 2023-09-18 17:51:28 -04:00
commit 6f74ce1cf4
2 changed files with 13 additions and 0 deletions

View file

@ -6,4 +6,11 @@ enable_testing()
include(cmake/nestlog.cmake)
add_subdirectory(include)
add_subdirectory(example)
# this doesn't work in include/CMakeLists.txt
install(TARGETS indentlog DESTINATION include)
set(CMAKE_INSTALL_PREFIX /home/roland/local)
set(CMAKE_INSTALL_RPATH /home/roland/local/lib)

6
include/CMakeLists.txt Normal file
View file

@ -0,0 +1,6 @@
# header-only library
add_library(indentlog INTERFACE)
target_include_directories(indentlog INTERFACE
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:include>
)