]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
cmake: fix building docs when the base directory contains `.3`
authorViktor Szakats <commit@vsz.me>
Tue, 16 Sep 2025 08:49:14 +0000 (10:49 +0200)
committerViktor Szakats <commit@vsz.me>
Tue, 16 Sep 2025 10:37:11 +0000 (12:37 +0200)
Fixing:
```
ninja: error: '<...>/basedir.md/_bld/docs/libcurl/libcurl-symbols.md',
  needed by 'docs/libcurl/curl_easy_cleanup.3', missing and no known rule to make it
```

Reported-by: Nir Azkiel
Fixes #18560
Follow-up to 898b012a9bf388590c4be7f526815b5ab74feca1 #1288
Closes #18563

docs/libcurl/CMakeLists.txt

index 2102dd8ee3b56b6f359dd79979c7ee0565060b65..bee1021f72560230cfa75295880a8f15a1434014 100644 (file)
@@ -52,11 +52,9 @@ function(curl_add_manual_pages _listname)
     endif()
 
     list(APPEND _rofffiles "${CMAKE_CURRENT_BINARY_DIR}/${_file}")
-    if(_file STREQUAL "libcurl-symbols.3")
-      # Special case, an auto-generated file.
-      string(REPLACE ".3" ".md" _mdfile "${CMAKE_CURRENT_BINARY_DIR}/${_file}")
-    else()
-      string(REPLACE ".3" ".md" _mdfile "${_file}")
+    string(REPLACE ".3" ".md" _mdfile "${_file}")
+    if(_file STREQUAL "libcurl-symbols.3")  # Special case for auto-generated file
+      set(_mdfile "${CMAKE_CURRENT_BINARY_DIR}/${_mdfile}")
     endif()
     list(APPEND _mdfiles "${_mdfile}")
   endforeach()