From 3aa23ef8940f2d7cbe9675cf7e966c34fc3aff62 Mon Sep 17 00:00:00 2001 From: Roland Conybeare Date: Tue, 19 Sep 2023 14:52:11 -0400 Subject: [PATCH] indentlog: build: install fixes --- CMakeLists.txt | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index d819b716..bb0649be 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -7,8 +7,12 @@ enable_testing() # always write compile_commands.json set(CMAKE_EXPORT_COMPILE_COMMANDS ON CACHE INTERNAL "") -set(CMAKE_INSTALL_PREFIX /home/roland/local) -set(CMAKE_INSTALL_RPATH /home/roland/local/lib) +if(NOT CMAKE_INSTALL_PREFIX) + set(CMAKE_INSTALL_PREFIX /home/roland/local CACHE STRING "install directory") +endif() +if(NOT CMAKE_INSTALL_RPATH) + set(CMAKE_INSTALL_RPATH /home/roland/local/lib CACHE STRING "runpath in installed libraries/executables") +endif() include(cmake/nestlog.cmake) add_subdirectory(example) @@ -24,3 +28,9 @@ add_subdirectory(example) # PUBLIC_HEADER DESTINATION include) # COMPONENT Development install(DIRECTORY ${PROJECT_SOURCE_DIR}/include/ DESTINATION include) + +install(TARGETS hello DESTINATION bin/indentlog/example) +install(TARGETS ex1 DESTINATION bin/indentlog/example) +install(TARGETS ex2 DESTINATION bin/indentlog/example) +install(TARGETS ex3 DESTINATION bin/indentlog/example) +install(TARGETS ex4 DESTINATION bin/indentlog/example)