From d35f376d3e66101a7a4eba15a46a45bd72089276 Mon Sep 17 00:00:00 2001 From: Min Hsu Date: Fri, 12 Jan 2024 10:57:49 -0800 Subject: [PATCH 1/2] Install files in a more CMake way Such that we can designate the install destination via `CMAKE_INSTALL_PREFIX`. --- CMakeLists.txt | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index c8474b9..91c967a 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -83,9 +83,16 @@ else(TASK_SPOOLER_COMPILE_CUDA) add_definitions(-DCPU) endif(TASK_SPOOLER_COMPILE_CUDA) +# Man pages +add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/man1/ts.1 + COMMAND ${CMAKE_CURRENT_BINARY_DIR}/makeman + DEPENDS makeman + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/man1) +add_custom_target(man ALL + DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/man1/ts.1) + # install -install(CODE "execute_process(COMMAND install -c -d /usr/local/bin)") -install(CODE "execute_process(COMMAND install -c ts /usr/local/bin)") -install(CODE "execute_process(COMMAND ./makeman)") -install(CODE "execute_process(COMMAND install -c -d /usr/local/share/man/man1)") -install(CODE "execute_process(COMMAND install -c -m 644 ts.1 /usr/local/share/man/man1)") +install(TARGETS ${target} + RUNTIME) +install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/man1 + TYPE MAN) From 758b4d8bca9e97786ffcca868373078c5091a0ab Mon Sep 17 00:00:00 2001 From: Min-Yih Hsu Date: Mon, 15 Jan 2024 15:03:19 -0800 Subject: [PATCH 2/2] Make sure `/man1` exists Create `/man1` to store the man page before running makeman. --- CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 91c967a..5d3e0a5 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -84,6 +84,7 @@ else(TASK_SPOOLER_COMPILE_CUDA) endif(TASK_SPOOLER_COMPILE_CUDA) # Man pages +file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/man1) add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/man1/ts.1 COMMAND ${CMAKE_CURRENT_BINARY_DIR}/makeman DEPENDS makeman