]> git.ipfire.org Git - thirdparty/xz.git/commitdiff
CMake: Don't install lzmadec.1 symlinks if XZ_TOOL_LZMADEC=OFF
authorLasse Collin <lasse.collin@tukaani.org>
Thu, 22 Aug 2024 11:06:16 +0000 (14:06 +0300)
committerLasse Collin <lasse.collin@tukaani.org>
Mon, 2 Sep 2024 14:33:42 +0000 (17:33 +0300)
Thanks-to: 榆柳松 (ZhengSen Wang) <wzhengsen@gmail.com>
Fixes: fb50c6ba1d4c9405e5b12b5988b01a3002638c5d
Closes: https://github.com/tukaani-project/xz/pull/134
CMakeLists.txt

index 995cae6e08101cc7b93db698a017de95b4dc5d26..710dc455ba843027b9d8135fe17e18326d909778 100644 (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()