mirror of
https://github.com/curl/curl.git
synced 2026-08-25 00:43:34 +03:00
cmake: more syntax tidy-up
- quote string literals.
In the hope it improves syntax-highlighting and readability.
- use lowercase, underscore-prefixed local var names.
As a hint for scope, to help readability.
- prefer `pkg_search_module` (over `pkg_check_modules`).
They are the same, but `pkg_search_module` stops searching
at the first hit.
- more `IN LISTS` in `foreach()`.
- OtherTests.cmake: clear `CMAKE_EXTRA_INCLUDE_FILES` after use.
- add `PROJECT_LABEL` for http/client and unit test targets.
- sync `Find*` module comments and formatting.
- drop a few local variables.
- drop bogus `CARES_LIBRARIES` from comment.
- unquote numeric literal.
Follow-up to acbc6b703f #14197
Closes #14388
This commit is contained in:
parent
63e9e06794
commit
c2889a7b41
31 changed files with 551 additions and 483 deletions
|
|
@ -34,13 +34,13 @@ if(BUILD_MISC_DOCS)
|
|||
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}"
|
||||
COMMAND "${PERL_EXECUTABLE}" "${PROJECT_SOURCE_DIR}/scripts/cd2nroff" "${_man_misc}.md" > "${_man_target}"
|
||||
DEPENDS "${_man_misc}.md"
|
||||
VERBATIM
|
||||
)
|
||||
add_custom_target("curl-generate-${_man_misc}.1" ALL DEPENDS "${_man_target}")
|
||||
if(NOT CURL_DISABLE_INSTALL)
|
||||
install(FILES "${_man_target}" DESTINATION ${CMAKE_INSTALL_MANDIR}/man1)
|
||||
install(FILES "${_man_target}" DESTINATION "${CMAKE_INSTALL_MANDIR}/man1")
|
||||
endif()
|
||||
endforeach()
|
||||
endif()
|
||||
|
|
|
|||
|
|
@ -30,11 +30,11 @@ include("${CMAKE_CURRENT_BINARY_DIR}/Makefile.inc.cmake")
|
|||
|
||||
add_custom_command(OUTPUT "${MANPAGE}"
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
|
||||
COMMAND "${PERL_EXECUTABLE}" ${PROJECT_SOURCE_DIR}/scripts/managen mainpage ${DPAGES} > "${MANPAGE}"
|
||||
COMMAND "${PERL_EXECUTABLE}" ${PROJECT_SOURCE_DIR}/scripts/managen ascii ${DPAGES} > "${ASCIIPAGE}"
|
||||
COMMAND "${PERL_EXECUTABLE}" "${PROJECT_SOURCE_DIR}/scripts/managen" mainpage ${DPAGES} > "${MANPAGE}"
|
||||
COMMAND "${PERL_EXECUTABLE}" "${PROJECT_SOURCE_DIR}/scripts/managen" ascii ${DPAGES} > "${ASCIIPAGE}"
|
||||
VERBATIM
|
||||
)
|
||||
add_custom_target(generate-curl.1 ALL DEPENDS "${MANPAGE}")
|
||||
add_custom_target("generate-curl.1" ALL DEPENDS "${MANPAGE}")
|
||||
if(NOT CURL_DISABLE_INSTALL)
|
||||
install(FILES "${MANPAGE}" DESTINATION ${CMAKE_INSTALL_MANDIR}/man1)
|
||||
install(FILES "${MANPAGE}" DESTINATION "${CMAKE_INSTALL_MANDIR}/man1")
|
||||
endif()
|
||||
|
|
|
|||
|
|
@ -23,9 +23,8 @@
|
|||
###########################################################################
|
||||
|
||||
# Get 'check_PROGRAMS' variable
|
||||
transform_makefile_inc("Makefile.inc"
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/Makefile.inc.cmake")
|
||||
include(${CMAKE_CURRENT_BINARY_DIR}/Makefile.inc.cmake)
|
||||
transform_makefile_inc("Makefile.inc" "${CMAKE_CURRENT_BINARY_DIR}/Makefile.inc.cmake")
|
||||
include("${CMAKE_CURRENT_BINARY_DIR}/Makefile.inc.cmake")
|
||||
|
||||
foreach(_example IN LISTS check_PROGRAMS)
|
||||
set(_example_target "curl-example-${_example}")
|
||||
|
|
@ -35,5 +34,6 @@ foreach(_example IN LISTS check_PROGRAMS)
|
|||
if(LIB_SELECTED STREQUAL LIB_STATIC AND WIN32)
|
||||
set_property(TARGET ${_example_target} APPEND PROPERTY COMPILE_DEFINITIONS "CURL_STATICLIB")
|
||||
endif()
|
||||
set_target_properties(${_example_target} PROPERTIES OUTPUT_NAME "${_example}" UNITY_BUILD OFF)
|
||||
set_target_properties(${_example_target} PROPERTIES
|
||||
OUTPUT_NAME "${_example}" UNITY_BUILD OFF)
|
||||
endforeach()
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@ function(add_manual_pages _listname)
|
|||
if(NOT _file_count LESS ${_files_per_batch} OR _file STREQUAL "_EOL_")
|
||||
add_custom_command(OUTPUT ${_rofffiles}
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
|
||||
COMMAND "${PERL_EXECUTABLE}" ${PROJECT_SOURCE_DIR}/scripts/cd2nroff -k -d "${CMAKE_CURRENT_BINARY_DIR}" ${_mdfiles}
|
||||
COMMAND "${PERL_EXECUTABLE}" "${PROJECT_SOURCE_DIR}/scripts/cd2nroff" -k -d "${CMAKE_CURRENT_BINARY_DIR}" ${_mdfiles}
|
||||
DEPENDS ${_mdfiles}
|
||||
VERBATIM
|
||||
)
|
||||
|
|
@ -61,11 +61,11 @@ function(add_manual_pages _listname)
|
|||
endforeach()
|
||||
endfunction()
|
||||
|
||||
add_custom_command(OUTPUT libcurl-symbols.md
|
||||
add_custom_command(OUTPUT "libcurl-symbols.md"
|
||||
COMMAND
|
||||
"${PERL_EXECUTABLE}"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/mksymbolsmanpage.pl" <
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/symbols-in-versions" > libcurl-symbols.md
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/symbols-in-versions" > "libcurl-symbols.md"
|
||||
DEPENDS
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/symbols-in-versions"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/mksymbolsmanpage.pl"
|
||||
|
|
@ -79,7 +79,7 @@ if(NOT CURL_DISABLE_INSTALL)
|
|||
foreach(_f IN LISTS man_MANS)
|
||||
list(APPEND _src "${CMAKE_CURRENT_BINARY_DIR}/${_f}")
|
||||
endforeach()
|
||||
install(FILES ${_src} DESTINATION ${CMAKE_INSTALL_MANDIR}/man3)
|
||||
install(FILES ${_src} DESTINATION "${CMAKE_INSTALL_MANDIR}/man3")
|
||||
endif()
|
||||
|
||||
add_subdirectory(opts)
|
||||
|
|
|
|||
|
|
@ -33,5 +33,5 @@ if(NOT CURL_DISABLE_INSTALL)
|
|||
foreach(_f IN LISTS man_MANS)
|
||||
list(APPEND _src "${CMAKE_CURRENT_BINARY_DIR}/${_f}")
|
||||
endforeach()
|
||||
install(FILES ${_src} DESTINATION ${CMAKE_INSTALL_MANDIR}/man3)
|
||||
install(FILES ${_src} DESTINATION "${CMAKE_INSTALL_MANDIR}/man3")
|
||||
endif()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue