Skip to content

Commit

Permalink
cmake: generate misc manpages and install mk-ca-bundle.pl
Browse files Browse the repository at this point in the history
- install `mk-ca-bundle.pl` like autotools does.

- generate and install `mk-ca-bundle.1` and `curl-config.1` like
  autotools. This fixes tests 1140 and 1173.

  Reported-by: Dan Fandrich
  Fixes curl#13194

- add option `BUILD_MISC_DOCS` to control building the above two
  manpages. Enabled by default.

- appveyor: stop disabling tests 1140 and 1173.

Reviewed-by: Daniel Stenberg
Closes curl#13197
  • Loading branch information
vszakats committed Apr 4, 2024
1 parent a15342d commit 5023ffa
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 8 deletions.
8 changes: 8 additions & 0 deletions CMakeLists.txt
Expand Up @@ -307,6 +307,7 @@ endif()
find_package(Perl)

option(BUILD_LIBCURL_DOCS "to build libcurl man pages" ON)
option(BUILD_MISC_DOCS "to build misc man pages (e.g. curl-config and mk-ca-bundle)" ON)
option(ENABLE_CURL_MANUAL "to build the man page for curl and enable its -M/--manual option" ON)

if(ENABLE_CURL_MANUAL OR BUILD_LIBCURL_DOCS)
Expand Down Expand Up @@ -1514,6 +1515,13 @@ endif()

if(NOT CURL_DISABLE_INSTALL)

install(FILES "${PROJECT_SOURCE_DIR}/scripts/mk-ca-bundle.pl"
DESTINATION ${CMAKE_INSTALL_BINDIR}
PERMISSIONS
OWNER_READ OWNER_WRITE OWNER_EXECUTE
GROUP_READ GROUP_EXECUTE
WORLD_READ WORLD_EXECUTE)

# Helper to populate a list (_items) with a label when conditions (the remaining
# args) are satisfied
macro(_add_if label)
Expand Down
16 changes: 8 additions & 8 deletions appveyor.yml
Expand Up @@ -84,7 +84,7 @@ environment:
ENABLE_UNICODE: 'OFF'
HTTP_ONLY: 'OFF'
TESTING: 'ON'
DISABLED_TESTS: '!1139 !1501 !1140 !1173 !1177 !1477'
DISABLED_TESTS: '!1139 !1501 !1177 !1477'
- job_name: 'CMake, VS2022, Debug, x64, Schannel, Static, Unicode'
APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2022'
BUILD_SYSTEM: CMake
Expand All @@ -95,7 +95,7 @@ environment:
ENABLE_UNICODE: 'ON'
HTTP_ONLY: 'OFF'
TESTING: 'ON'
DISABLED_TESTS: '!1139 !1501 !1140 !1173 !1177 !1477'
DISABLED_TESTS: '!1139 !1501 !1177 !1477'
- job_name: 'CMake, VS2022, Debug, x64, no SSL, Static'
APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2022'
BUILD_SYSTEM: CMake
Expand All @@ -106,7 +106,7 @@ environment:
ENABLE_UNICODE: 'OFF'
HTTP_ONLY: 'OFF'
TESTING: 'ON'
DISABLED_TESTS: '!1139 !1501 !1140 !1173 !1177 !1477'
DISABLED_TESTS: '!1139 !1501 !1177 !1477'
- job_name: 'CMake, VS2022, Debug, x64, no SSL, Static, HTTP only'
APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2022'
BUILD_SYSTEM: CMake
Expand All @@ -117,7 +117,7 @@ environment:
ENABLE_UNICODE: 'OFF'
HTTP_ONLY: 'ON'
TESTING: 'ON'
DISABLED_TESTS: '!1139 !1501 !1140 !1173 !1177 !1477'
DISABLED_TESTS: '!1139 !1501 !1177 !1477'
# generated CMake-based MSYS Makefiles builds (mingw cross-compiling)
- job_name: 'CMake, mingw-w64, gcc 13, Debug, x64, Schannel, Static, Unicode, Unity'
APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2022'
Expand All @@ -128,7 +128,7 @@ environment:
ENABLE_UNICODE: 'ON'
HTTP_ONLY: 'OFF'
TESTING: 'ON'
DISABLED_TESTS: '!1086 !1139 !1451 !1501 !1140 !1173 !1177 !1477'
DISABLED_TESTS: '!1086 !1139 !1451 !1501 !1177 !1477'
ADD_PATH: 'C:/msys64/mingw64/bin'
MSYS2_ARG_CONV_EXCL: '/*'
BUILD_OPT: -k
Expand All @@ -142,7 +142,7 @@ environment:
ENABLE_UNICODE: 'ON'
HTTP_ONLY: 'OFF'
TESTING: 'ON'
DISABLED_TESTS: '!1086 !1139 !1451 !1501 !1140 !1173 !1177 !1477'
DISABLED_TESTS: '!1086 !1139 !1451 !1501 !1177 !1477'
ADD_PATH: 'C:/mingw-w64/x86_64-7.2.0-posix-seh-rt_v5-rev1/mingw64/bin'
MSYS2_ARG_CONV_EXCL: '/*'
BUILD_OPT: -k
Expand All @@ -156,7 +156,7 @@ environment:
HTTP_ONLY: 'OFF'
TESTING: 'ON'
# test 286 disabled due to https://github.com/curl/curl/issues/12040
DISABLED_TESTS: '~286 !1086 !1139 !1451 !1501 !1140 !1173 !1177 !1477'
DISABLED_TESTS: '~286 !1086 !1139 !1451 !1501 !1177 !1477'
ADD_PATH: 'C:/msys64/mingw64/bin'
MSYS2_ARG_CONV_EXCL: '/*'
BUILD_OPT: -k
Expand All @@ -170,7 +170,7 @@ environment:
ENABLE_UNICODE: 'OFF'
HTTP_ONLY: 'OFF'
TESTING: 'ON'
DISABLED_TESTS: '!1086 !1139 !1451 !1501 !1140 !1173 !1177 !1477'
DISABLED_TESTS: '!1086 !1139 !1451 !1501 !1177 !1477'
ADD_PATH: 'C:/mingw-w64/i686-6.3.0-posix-dwarf-rt_v5-rev1/mingw32/bin'
MSYS2_ARG_CONV_EXCL: '/*'
BUILD_OPT: -k
Expand Down
16 changes: 16 additions & 0 deletions docs/CMakeLists.txt
Expand Up @@ -28,3 +28,19 @@ endif()
if(ENABLE_CURL_MANUAL AND BUILD_CURL_EXE)
add_subdirectory(cmdline-opts)
endif()

if(BUILD_MISC_DOCS)
foreach(_man_misc IN ITEMS "curl-config" "mk-ca-bundle")
set(_man_target "${CURL_BINARY_DIR}/docs/${_man_misc}.1")
add_custom_command(OUTPUT "${_man_target}"
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
COMMAND "${PERL_EXECUTABLE}" ${PROJECT_SOURCE_DIR}/scripts/cd2nroff "${_man_misc}.md" > "${_man_target}"
DEPENDS ${_man_target}
VERBATIM
)
add_custom_target("generate-${_man_misc}.1" ALL DEPENDS "${_man_target}")
if(NOT CURL_DISABLE_INSTALL)
install(FILES "${_man_target}" DESTINATION ${CMAKE_INSTALL_MANDIR}/man1)
endif()
endforeach()
endif()

0 comments on commit 5023ffa

Please sign in to comment.