|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
macro(check_include_file_concat _file _variable) |
|
|
check_include_files("${CURL_INCLUDES};${_file}" ${_variable}) |
|
|
if(${_variable}) |
|
|
list(APPEND CURL_INCLUDES ${_file}) |
|
|
endif() |
|
|
endmacro() |
|
|
|
|
|
|
|
|
|
|
|
macro(curl_internal_test _curl_test) |
|
|
if(NOT DEFINED "${_curl_test}") |
|
|
string(REPLACE ";" " " _cmake_required_definitions "${CMAKE_REQUIRED_DEFINITIONS}") |
|
|
if(CMAKE_REQUIRED_LIBRARIES) |
|
|
set(_curl_test_add_libraries |
|
|
"-DLINK_LIBRARIES:STRING=${CMAKE_REQUIRED_LIBRARIES}") |
|
|
endif() |
|
|
|
|
|
message(STATUS "Performing Test ${_curl_test}") |
|
|
try_compile(${_curl_test} |
|
|
${PROJECT_BINARY_DIR} |
|
|
"${CMAKE_CURRENT_SOURCE_DIR}/CMake/CurlTests.c" |
|
|
CMAKE_FLAGS |
|
|
"-DCOMPILE_DEFINITIONS:STRING=-D${_curl_test} ${CURL_TEST_DEFINES} ${_cmake_required_definitions}" |
|
|
"${_curl_test_add_libraries}" |
|
|
OUTPUT_VARIABLE CURL_TEST_OUTPUT) |
|
|
if(${_curl_test}) |
|
|
set(${_curl_test} 1 CACHE INTERNAL "Curl test") |
|
|
message(STATUS "Performing Test ${_curl_test} - Success") |
|
|
else() |
|
|
set(${_curl_test} "" CACHE INTERNAL "Curl test") |
|
|
message(STATUS "Performing Test ${_curl_test} - Failed") |
|
|
endif() |
|
|
endif() |
|
|
endmacro() |
|
|
|
|
|
macro(curl_dependency_option _dependency) |
|
|
set(CURL_${_dependency} "AUTO" CACHE STRING "Build curl with ${_dependency} support (AUTO, ON or OFF)") |
|
|
set_property(CACHE CURL_${_dependency} PROPERTY STRINGS "AUTO" "ON" "OFF") |
|
|
|
|
|
if(CURL_${_dependency} STREQUAL "AUTO") |
|
|
find_package(${_dependency}) |
|
|
elseif(CURL_${_dependency}) |
|
|
find_package(${_dependency} REQUIRED) |
|
|
endif() |
|
|
endmacro() |
|
|
|
|
|
|
|
|
macro(curl_required_libpaths _libpaths_arg) |
|
|
set(_libpaths "${_libpaths_arg}") |
|
|
foreach(_libpath IN LISTS _libpaths) |
|
|
list(APPEND CMAKE_REQUIRED_LINK_OPTIONS "${CMAKE_LIBRARY_PATH_FLAG}${_libpath}") |
|
|
endforeach() |
|
|
endmacro() |
|
|
|