mirror of
https://github.com/curl/curl.git
synced 2025-01-24 14:15:18 +08:00
cmake: whitespace, formatting/tidy-up in comments
Also correct casing in a few option descriptions. Closes #13711
This commit is contained in:
parent
9866e2e16e
commit
0e176cabe4
@ -27,6 +27,6 @@ find_library(BEARSSL_LIBRARY bearssl)
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(BEARSSL DEFAULT_MSG
|
||||
BEARSSL_INCLUDE_DIRS BEARSSL_LIBRARY)
|
||||
BEARSSL_INCLUDE_DIRS BEARSSL_LIBRARY)
|
||||
|
||||
mark_as_advanced(BEARSSL_INCLUDE_DIRS BEARSSL_LIBRARY)
|
||||
|
@ -29,14 +29,14 @@ find_library(BROTLICOMMON_LIBRARY NAMES brotlicommon)
|
||||
find_library(BROTLIDEC_LIBRARY NAMES brotlidec)
|
||||
|
||||
find_package_handle_standard_args(Brotli
|
||||
FOUND_VAR
|
||||
BROTLI_FOUND
|
||||
REQUIRED_VARS
|
||||
BROTLIDEC_LIBRARY
|
||||
BROTLICOMMON_LIBRARY
|
||||
BROTLI_INCLUDE_DIR
|
||||
FAIL_MESSAGE
|
||||
"Could NOT find Brotli"
|
||||
FOUND_VAR
|
||||
BROTLI_FOUND
|
||||
REQUIRED_VARS
|
||||
BROTLIDEC_LIBRARY
|
||||
BROTLICOMMON_LIBRARY
|
||||
BROTLI_INCLUDE_DIR
|
||||
FAIL_MESSAGE
|
||||
"Could NOT find Brotli"
|
||||
)
|
||||
|
||||
set(BROTLI_INCLUDE_DIRS ${BROTLI_INCLUDE_DIR})
|
||||
|
@ -39,7 +39,7 @@ find_library(CARES_LIBRARY
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(CARES
|
||||
REQUIRED_VARS CARES_LIBRARY CARES_INCLUDE_DIR)
|
||||
REQUIRED_VARS CARES_LIBRARY CARES_INCLUDE_DIR)
|
||||
|
||||
mark_as_advanced(
|
||||
CARES_LIBRARY
|
||||
|
@ -45,8 +45,8 @@ include(CheckIncludeFiles)
|
||||
include(CheckTypeSize)
|
||||
|
||||
set(_GSS_ROOT_HINTS
|
||||
"${GSS_ROOT_DIR}"
|
||||
"$ENV{GSS_ROOT_DIR}"
|
||||
"${GSS_ROOT_DIR}"
|
||||
"$ENV{GSS_ROOT_DIR}"
|
||||
)
|
||||
|
||||
# try to find library using system pkg-config if user didn't specify root dir
|
||||
@ -62,30 +62,30 @@ endif()
|
||||
|
||||
if(NOT _GSS_FOUND) #not found by pkg-config. Let's take more traditional approach.
|
||||
find_file(_GSS_CONFIGURE_SCRIPT
|
||||
NAMES
|
||||
"krb5-config"
|
||||
HINTS
|
||||
${_GSS_ROOT_HINTS}
|
||||
PATH_SUFFIXES
|
||||
bin
|
||||
NO_CMAKE_PATH
|
||||
NO_CMAKE_ENVIRONMENT_PATH
|
||||
NAMES
|
||||
"krb5-config"
|
||||
HINTS
|
||||
${_GSS_ROOT_HINTS}
|
||||
PATH_SUFFIXES
|
||||
bin
|
||||
NO_CMAKE_PATH
|
||||
NO_CMAKE_ENVIRONMENT_PATH
|
||||
)
|
||||
|
||||
# if not found in user-supplied directories, maybe system knows better
|
||||
find_file(_GSS_CONFIGURE_SCRIPT
|
||||
NAMES
|
||||
"krb5-config"
|
||||
PATH_SUFFIXES
|
||||
bin
|
||||
NAMES
|
||||
"krb5-config"
|
||||
PATH_SUFFIXES
|
||||
bin
|
||||
)
|
||||
|
||||
if(_GSS_CONFIGURE_SCRIPT)
|
||||
execute_process(
|
||||
COMMAND ${_GSS_CONFIGURE_SCRIPT} "--cflags" "gssapi"
|
||||
OUTPUT_VARIABLE _GSS_CFLAGS
|
||||
RESULT_VARIABLE _GSS_CONFIGURE_FAILED
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
COMMAND ${_GSS_CONFIGURE_SCRIPT} "--cflags" "gssapi"
|
||||
OUTPUT_VARIABLE _GSS_CFLAGS
|
||||
RESULT_VARIABLE _GSS_CONFIGURE_FAILED
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
)
|
||||
message(STATUS "CFLAGS: ${_GSS_CFLAGS}")
|
||||
if(NOT _GSS_CONFIGURE_FAILED) # 0 means success
|
||||
@ -105,10 +105,10 @@ if(NOT _GSS_FOUND) #not found by pkg-config. Let's take more traditional approac
|
||||
endif()
|
||||
|
||||
execute_process(
|
||||
COMMAND ${_GSS_CONFIGURE_SCRIPT} "--libs" "gssapi"
|
||||
OUTPUT_VARIABLE _GSS_LIB_FLAGS
|
||||
RESULT_VARIABLE _GSS_CONFIGURE_FAILED
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
COMMAND ${_GSS_CONFIGURE_SCRIPT} "--libs" "gssapi"
|
||||
OUTPUT_VARIABLE _GSS_LIB_FLAGS
|
||||
RESULT_VARIABLE _GSS_CONFIGURE_FAILED
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
)
|
||||
message(STATUS "LDFLAGS: ${_GSS_LIB_FLAGS}")
|
||||
|
||||
@ -132,10 +132,10 @@ if(NOT _GSS_FOUND) #not found by pkg-config. Let's take more traditional approac
|
||||
endif()
|
||||
|
||||
execute_process(
|
||||
COMMAND ${_GSS_CONFIGURE_SCRIPT} "--version"
|
||||
OUTPUT_VARIABLE _GSS_VERSION
|
||||
RESULT_VARIABLE _GSS_CONFIGURE_FAILED
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
COMMAND ${_GSS_CONFIGURE_SCRIPT} "--version"
|
||||
OUTPUT_VARIABLE _GSS_VERSION
|
||||
RESULT_VARIABLE _GSS_CONFIGURE_FAILED
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
)
|
||||
|
||||
# older versions may not have the "--version" parameter. In this case we just don't care.
|
||||
@ -144,10 +144,10 @@ if(NOT _GSS_FOUND) #not found by pkg-config. Let's take more traditional approac
|
||||
endif()
|
||||
|
||||
execute_process(
|
||||
COMMAND ${_GSS_CONFIGURE_SCRIPT} "--vendor"
|
||||
OUTPUT_VARIABLE _GSS_VENDOR
|
||||
RESULT_VARIABLE _GSS_CONFIGURE_FAILED
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
COMMAND ${_GSS_CONFIGURE_SCRIPT} "--vendor"
|
||||
OUTPUT_VARIABLE _GSS_VENDOR
|
||||
RESULT_VARIABLE _GSS_CONFIGURE_FAILED
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
)
|
||||
|
||||
# older versions may not have the "--vendor" parameter. In this case we just don't care.
|
||||
@ -164,13 +164,13 @@ if(NOT _GSS_FOUND) #not found by pkg-config. Let's take more traditional approac
|
||||
else() # either there is no config script or we are on a platform that doesn't provide one (Windows?)
|
||||
|
||||
find_path(_GSS_INCLUDE_DIR
|
||||
NAMES
|
||||
"gssapi/gssapi.h"
|
||||
HINTS
|
||||
${_GSS_ROOT_HINTS}
|
||||
PATH_SUFFIXES
|
||||
include
|
||||
inc
|
||||
NAMES
|
||||
"gssapi/gssapi.h"
|
||||
HINTS
|
||||
${_GSS_ROOT_HINTS}
|
||||
PATH_SUFFIXES
|
||||
include
|
||||
inc
|
||||
)
|
||||
|
||||
if(_GSS_INCLUDE_DIR) #jay, we've found something
|
||||
@ -193,13 +193,13 @@ if(NOT _GSS_FOUND) #not found by pkg-config. Let's take more traditional approac
|
||||
else()
|
||||
# I'm not convinced if this is the right way but this is what autotools do at the moment
|
||||
find_path(_GSS_INCLUDE_DIR
|
||||
NAMES
|
||||
"gssapi.h"
|
||||
HINTS
|
||||
${_GSS_ROOT_HINTS}
|
||||
PATH_SUFFIXES
|
||||
include
|
||||
inc
|
||||
NAMES
|
||||
"gssapi.h"
|
||||
HINTS
|
||||
${_GSS_ROOT_HINTS}
|
||||
PATH_SUFFIXES
|
||||
include
|
||||
inc
|
||||
)
|
||||
|
||||
if(_GSS_INCLUDE_DIR)
|
||||
@ -240,12 +240,12 @@ if(NOT _GSS_FOUND) #not found by pkg-config. Let's take more traditional approac
|
||||
endif()
|
||||
|
||||
find_library(_GSS_LIBRARIES
|
||||
NAMES
|
||||
${_GSS_LIBNAME}
|
||||
HINTS
|
||||
${_GSS_LIBDIR_HINTS}
|
||||
PATH_SUFFIXES
|
||||
${_GSS_LIBDIR_SUFFIXES}
|
||||
NAMES
|
||||
${_GSS_LIBNAME}
|
||||
HINTS
|
||||
${_GSS_LIBDIR_HINTS}
|
||||
PATH_SUFFIXES
|
||||
${_GSS_LIBDIR_SUFFIXES}
|
||||
)
|
||||
|
||||
endif()
|
||||
@ -301,12 +301,12 @@ include(FindPackageHandleStandardArgs)
|
||||
set(_GSS_REQUIRED_VARS GSS_LIBRARIES GSS_FLAVOUR)
|
||||
|
||||
find_package_handle_standard_args(GSS
|
||||
REQUIRED_VARS
|
||||
${_GSS_REQUIRED_VARS}
|
||||
VERSION_VAR
|
||||
GSS_VERSION
|
||||
FAIL_MESSAGE
|
||||
"Could NOT find GSS, try to set the path to GSS root folder in the system variable GSS_ROOT_DIR"
|
||||
REQUIRED_VARS
|
||||
${_GSS_REQUIRED_VARS}
|
||||
VERSION_VAR
|
||||
GSS_VERSION
|
||||
FAIL_MESSAGE
|
||||
"Could NOT find GSS, try to set the path to GSS root folder in the system variable GSS_ROOT_DIR"
|
||||
)
|
||||
|
||||
mark_as_advanced(GSS_INCLUDE_DIR GSS_LIBRARIES)
|
||||
|
@ -39,7 +39,7 @@ endif()
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(LibPSL
|
||||
REQUIRED_VARS LIBPSL_LIBRARY LIBPSL_INCLUDE_DIR
|
||||
VERSION_VAR LIBPSL_VERSION)
|
||||
REQUIRED_VARS LIBPSL_LIBRARY LIBPSL_INCLUDE_DIR
|
||||
VERSION_VAR LIBPSL_VERSION)
|
||||
|
||||
mark_as_advanced(LIBPSL_INCLUDE_DIR LIBPSL_LIBRARY)
|
||||
|
@ -39,7 +39,7 @@ endif()
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(LibSSH2
|
||||
REQUIRED_VARS LIBSSH2_LIBRARY LIBSSH2_INCLUDE_DIR
|
||||
VERSION_VAR LIBSSH2_VERSION)
|
||||
REQUIRED_VARS LIBSSH2_LIBRARY LIBSSH2_INCLUDE_DIR
|
||||
VERSION_VAR LIBSSH2_VERSION)
|
||||
|
||||
mark_as_advanced(LIBSSH2_INCLUDE_DIR LIBSSH2_LIBRARY)
|
||||
|
@ -31,6 +31,6 @@ set(MBEDTLS_LIBRARIES "${MBEDTLS_LIBRARY}" "${MBEDX509_LIBRARY}" "${MBEDCRYPTO_L
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(MbedTLS DEFAULT_MSG
|
||||
MBEDTLS_INCLUDE_DIRS MBEDTLS_LIBRARY MBEDX509_LIBRARY MBEDCRYPTO_LIBRARY)
|
||||
MBEDTLS_INCLUDE_DIRS MBEDTLS_LIBRARY MBEDX509_LIBRARY MBEDCRYPTO_LIBRARY)
|
||||
|
||||
mark_as_advanced(MBEDTLS_INCLUDE_DIRS MBEDTLS_LIBRARY MBEDX509_LIBRARY MBEDCRYPTO_LIBRARY)
|
||||
|
@ -28,11 +28,11 @@ find_path(NGHTTP2_INCLUDE_DIR "nghttp2/nghttp2.h")
|
||||
find_library(NGHTTP2_LIBRARY NAMES nghttp2 nghttp2_static)
|
||||
|
||||
find_package_handle_standard_args(NGHTTP2
|
||||
FOUND_VAR
|
||||
NGHTTP2_FOUND
|
||||
REQUIRED_VARS
|
||||
NGHTTP2_LIBRARY
|
||||
NGHTTP2_INCLUDE_DIR
|
||||
FOUND_VAR
|
||||
NGHTTP2_FOUND
|
||||
REQUIRED_VARS
|
||||
NGHTTP2_LIBRARY
|
||||
NGHTTP2_INCLUDE_DIR
|
||||
)
|
||||
|
||||
set(NGHTTP2_INCLUDE_DIRS ${NGHTTP2_INCLUDE_DIR})
|
||||
|
@ -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}\"")
|
||||
@ -420,8 +420,8 @@ endif()
|
||||
|
||||
if(CURL_USE_SCHANNEL)
|
||||
set(SSL_ENABLED ON)
|
||||
set(USE_SCHANNEL ON) # Windows native SSL/TLS support
|
||||
set(USE_WINDOWS_SSPI ON) # CURL_USE_SCHANNEL implies CURL_WINDOWS_SSPI
|
||||
set(USE_SCHANNEL ON) # Windows native SSL/TLS support
|
||||
set(USE_WINDOWS_SSPI ON) # CURL_USE_SCHANNEL implies CURL_WINDOWS_SSPI
|
||||
|
||||
if(CURL_DEFAULT_SSL_BACKEND AND CURL_DEFAULT_SSL_BACKEND STREQUAL "schannel")
|
||||
set(valid_default_ssl_backend TRUE)
|
||||
@ -468,7 +468,7 @@ if(CURL_USE_OPENSSL)
|
||||
set(USE_OPENSSL ON)
|
||||
|
||||
# Depend on OpenSSL via imported targets if supported by the running
|
||||
# version of CMake. This allows our dependents to get our dependencies
|
||||
# version of CMake. This allows our dependents to get our dependencies
|
||||
# transitively.
|
||||
if(NOT CMAKE_VERSION VERSION_LESS 3.4)
|
||||
list(APPEND CURL_LIBS OpenSSL::SSL OpenSSL::Crypto)
|
||||
@ -911,8 +911,8 @@ if(APPLE)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
#libpsl
|
||||
option(CURL_USE_LIBPSL "Use libPSL" ON)
|
||||
# libpsl
|
||||
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()
|
||||
@ -1450,9 +1449,9 @@ endif()
|
||||
# Check for nonblocking
|
||||
set(HAVE_DISABLED_NONBLOCKING 1)
|
||||
if(HAVE_FIONBIO OR
|
||||
HAVE_IOCTLSOCKET OR
|
||||
HAVE_IOCTLSOCKET_CASE OR
|
||||
HAVE_O_NONBLOCK)
|
||||
HAVE_IOCTLSOCKET OR
|
||||
HAVE_IOCTLSOCKET_CASE OR
|
||||
HAVE_O_NONBLOCK)
|
||||
set(HAVE_DISABLED_NONBLOCKING)
|
||||
endif()
|
||||
|
||||
@ -1460,7 +1459,7 @@ if(CMAKE_COMPILER_IS_GNUCC AND APPLE)
|
||||
include(CheckCCompilerFlag)
|
||||
check_c_compiler_flag(-Wno-long-double HAVE_C_FLAG_Wno_long_double)
|
||||
if(HAVE_C_FLAG_Wno_long_double)
|
||||
# The Mac version of GCC warns about use of long double. Disable it.
|
||||
# The Mac version of GCC warns about use of long double. Disable it.
|
||||
get_source_file_property(MPRINTF_COMPILE_FLAGS mprintf.c COMPILE_FLAGS)
|
||||
if(MPRINTF_COMPILE_FLAGS)
|
||||
set(MPRINTF_COMPILE_FLAGS "${MPRINTF_COMPILE_FLAGS} -Wno-long-double")
|
||||
@ -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})
|
||||
@ -1547,8 +1547,8 @@ function(transform_makefile_inc INPUT_FILE OUTPUT_FILE)
|
||||
string(REGEX REPLACE "([a-zA-Z_][a-zA-Z0-9_]*)[\t ]*=[\t ]*([^\n]*)" "SET(\\1 \\2)" MAKEFILE_INC_TEXT ${MAKEFILE_INC_TEXT})
|
||||
string(REPLACE "!π!α!" "\n" MAKEFILE_INC_TEXT ${MAKEFILE_INC_TEXT})
|
||||
|
||||
string(REGEX REPLACE "\\$\\(([a-zA-Z_][a-zA-Z0-9_]*)\\)" "\${\\1}" MAKEFILE_INC_TEXT ${MAKEFILE_INC_TEXT}) # Replace $() with ${}
|
||||
string(REGEX REPLACE "@([a-zA-Z_][a-zA-Z0-9_]*)@" "\${\\1}" MAKEFILE_INC_TEXT ${MAKEFILE_INC_TEXT}) # Replace @@ with ${}, even if that may not be read by CMake scripts.
|
||||
string(REGEX REPLACE "\\$\\(([a-zA-Z_][a-zA-Z0-9_]*)\\)" "\${\\1}" MAKEFILE_INC_TEXT ${MAKEFILE_INC_TEXT}) # Replace $() with ${}
|
||||
string(REGEX REPLACE "@([a-zA-Z_][a-zA-Z0-9_]*)@" "\${\\1}" MAKEFILE_INC_TEXT ${MAKEFILE_INC_TEXT}) # Replace @@ with ${}, even if that may not be read by CMake scripts.
|
||||
file(WRITE ${OUTPUT_FILE} ${MAKEFILE_INC_TEXT})
|
||||
set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS "${INPUT_FILE}")
|
||||
endfunction()
|
||||
@ -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})
|
||||
@ -1808,7 +1808,7 @@ if(NOT CURL_DISABLE_INSTALL)
|
||||
# * ENABLE_SHARED
|
||||
# * ENABLE_STATIC
|
||||
configure_file("${CURL_SOURCE_DIR}/curl-config.in"
|
||||
"${CURL_BINARY_DIR}/curl-config" @ONLY)
|
||||
"${CURL_BINARY_DIR}/curl-config" @ONLY)
|
||||
install(FILES "${CURL_BINARY_DIR}/curl-config"
|
||||
DESTINATION ${CMAKE_INSTALL_BINDIR}
|
||||
PERMISSIONS
|
||||
@ -1818,7 +1818,7 @@ if(NOT CURL_DISABLE_INSTALL)
|
||||
|
||||
# Finally generate a pkg-config file matching this config
|
||||
configure_file("${CURL_SOURCE_DIR}/libcurl.pc.in"
|
||||
"${CURL_BINARY_DIR}/libcurl.pc" @ONLY)
|
||||
"${CURL_BINARY_DIR}/libcurl.pc" @ONLY)
|
||||
install(FILES "${CURL_BINARY_DIR}/libcurl.pc"
|
||||
DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
|
||||
|
||||
@ -1834,11 +1834,11 @@ 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\")
|
||||
# Version 8 satisfies version 7... requirements
|
||||
set(PACKAGE_FIND_VERSION_MAJOR 8)
|
||||
set(PACKAGE_FIND_VERSION_COUNT 1)
|
||||
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)
|
||||
endif()
|
||||
${generated_version_config}"
|
||||
)
|
||||
@ -1847,20 +1847,18 @@ if(NOT CURL_DISABLE_INSTALL)
|
||||
# * TARGETS_EXPORT_NAME
|
||||
# * PROJECT_NAME
|
||||
configure_package_config_file(CMake/curl-config.cmake.in
|
||||
"${project_config}"
|
||||
INSTALL_DESTINATION ${CURL_INSTALL_CMAKE_DIR}
|
||||
"${project_config}"
|
||||
INSTALL_DESTINATION ${CURL_INSTALL_CMAKE_DIR}
|
||||
)
|
||||
|
||||
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}
|
||||
)
|
||||
|
||||
@ -1875,12 +1873,12 @@ if(NOT CURL_DISABLE_INSTALL)
|
||||
|
||||
if(NOT TARGET curl_uninstall)
|
||||
configure_file(
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/CMake/cmake_uninstall.cmake.in
|
||||
${CMAKE_CURRENT_BINARY_DIR}/CMake/cmake_uninstall.cmake
|
||||
IMMEDIATE @ONLY)
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/CMake/cmake_uninstall.cmake.in
|
||||
${CMAKE_CURRENT_BINARY_DIR}/CMake/cmake_uninstall.cmake
|
||||
IMMEDIATE @ONLY)
|
||||
|
||||
add_custom_target(curl_uninstall
|
||||
COMMAND ${CMAKE_COMMAND} -P
|
||||
${CMAKE_CURRENT_BINARY_DIR}/CMake/cmake_uninstall.cmake)
|
||||
COMMAND ${CMAKE_COMMAND} -P
|
||||
${CMAKE_CURRENT_BINARY_DIR}/CMake/cmake_uninstall.cmake)
|
||||
endif()
|
||||
endif()
|
||||
|
@ -21,7 +21,7 @@
|
||||
# SPDX-License-Identifier: curl
|
||||
#
|
||||
###########################################################################
|
||||
#add_subdirectory(examples)
|
||||
|
||||
if(BUILD_LIBCURL_DOCS)
|
||||
add_subdirectory(libcurl)
|
||||
endif()
|
||||
|
@ -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()
|
||||
|
@ -81,7 +81,7 @@ add_executable(
|
||||
)
|
||||
|
||||
add_library(
|
||||
curltool # special libcurltool library just for unittests
|
||||
curltool # special libcurltool library just for unittests
|
||||
STATIC
|
||||
EXCLUDE_FROM_ALL
|
||||
${CURL_CFILES} ${CURLTOOL_LIBCURL_CFILES} ${CURL_HFILES}
|
||||
@ -104,23 +104,23 @@ 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
|
||||
# Build curl executable
|
||||
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}
|
||||
|
@ -23,7 +23,7 @@
|
||||
###########################################################################
|
||||
set(TARGET_LABEL_PREFIX "Test ")
|
||||
|
||||
function(setup_test TEST_NAME) # ARGN are the files in the test
|
||||
function(setup_test TEST_NAME) # ARGN are the files in the test
|
||||
|
||||
if(LIB_SELECTED STREQUAL LIB_STATIC)
|
||||
# These are part of the libcurl static lib. Do not compile/link them again.
|
||||
@ -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})
|
||||
@ -72,7 +72,7 @@ if(NOT WIN32)
|
||||
# Output to .libs for compatibility with autotools, the test data expects a
|
||||
# library at (tests)/libtest/.libs/libhostname.so
|
||||
set_target_properties(hostname PROPERTIES
|
||||
LIBRARY_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/.libs)
|
||||
LIBRARY_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/.libs)
|
||||
if(HIDES_CURL_PRIVATE_SYMBOLS)
|
||||
set_property(TARGET hostname APPEND PROPERTY COMPILE_DEFINITIONS "CURL_HIDDEN_SYMBOLS")
|
||||
set_property(TARGET hostname APPEND PROPERTY COMPILE_FLAGS ${CURL_CFLAG_SYMBOLS_HIDE})
|
||||
|
@ -27,16 +27,16 @@ if(MSVC)
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /wd4306")
|
||||
endif()
|
||||
|
||||
function(SETUP_EXECUTABLE TEST_NAME) # ARGN are the files in the test
|
||||
function(SETUP_EXECUTABLE TEST_NAME) # ARGN are the files in the test
|
||||
add_executable(${TEST_NAME} EXCLUDE_FROM_ALL ${ARGN})
|
||||
add_dependencies(testdeps ${TEST_NAME})
|
||||
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})
|
||||
@ -51,7 +51,7 @@ function(SETUP_EXECUTABLE TEST_NAME) # ARGN are the files in the test
|
||||
# files on Win32 targets it is necessary to build the test servers
|
||||
# with CURL_STATICLIB defined, independently of how libcurl is built.
|
||||
set_target_properties(${TEST_NAME} PROPERTIES
|
||||
COMPILE_DEFINITIONS CURL_STATICLIB) # ${UPPER_TEST_NAME}
|
||||
COMPILE_DEFINITIONS CURL_STATICLIB) # ${UPPER_TEST_NAME}
|
||||
set_target_properties(${TEST_NAME} PROPERTIES
|
||||
PROJECT_LABEL "${TARGET_LABEL_PREFIX}${TEST_NAME}")
|
||||
endfunction()
|
||||
@ -66,17 +66,17 @@ foreach(EXECUTABLE_NAME ${noinst_PROGRAMS})
|
||||
endforeach()
|
||||
|
||||
|
||||
# SET(useful
|
||||
# getpart.c getpart.h
|
||||
# ${CURL_SOURCE_DIR}/lib/strequal.c
|
||||
# ${CURL_SOURCE_DIR}/lib/base64.c
|
||||
# ${CURL_SOURCE_DIR}/lib/mprintf.c
|
||||
# ${CURL_SOURCE_DIR}/lib/memdebug.c
|
||||
# ${CURL_SOURCE_DIR}/lib/timeval.c
|
||||
# set(useful
|
||||
# getpart.c getpart.h
|
||||
# ${CURL_SOURCE_DIR}/lib/strequal.c
|
||||
# ${CURL_SOURCE_DIR}/lib/base64.c
|
||||
# ${CURL_SOURCE_DIR}/lib/mprintf.c
|
||||
# ${CURL_SOURCE_DIR}/lib/memdebug.c
|
||||
# ${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)
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user