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
# SET(PACKAGE "curl")
# set(PACKAGE "curl")
message(STATUS "curl version=[${CURL_VERSION}]")
# SET(PACKAGE_TARNAME "curl")
# SET(PACKAGE_NAME "curl")
# SET(PACKAGE_VERSION "-")
# SET(PACKAGE_STRING "curl-")
# SET(PACKAGE_BUGREPORT "a suitable curl mailing list => https://curl.se/mail/")
# set(PACKAGE_TARNAME "curl")
# set(PACKAGE_NAME "curl")
# set(PACKAGE_VERSION "-")
# set(PACKAGE_STRING "curl-")
# set(PACKAGE_BUGREPORT "a suitable curl mailing list => https://curl.se/mail/")
set(OPERATING_SYSTEM "${CMAKE_SYSTEM_NAME}")
if(CMAKE_C_COMPILER_TARGET)
set(OS "\"${CMAKE_C_COMPILER_TARGET}\"")
@ -912,7 +912,7 @@ if(APPLE)
endif()
# libpsl
option(CURL_USE_LIBPSL "Use libPSL" ON)
option(CURL_USE_LIBPSL "Use libpsl" ON)
mark_as_advanced(CURL_USE_LIBPSL)
set(USE_LIBPSL OFF)
@ -926,8 +926,8 @@ if(CURL_USE_LIBPSL)
endif()
endif()
#libSSH2
option(CURL_USE_LIBSSH2 "Use libSSH2" ON)
# libssh2
option(CURL_USE_LIBSSH2 "Use libssh2" ON)
mark_as_advanced(CURL_USE_LIBSSH2)
set(USE_LIBSSH2 OFF)
@ -942,7 +942,7 @@ if(CURL_USE_LIBSSH2)
endif()
# libssh
option(CURL_USE_LIBSSH "Use libSSH" OFF)
option(CURL_USE_LIBSSH "Use libssh" OFF)
mark_as_advanced(CURL_USE_LIBSSH)
if(NOT USE_LIBSSH2 AND CURL_USE_LIBSSH)
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_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${GSS_LINKER_FLAGS}")
list(APPEND CURL_LIBS ${GSS_LIBRARIES})
else()
message(WARNING "GSSAPI support has been requested but no supporting libraries found. Skipping.")
endif()
@ -1537,7 +1536,8 @@ if(CURL_LTO)
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)
file(READ ${INPUT_FILE} 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
WORLD_READ WORLD_EXECUTE)
# Helper to populate a list (_items) with a label when conditions (the remaining
# args) are satisfied
# Helper to populate a list (_items) with a label when conditions
# (the remaining args) are satisfied
macro(_add_if label)
# needs to be a macro to allow this indirection
if(${ARGN})
@ -1834,8 +1834,8 @@ if(NOT CURL_DISABLE_INSTALL)
COMPATIBILITY SameMajorVersion
)
file(READ "${version_config}" generated_version_config)
file(WRITE "${version_config}"
"if(NOT PACKAGE_FIND_VERSION_RANGE AND PACKAGE_FIND_VERSION_MAJOR STREQUAL \"7\")
file(WRITE "${version_config}" "
if(NOT PACKAGE_FIND_VERSION_RANGE AND PACKAGE_FIND_VERSION_MAJOR STREQUAL \"7\")
# Version 8 satisfies version 7... requirements
set(PACKAGE_FIND_VERSION_MAJOR 8)
set(PACKAGE_FIND_VERSION_COUNT 1)
@ -1852,15 +1852,13 @@ if(NOT CURL_DISABLE_INSTALL)
)
if(CURL_ENABLE_EXPORT_TARGET)
install(
EXPORT "${TARGETS_EXPORT_NAME}"
install(EXPORT "${TARGETS_EXPORT_NAME}"
NAMESPACE "${PROJECT_NAME}::"
DESTINATION ${CURL_INSTALL_CMAKE_DIR}
)
endif()
install(
FILES ${version_config} ${project_config}
install(FILES ${version_config} ${project_config}
DESTINATION ${CURL_INSTALL_CMAKE_DIR}
)

View File

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

View File

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

View File

@ -104,11 +104,11 @@ source_group("curl source files" FILES ${CURL_CFILES})
source_group("curl header files" FILES ${CURL_HFILES})
include_directories(
${CURL_SOURCE_DIR}/lib # To be able to reach "curl_setup_once.h"
${CURL_BINARY_DIR}/lib # To be able to reach "curl_config.h"
${CURL_BINARY_DIR}/include # To be able to reach "curl/curl.h"
${CURL_SOURCE_DIR}/lib # for "curl_setup_once.h"
${CURL_BINARY_DIR}/lib # for "curl_config.h"
${CURL_BINARY_DIR}/include # for "curl/curl.h"
# 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
@ -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} RUNTIME_OUTPUT_DIRECTORY "blah blah blah")
#SET_TARGET_PROPERTIES(${EXE_NAME} LIBRARY_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} LIBRARY_OUTPUT_DIRECTORY "blah blah blah")
#INCLUDE(ModuleInstall OPTIONAL)
#include(ModuleInstall OPTIONAL)
install(TARGETS ${EXE_NAME} EXPORT ${TARGETS_EXPORT_NAME} DESTINATION ${CMAKE_INSTALL_BINDIR})
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)
include_directories(
${CURL_SOURCE_DIR}/lib # To be able to reach "curl_setup_once.h"
${CURL_BINARY_DIR}/lib # To be able to reach "curl_config.h"
${CURL_BINARY_DIR}/include # To be able to reach "curl/curl.h"
${CURL_SOURCE_DIR}/tests/libtest # To be able to build generated tests
${CURL_SOURCE_DIR}/lib # for "curl_setup_once.h"
${CURL_BINARY_DIR}/lib # for "curl_config.h"
${CURL_BINARY_DIR}/include # for "curl/curl.h"
${CURL_SOURCE_DIR}/tests/libtest # to be able to build generated tests
)
if(USE_ARES)
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)
include_directories(
${CURL_SOURCE_DIR}/lib # To be able to reach "curl_setup_once.h"
${CURL_BINARY_DIR}/lib # To be able to reach "curl_config.h"
${CURL_BINARY_DIR}/include # To be able to reach "curl/curl.h"
${CURL_SOURCE_DIR}/src # To be able to reach "tool_xattr.h"
${CURL_SOURCE_DIR}/lib # for "curl_setup_once.h"
${CURL_BINARY_DIR}/lib # for "curl_config.h"
${CURL_BINARY_DIR}/include # for "curl/curl.h"
${CURL_SOURCE_DIR}/src # for "tool_xattr.h"
)
if(USE_ARES)
include_directories(${CARES_INCLUDE_DIR})
@ -66,7 +66,7 @@ foreach(EXECUTABLE_NAME ${noinst_PROGRAMS})
endforeach()
# SET(useful
# set(useful
# getpart.c getpart.h
# ${CURL_SOURCE_DIR}/lib/strequal.c
# ${CURL_SOURCE_DIR}/lib/base64.c
@ -75,8 +75,8 @@ endforeach()
# ${CURL_SOURCE_DIR}/lib/timeval.c
# )
# SETUP_EXECUTABLE(sws sws.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(getpart testpart.c ${useful})
# SETUP_EXECUTABLE(tftpd tftpd.c util.c util.h ${useful} tftp.h)
# setup_executable(sws sws.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(getpart testpart.c ${useful})
# 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_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}/src
${CURL_BINARY_DIR}/lib # To be able to reach "curl_config.h"
${CURL_BINARY_DIR}/include # To be able to reach "curl/curl.h"
${CURL_BINARY_DIR}/lib # for "curl_config.h"
${CURL_BINARY_DIR}/include # for "curl/curl.h"
)
if(ENABLE_CURLDEBUG) # running unittests require curl to compiled with CURLDEBUG