Skip to content

Commit

Permalink
Merge pull request #54 from mshockwave/patch/cmake-install
Browse files Browse the repository at this point in the history
Install files in a more CMake way
  • Loading branch information
justanhduc authored Jan 19, 2024
2 parents e604647 + 758b4d8 commit 1522ab0
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,17 @@ else(TASK_SPOOLER_COMPILE_CUDA)
add_definitions(-DCPU)
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
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)

0 comments on commit 1522ab0

Please sign in to comment.