cmake: whitespace, formatting/tidy-up in comments

Also correct casing in a few option descriptions.

Closes #13711
This commit is contained in:
Viktor Szakats 2024-05-19 18:49:42 +02:00
parent 9866e2e16e
commit 0e176cabe4
No known key found for this signature in database
GPG Key ID: B5ABD165E2AEF201
15 changed files with 156 additions and 158 deletions

View File

@ -64,13 +64,13 @@ string(REGEX REPLACE "[^0]+0x" "" CURL_VERSION_NUM ${CURL_VERSION_NUM})
# Setup package meta-data # Setup package meta-data
# SET(PACKAGE "curl") # set(PACKAGE "curl")
message(STATUS "curl version=[${CURL_VERSION}]") message(STATUS "curl version=[${CURL_VERSION}]")
# SET(PACKAGE_TARNAME "curl") # set(PACKAGE_TARNAME "curl")
# SET(PACKAGE_NAME "curl") # set(PACKAGE_NAME "curl")
# SET(PACKAGE_VERSION "-") # set(PACKAGE_VERSION "-")
# SET(PACKAGE_STRING "curl-") # set(PACKAGE_STRING "curl-")
# SET(PACKAGE_BUGREPORT "a suitable curl mailing list => https://curl.se/mail/") # set(PACKAGE_BUGREPORT "a suitable curl mailing list => https://curl.se/mail/")
set(OPERATING_SYSTEM "${CMAKE_SYSTEM_NAME}") set(OPERATING_SYSTEM "${CMAKE_SYSTEM_NAME}")
if(CMAKE_C_COMPILER_TARGET) if(CMAKE_C_COMPILER_TARGET)
set(OS "\"${CMAKE_C_COMPILER_TARGET}\"") set(OS "\"${CMAKE_C_COMPILER_TARGET}\"")
@ -912,7 +912,7 @@ if(APPLE)
endif() endif()
# libpsl # libpsl
option(CURL_USE_LIBPSL "Use libPSL" ON) option(CURL_USE_LIBPSL "Use libpsl" ON)
mark_as_advanced(CURL_USE_LIBPSL) mark_as_advanced(CURL_USE_LIBPSL)
set(USE_LIBPSL OFF) set(USE_LIBPSL OFF)
@ -926,8 +926,8 @@ if(CURL_USE_LIBPSL)
endif() endif()
endif() endif()
#libSSH2 # libssh2
option(CURL_USE_LIBSSH2 "Use libSSH2" ON) option(CURL_USE_LIBSSH2 "Use libssh2" ON)
mark_as_advanced(CURL_USE_LIBSSH2) mark_as_advanced(CURL_USE_LIBSSH2)
set(USE_LIBSSH2 OFF) set(USE_LIBSSH2 OFF)
@ -942,7 +942,7 @@ if(CURL_USE_LIBSSH2)
endif() endif()
# libssh # libssh
option(CURL_USE_LIBSSH "Use libSSH" OFF) option(CURL_USE_LIBSSH "Use libssh" OFF)
mark_as_advanced(CURL_USE_LIBSSH) mark_as_advanced(CURL_USE_LIBSSH)
if(NOT USE_LIBSSH2 AND CURL_USE_LIBSSH) if(NOT USE_LIBSSH2 AND CURL_USE_LIBSSH)
find_package(libssh CONFIG) find_package(libssh CONFIG)
@ -1008,7 +1008,6 @@ if(CURL_USE_GSSAPI)
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${GSS_LINKER_FLAGS}") set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${GSS_LINKER_FLAGS}")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${GSS_LINKER_FLAGS}") set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${GSS_LINKER_FLAGS}")
list(APPEND CURL_LIBS ${GSS_LIBRARIES}) list(APPEND CURL_LIBS ${GSS_LIBRARIES})
else() else()
message(WARNING "GSSAPI support has been requested but no supporting libraries found. Skipping.") message(WARNING "GSSAPI support has been requested but no supporting libraries found. Skipping.")
endif() endif()
@ -1537,7 +1536,8 @@ if(CURL_LTO)
endif() endif()
# Ugly (but functional) way to include "Makefile.inc" by transforming it (= regenerate it). # Ugly (but functional) way to include "Makefile.inc" by transforming it
# (= regenerate it).
function(transform_makefile_inc INPUT_FILE OUTPUT_FILE) function(transform_makefile_inc INPUT_FILE OUTPUT_FILE)
file(READ ${INPUT_FILE} MAKEFILE_INC_TEXT) file(READ ${INPUT_FILE} MAKEFILE_INC_TEXT)
string(REPLACE "$(top_srcdir)" "\${CURL_SOURCE_DIR}" MAKEFILE_INC_TEXT ${MAKEFILE_INC_TEXT}) string(REPLACE "$(top_srcdir)" "\${CURL_SOURCE_DIR}" MAKEFILE_INC_TEXT ${MAKEFILE_INC_TEXT})
@ -1593,8 +1593,8 @@ if(NOT CURL_DISABLE_INSTALL)
GROUP_READ GROUP_EXECUTE GROUP_READ GROUP_EXECUTE
WORLD_READ WORLD_EXECUTE) WORLD_READ WORLD_EXECUTE)
# Helper to populate a list (_items) with a label when conditions (the remaining # Helper to populate a list (_items) with a label when conditions
# args) are satisfied # (the remaining args) are satisfied
macro(_add_if label) macro(_add_if label)
# needs to be a macro to allow this indirection # needs to be a macro to allow this indirection
if(${ARGN}) if(${ARGN})
@ -1834,8 +1834,8 @@ if(NOT CURL_DISABLE_INSTALL)
COMPATIBILITY SameMajorVersion COMPATIBILITY SameMajorVersion
) )
file(READ "${version_config}" generated_version_config) file(READ "${version_config}" generated_version_config)
file(WRITE "${version_config}" file(WRITE "${version_config}" "
"if(NOT PACKAGE_FIND_VERSION_RANGE AND PACKAGE_FIND_VERSION_MAJOR STREQUAL \"7\") if(NOT PACKAGE_FIND_VERSION_RANGE AND PACKAGE_FIND_VERSION_MAJOR STREQUAL \"7\")
# Version 8 satisfies version 7... requirements # Version 8 satisfies version 7... requirements
set(PACKAGE_FIND_VERSION_MAJOR 8) set(PACKAGE_FIND_VERSION_MAJOR 8)
set(PACKAGE_FIND_VERSION_COUNT 1) set(PACKAGE_FIND_VERSION_COUNT 1)
@ -1852,15 +1852,13 @@ if(NOT CURL_DISABLE_INSTALL)
) )
if(CURL_ENABLE_EXPORT_TARGET) if(CURL_ENABLE_EXPORT_TARGET)
install( install(EXPORT "${TARGETS_EXPORT_NAME}"
EXPORT "${TARGETS_EXPORT_NAME}"
NAMESPACE "${PROJECT_NAME}::" NAMESPACE "${PROJECT_NAME}::"
DESTINATION ${CURL_INSTALL_CMAKE_DIR} DESTINATION ${CURL_INSTALL_CMAKE_DIR}
) )
endif() endif()
install( install(FILES ${version_config} ${project_config}
FILES ${version_config} ${project_config}
DESTINATION ${CURL_INSTALL_CMAKE_DIR} DESTINATION ${CURL_INSTALL_CMAKE_DIR}
) )

View File

@ -21,7 +21,7 @@
# SPDX-License-Identifier: curl # SPDX-License-Identifier: curl
# #
########################################################################### ###########################################################################
#add_subdirectory(examples)
if(BUILD_LIBCURL_DOCS) if(BUILD_LIBCURL_DOCS)
add_subdirectory(libcurl) add_subdirectory(libcurl)
endif() endif()

View File

@ -185,8 +185,8 @@ if(BUILD_SHARED_LIBS)
add_library(${PROJECT_NAME}::${LIB_SHARED} ALIAS ${LIB_SHARED}) add_library(${PROJECT_NAME}::${LIB_SHARED} ALIAS ${LIB_SHARED})
if(WIN32 OR CYGWIN) if(WIN32 OR CYGWIN)
if(CYGWIN) if(CYGWIN)
# For cygwin always compile dllmain.c as a separate unit since it # For Cygwin always compile dllmain.c as a separate unit since it
# includes windows.h, which shouldn't be included in other units. # includes windows.h, which should not be included in other units.
set_source_files_properties(dllmain.c PROPERTIES set_source_files_properties(dllmain.c PROPERTIES
SKIP_UNITY_BUILD_INCLUSION ON) SKIP_UNITY_BUILD_INCLUSION ON)
endif() endif()

View File

@ -104,11 +104,11 @@ source_group("curl source files" FILES ${CURL_CFILES})
source_group("curl header files" FILES ${CURL_HFILES}) source_group("curl header files" FILES ${CURL_HFILES})
include_directories( include_directories(
${CURL_SOURCE_DIR}/lib # To be able to reach "curl_setup_once.h" ${CURL_SOURCE_DIR}/lib # for "curl_setup_once.h"
${CURL_BINARY_DIR}/lib # To be able to reach "curl_config.h" ${CURL_BINARY_DIR}/lib # for "curl_config.h"
${CURL_BINARY_DIR}/include # To be able to reach "curl/curl.h" ${CURL_BINARY_DIR}/include # for "curl/curl.h"
# This is needed as tool_hugehelp.c is generated in the binary dir # This is needed as tool_hugehelp.c is generated in the binary dir
${CURL_SOURCE_DIR}/src # To be able to reach "tool_hugehelp.h" ${CURL_SOURCE_DIR}/src # for "tool_hugehelp.h"
) )
# Build curl executable # Build curl executable
@ -116,11 +116,11 @@ target_link_libraries(${EXE_NAME} ${LIB_SELECTED_FOR_EXE} ${CURL_LIBS})
################################################################################ ################################################################################
#SET_TARGET_PROPERTIES(${EXE_NAME} ARCHIVE_OUTPUT_DIRECTORY "blah blah blah") #set_target_properties(${EXE_NAME} ARCHIVE_OUTPUT_DIRECTORY "blah blah blah")
#SET_TARGET_PROPERTIES(${EXE_NAME} RUNTIME_OUTPUT_DIRECTORY "blah blah blah") #set_target_properties(${EXE_NAME} RUNTIME_OUTPUT_DIRECTORY "blah blah blah")
#SET_TARGET_PROPERTIES(${EXE_NAME} LIBRARY_OUTPUT_DIRECTORY "blah blah blah") #set_target_properties(${EXE_NAME} LIBRARY_OUTPUT_DIRECTORY "blah blah blah")
#INCLUDE(ModuleInstall OPTIONAL) #include(ModuleInstall OPTIONAL)
install(TARGETS ${EXE_NAME} EXPORT ${TARGETS_EXPORT_NAME} DESTINATION ${CMAKE_INSTALL_BINDIR}) install(TARGETS ${EXE_NAME} EXPORT ${TARGETS_EXPORT_NAME} DESTINATION ${CMAKE_INSTALL_BINDIR})
export(TARGETS ${EXE_NAME} export(TARGETS ${EXE_NAME}

View File

@ -35,10 +35,10 @@ function(setup_test TEST_NAME) # ARGN are the files in the test
string(TOUPPER ${TEST_NAME} UPPER_TEST_NAME) string(TOUPPER ${TEST_NAME} UPPER_TEST_NAME)
include_directories( include_directories(
${CURL_SOURCE_DIR}/lib # To be able to reach "curl_setup_once.h" ${CURL_SOURCE_DIR}/lib # for "curl_setup_once.h"
${CURL_BINARY_DIR}/lib # To be able to reach "curl_config.h" ${CURL_BINARY_DIR}/lib # for "curl_config.h"
${CURL_BINARY_DIR}/include # To be able to reach "curl/curl.h" ${CURL_BINARY_DIR}/include # for "curl/curl.h"
${CURL_SOURCE_DIR}/tests/libtest # To be able to build generated tests ${CURL_SOURCE_DIR}/tests/libtest # to be able to build generated tests
) )
if(USE_ARES) if(USE_ARES)
include_directories(${CARES_INCLUDE_DIR}) include_directories(${CARES_INCLUDE_DIR})

View File

@ -33,10 +33,10 @@ function(SETUP_EXECUTABLE TEST_NAME) # ARGN are the files in the test
string(TOUPPER ${TEST_NAME} UPPER_TEST_NAME) string(TOUPPER ${TEST_NAME} UPPER_TEST_NAME)
include_directories( include_directories(
${CURL_SOURCE_DIR}/lib # To be able to reach "curl_setup_once.h" ${CURL_SOURCE_DIR}/lib # for "curl_setup_once.h"
${CURL_BINARY_DIR}/lib # To be able to reach "curl_config.h" ${CURL_BINARY_DIR}/lib # for "curl_config.h"
${CURL_BINARY_DIR}/include # To be able to reach "curl/curl.h" ${CURL_BINARY_DIR}/include # for "curl/curl.h"
${CURL_SOURCE_DIR}/src # To be able to reach "tool_xattr.h" ${CURL_SOURCE_DIR}/src # for "tool_xattr.h"
) )
if(USE_ARES) if(USE_ARES)
include_directories(${CARES_INCLUDE_DIR}) include_directories(${CARES_INCLUDE_DIR})
@ -66,7 +66,7 @@ foreach(EXECUTABLE_NAME ${noinst_PROGRAMS})
endforeach() endforeach()
# SET(useful # set(useful
# getpart.c getpart.h # getpart.c getpart.h
# ${CURL_SOURCE_DIR}/lib/strequal.c # ${CURL_SOURCE_DIR}/lib/strequal.c
# ${CURL_SOURCE_DIR}/lib/base64.c # ${CURL_SOURCE_DIR}/lib/base64.c
@ -75,8 +75,8 @@ endforeach()
# ${CURL_SOURCE_DIR}/lib/timeval.c # ${CURL_SOURCE_DIR}/lib/timeval.c
# ) # )
# SETUP_EXECUTABLE(sws sws.c util.c util.h ${useful}) # setup_executable(sws sws.c util.c util.h ${useful})
# SETUP_EXECUTABLE(resolve resolve.c util.c util.h ${useful}) # setup_executable(resolve resolve.c util.c util.h ${useful})
# SETUP_EXECUTABLE(sockfilt sockfilt.c util.c util.h ${useful} ${CURL_SOURCE_DIR}/lib/inet_pton.c) # setup_executable(sockfilt sockfilt.c util.c util.h ${useful} ${CURL_SOURCE_DIR}/lib/inet_pton.c)
# SETUP_EXECUTABLE(getpart testpart.c ${useful}) # setup_executable(getpart testpart.c ${useful})
# SETUP_EXECUTABLE(tftpd tftpd.c util.c util.h ${useful} tftp.h) # setup_executable(tftpd tftpd.c util.c util.h ${useful} tftp.h)

View File

@ -26,11 +26,11 @@ transform_makefile_inc("Makefile.inc" "${CMAKE_CURRENT_BINARY_DIR}/Makefile.inc.
include(${CMAKE_CURRENT_BINARY_DIR}/Makefile.inc.cmake) include(${CMAKE_CURRENT_BINARY_DIR}/Makefile.inc.cmake)
include_directories( include_directories(
${CURL_SOURCE_DIR}/lib # To be able to reach "curl_setup_once.h" ${CURL_SOURCE_DIR}/lib # for "curl_setup_once.h"
${CURL_SOURCE_DIR}/tests/libtest ${CURL_SOURCE_DIR}/tests/libtest
${CURL_SOURCE_DIR}/src ${CURL_SOURCE_DIR}/src
${CURL_BINARY_DIR}/lib # To be able to reach "curl_config.h" ${CURL_BINARY_DIR}/lib # for "curl_config.h"
${CURL_BINARY_DIR}/include # To be able to reach "curl/curl.h" ${CURL_BINARY_DIR}/include # for "curl/curl.h"
) )
if(ENABLE_CURLDEBUG) # running unittests require curl to compiled with CURLDEBUG if(ENABLE_CURLDEBUG) # running unittests require curl to compiled with CURLDEBUG