]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
cmake: fix `ENABLE_MANUAL` option
authorViktor Szakats <commit@vsz.me>
Sun, 21 Jan 2024 15:38:09 +0000 (15:38 +0000)
committerViktor Szakats <commit@vsz.me>
Mon, 22 Jan 2024 09:34:38 +0000 (09:34 +0000)
Fix the `ENABLE_MANUAL` option. Set it to default to `OFF`.

Before this patch `ENABLE_MANUAL=ON` was a no-op, even though it was the
option designed to enable building and using the built-in curl manual.
(`USE_MANUAL=ON` option worked for this instead, by accident).

Ref: https://github.com/curl/curl/pull/12730#issuecomment-1902572409
Closes #12749

CMakeLists.txt

index 3a6ae3d42a74d75dbeb3012bfdb75b8dedd0a02c..70ca457a969e2f20038c5398b69f6ce03f383841 100644 (file)
@@ -304,18 +304,15 @@ if(ENABLE_IPV6 AND NOT WIN32)
   endif()
 endif()
 
-if(USE_MANUAL)
-    #nroff is currently only used when USE_MANUAL is set, so we can prevent the warning of no *NROFF if USE_MANUAL is OFF (or not defined), by not even looking for NROFF..
-    curl_nroff_check()
-endif()
 find_package(Perl)
 
-cmake_dependent_option(ENABLE_MANUAL "to provide the built-in manual"
-    ON "NROFF_USEFUL;PERL_FOUND"
-    OFF)
+option(ENABLE_MANUAL "to provide the built-in manual" OFF)
 
-if(ENABLE_MANUAL)
-  set(USE_MANUAL ON)
+if(ENABLE_MANUAL AND PERL_FOUND)
+  curl_nroff_check()
+  if(NROFF_USEFUL)
+    set(USE_MANUAL ON)
+  endif()
 endif()
 
 if(CURL_STATIC_CRT)