diff options
author | Daniil Cherednik <dan.cherednik@gmail.com> | 2023-10-17 00:51:54 +0200 |
---|---|---|
committer | Daniil Cherednik <dan.cherednik@gmail.com> | 2023-10-17 00:52:49 +0200 |
commit | fe85f8d1ad38c19246b048075b307819933260b5 (patch) | |
tree | 815054dc940ec0298054d070ead82421d54c9ae4 | |
parent | 9f802055a6d09c2370707a1e323f7ed1042b114f (diff) | |
download | atracdenc-fe85f8d1ad38c19246b048075b307819933260b5.tar.gz |
Add man page install command
-rw-r--r-- | CMakeLists.txt | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index cd052c9..8f831b7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -6,5 +6,19 @@ if (UNIX) add_subdirectory(3rd/gtest-1.7.0) add_subdirectory(test) enable_testing() + + if (NOT DEFINED CMAKE_INSTALL_MANDIR) + set(CMAKE_INSTALL_MANDIR ${CMAKE_INSTALL_PREFIX}/share/man) + endif() + add_custom_target(man-atracdenc + ALL + DEPENDS atracdenc.1.gz + ) + add_custom_command( + OUTPUT atracdenc.1.gz + COMMAND mkdir -p man && gzip --no-name --to-stdout ${CMAKE_CURRENT_SOURCE_DIR}/man/atracdenc.1 >"${CMAKE_CURRENT_BINARY_DIR}/man/atracdenc.1.gz" + MAIN_DEPENDENCY man/atracdenc.1 + ) + install(FILES ${CMAKE_CURRENT_BINARY_DIR}/man/atracdenc.1.gz DESTINATION ${CMAKE_INSTALL_MANDIR}/man1) endif() add_subdirectory(src) |