CMake: Don't install lzmadec.1 symlinks if XZ_TOOL_LZMADEC=OFF

Thanks-to: 榆柳松 (ZhengSen Wang) <wzhengsen@gmail.com>
Fixes: fb50c6ba1d
Closes: https://github.com/tukaani-project/xz/pull/134
This commit is contained in:
Lasse Collin 2024-08-22 14:06:16 +03:00
parent acdf21033a
commit d3e0e679b2
1 changed files with 10 additions and 2 deletions

View File

@ -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()