From d3e0e679b2b8b428598bb8ba56a17715190814db Mon Sep 17 00:00:00 2001 From: Lasse Collin Date: Thu, 22 Aug 2024 14:06:16 +0300 Subject: [PATCH] CMake: Don't install lzmadec.1 symlinks if XZ_TOOL_LZMADEC=OFF MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Thanks-to: 榆柳松 (ZhengSen Wang) Fixes: fb50c6ba1d4c9405e5b12b5988b01a3002638c5d Closes: https://github.com/tukaani-project/xz/pull/134 --- CMakeLists.txt | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 995cae6e..710dc455 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1873,11 +1873,19 @@ if(HAVE_DECODERS) target_compile_definitions(lzmadec PRIVATE "LZMADEC") endif() - if(UNIX) + if(UNIX AND XZ_TOOL_XZDEC) # NOTE: This puts the lzmadec.1 symlinks into xzdec_Documentation. # This isn't great but doing them separately with translated # man pages would require extra code. So this has to suffice for now. - my_install_man(xzdec_Documentation src/xzdec/xzdec.1 lzmadec) + # + # Also, if xzdec is disabled but lzmadec isn't, then the man page + # isn't installed at all. It could be done but it's not a typical + # situation so let's keep this simpler. + if(XZ_TOOL_LZMADEC) + my_install_man(xzdec_Documentation src/xzdec/xzdec.1 lzmadec) + else() + my_install_man(xzdec_Documentation src/xzdec/xzdec.1 "") + endif() endif() endif()