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:
Viktor Szakats 2024-08-04 20:35:13 +02:00
parent 63e9e06794
commit c2889a7b41
No known key found for this signature in database
GPG key ID: B5ABD165E2AEF201
31 changed files with 551 additions and 483 deletions

View file

@ -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()