ENH: lower case cmake functions and remove tabs and re-indent cmake code

This commit is contained in:
Bill Hoffman 2009-06-09 17:29:16 +00:00
Родитель 8740d147c9
Коммит 744dceaffe
14 изменённых файлов: 1197 добавлений и 1187 удалений

Просмотреть файл

@ -6,51 +6,51 @@
# VARIABLE - variable to store size if the type exists.
# HAVE_${VARIABLE} - does the variable exists or not
MACRO(CHECK_TYPE_SIZE TYPE VARIABLE)
SET(CMAKE_ALLOW_UNKNOWN_VARIABLE_READ_ACCESS 1)
IF(NOT DEFINED ${VARIABLE})
IF("HAVE_${VARIABLE}" MATCHES "^HAVE_${VARIABLE}$")
SET(CHECK_TYPE_SIZE_TYPE "${TYPE}")
SET(MACRO_CHECK_TYPE_SIZE_FLAGS
"${CMAKE_REQUIRED_FLAGS}")
FOREACH(def HAVE_SYS_TYPES_H HAVE_STDINT_H HAVE_STDDEF_H)
IF("${def}")
SET(MACRO_CHECK_TYPE_SIZE_FLAGS
"${MACRO_CHECK_TYPE_SIZE_FLAGS} -D${def}")
ENDIF("${def}")
ENDFOREACH(def)
SET(CHECK_TYPE_SIZE_PREMAIN)
FOREACH(def ${CMAKE_EXTRA_INCLUDE_FILES})
SET(CHECK_TYPE_SIZE_PREMAIN "${CHECK_TYPE_SIZE_PREMAIN}#include \"${def}\"\n")
ENDFOREACH(def)
CONFIGURE_FILE(
"${CMAKE_CURRENT_SOURCE_DIR}/CMake/CheckTypeSize.c.in"
"${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/CheckTypeSize.c"
IMMEDIATE @ONLY)
FILE(READ
"${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/CheckTypeSize.c"
CHECK_TYPE_SIZE_FILE_CONTENT)
MESSAGE(STATUS "Check size of ${TYPE}")
IF(CMAKE_REQUIRED_LIBRARIES)
SET(CHECK_TYPE_SIZE_ADD_LIBRARIES
"-DLINK_LIBRARIES:STRING=${CMAKE_REQUIRED_LIBRARIES}")
ENDIF(CMAKE_REQUIRED_LIBRARIES)
TRY_RUN(${VARIABLE} HAVE_${VARIABLE}
${CMAKE_BINARY_DIR}
"${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/CheckTypeSize.c"
CMAKE_FLAGS -DCOMPILE_DEFINITIONS:STRING=${MACRO_CHECK_TYPE_SIZE_FLAGS}
"${CHECK_TYPE_SIZE_ADD_LIBRARIES}"
OUTPUT_VARIABLE OUTPUT)
IF(HAVE_${VARIABLE})
MESSAGE(STATUS "Check size of ${TYPE} - done")
FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
"Determining size of ${TYPE} passed with the following output:\n${OUTPUT}\n\n")
ELSE(HAVE_${VARIABLE})
MESSAGE(STATUS "Check size of ${TYPE} - failed")
FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
"Determining size of ${TYPE} failed with the following output:\n${OUTPUT}\nCheckTypeSize.c:\n${CHECK_TYPE_SIZE_FILE_CONTENT}\n\n")
ENDIF(HAVE_${VARIABLE})
ENDIF("HAVE_${VARIABLE}" MATCHES "^HAVE_${VARIABLE}$")
ENDIF(NOT DEFINED ${VARIABLE})
SET(CMAKE_ALLOW_UNKNOWN_VARIABLE_READ_ACCESS )
ENDMACRO(CHECK_TYPE_SIZE)
macro(CHECK_TYPE_SIZE TYPE VARIABLE)
set(CMAKE_ALLOW_UNKNOWN_VARIABLE_READ_ACCESS 1)
if(NOT DEFINED ${VARIABLE})
if("HAVE_${VARIABLE}" MATCHES "^HAVE_${VARIABLE}$")
set(CHECK_TYPE_SIZE_TYPE "${TYPE}")
set(MACRO_CHECK_TYPE_SIZE_FLAGS
"${CMAKE_REQUIRED_FLAGS}")
foreach(def HAVE_SYS_TYPES_H HAVE_STDINT_H HAVE_STDDEF_H)
if("${def}")
set(MACRO_CHECK_TYPE_SIZE_FLAGS
"${MACRO_CHECK_TYPE_SIZE_FLAGS} -D${def}")
endif("${def}")
endforeach(def)
set(CHECK_TYPE_SIZE_PREMAIN)
foreach(def ${CMAKE_EXTRA_INCLUDE_FILES})
set(CHECK_TYPE_SIZE_PREMAIN "${CHECK_TYPE_SIZE_PREMAIN}#include \"${def}\"\n")
endforeach(def)
configure_file(
"${CMAKE_CURRENT_SOURCE_DIR}/CMake/CheckTypeSize.c.in"
"${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/CheckTypeSize.c"
IMMEDIATE @ONLY)
file(READ
"${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/CheckTypeSize.c"
CHECK_TYPE_SIZE_FILE_CONTENT)
message(STATUS "Check size of ${TYPE}")
if(CMAKE_REQUIRED_LIBRARIES)
set(CHECK_TYPE_SIZE_ADD_LIBRARIES
"-DLINK_LIBRARIES:STRING=${CMAKE_REQUIRED_LIBRARIES}")
endif(CMAKE_REQUIRED_LIBRARIES)
try_run(${VARIABLE} HAVE_${VARIABLE}
${CMAKE_BINARY_DIR}
"${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/CheckTypeSize.c"
CMAKE_FLAGS -DCOMPILE_DEFINITIONS:STRING=${MACRO_CHECK_TYPE_SIZE_FLAGS}
"${CHECK_TYPE_SIZE_ADD_LIBRARIES}"
OUTPUT_VARIABLE OUTPUT)
if(HAVE_${VARIABLE})
message(STATUS "Check size of ${TYPE} - done")
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
"Determining size of ${TYPE} passed with the following output:\n${OUTPUT}\n\n")
else(HAVE_${VARIABLE})
message(STATUS "Check size of ${TYPE} - failed")
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
"Determining size of ${TYPE} failed with the following output:\n${OUTPUT}\nCheckTypeSize.c:\n${CHECK_TYPE_SIZE_FILE_CONTENT}\n\n")
endif(HAVE_${VARIABLE})
endif("HAVE_${VARIABLE}" MATCHES "^HAVE_${VARIABLE}$")
endif(NOT DEFINED ${VARIABLE})
set(CMAKE_ALLOW_UNKNOWN_VARIABLE_READ_ACCESS )
endmacro(CHECK_TYPE_SIZE)

Просмотреть файл

@ -12,43 +12,43 @@
# CMAKE_REQUIRED_INCLUDES = list of include directories
# CMAKE_REQUIRED_LIBRARIES = list of libraries to link
MACRO(CURL_CHECK_C_SOURCE_COMPILES SOURCE VAR)
IF("${VAR}" MATCHES "^${VAR}$" OR "${VAR}" MATCHES "UNKNOWN")
SET(message "${VAR}")
macro(CURL_CHECK_C_SOURCE_COMPILES SOURCE VAR)
if("${VAR}" MATCHES "^${VAR}$" OR "${VAR}" MATCHES "UNKNOWN")
set(message "${VAR}")
# If the number of arguments is greater than 2 (SOURCE VAR)
IF(${ARGC} GREATER 2)
if(${ARGC} GREATER 2)
# then add the third argument as a message
SET(message "${ARGV2} (${VAR})")
ENDIF(${ARGC} GREATER 2)
SET(MACRO_CHECK_FUNCTION_DEFINITIONS
set(message "${ARGV2} (${VAR})")
endif(${ARGC} GREATER 2)
set(MACRO_CHECK_FUNCTION_DEFINITIONS
"-D${VAR} ${CMAKE_REQUIRED_FLAGS}")
IF(CMAKE_REQUIRED_LIBRARIES)
SET(CURL_CHECK_C_SOURCE_COMPILES_ADD_LIBRARIES
if(CMAKE_REQUIRED_LIBRARIES)
set(CURL_CHECK_C_SOURCE_COMPILES_ADD_LIBRARIES
"-DLINK_LIBRARIES:STRING=${CMAKE_REQUIRED_LIBRARIES}")
ELSE(CMAKE_REQUIRED_LIBRARIES)
SET(CURL_CHECK_C_SOURCE_COMPILES_ADD_LIBRARIES)
ENDIF(CMAKE_REQUIRED_LIBRARIES)
IF(CMAKE_REQUIRED_INCLUDES)
SET(CURL_CHECK_C_SOURCE_COMPILES_ADD_INCLUDES
else(CMAKE_REQUIRED_LIBRARIES)
set(CURL_CHECK_C_SOURCE_COMPILES_ADD_LIBRARIES)
endif(CMAKE_REQUIRED_LIBRARIES)
if(CMAKE_REQUIRED_INCLUDES)
set(CURL_CHECK_C_SOURCE_COMPILES_ADD_INCLUDES
"-DINCLUDE_DIRECTORIES:STRING=${CMAKE_REQUIRED_INCLUDES}")
ELSE(CMAKE_REQUIRED_INCLUDES)
SET(CURL_CHECK_C_SOURCE_COMPILES_ADD_INCLUDES)
ENDIF(CMAKE_REQUIRED_INCLUDES)
SET(src "")
FOREACH(def ${EXTRA_DEFINES})
SET(src "${src}#define ${def} 1\n")
ENDFOREACH(def)
FOREACH(inc ${HEADER_INCLUDES})
SET(src "${src}#include <${inc}>\n")
ENDFOREACH(inc)
else(CMAKE_REQUIRED_INCLUDES)
set(CURL_CHECK_C_SOURCE_COMPILES_ADD_INCLUDES)
endif(CMAKE_REQUIRED_INCLUDES)
set(src "")
foreach(def ${EXTRA_DEFINES})
set(src "${src}#define ${def} 1\n")
endforeach(def)
foreach(inc ${HEADER_INCLUDES})
set(src "${src}#include <${inc}>\n")
endforeach(inc)
SET(src "${src}\nint main() { ${SOURCE} ; return 0; }")
SET(CMAKE_CONFIGURABLE_FILE_CONTENT "${src}")
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/CMake/CMakeConfigurableFile.in
set(src "${src}\nint main() { ${SOURCE} ; return 0; }")
set(CMAKE_CONFIGURABLE_FILE_CONTENT "${src}")
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/CMake/CMakeConfigurableFile.in
"${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/src.c"
IMMEDIATE)
MESSAGE(STATUS "Performing Test ${message}")
TRY_COMPILE(${VAR}
message(STATUS "Performing Test ${message}")
try_compile(${VAR}
${CMAKE_BINARY_DIR}
${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/src.c
COMPILE_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS}
@ -56,20 +56,20 @@ MACRO(CURL_CHECK_C_SOURCE_COMPILES SOURCE VAR)
"${CURL_CHECK_C_SOURCE_COMPILES_ADD_LIBRARIES}"
"${CURL_CHECK_C_SOURCE_COMPILES_ADD_INCLUDES}"
OUTPUT_VARIABLE OUTPUT)
IF(${VAR})
SET(${VAR} 1 CACHE INTERNAL "Test ${message}")
MESSAGE(STATUS "Performing Test ${message} - Success")
FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
if(${VAR})
set(${VAR} 1 CACHE INTERNAL "Test ${message}")
message(STATUS "Performing Test ${message} - Success")
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
"Performing C SOURCE FILE Test ${message} succeded with the following output:\n"
"${OUTPUT}\n"
"Source file was:\n${src}\n")
ELSE(${VAR})
MESSAGE(STATUS "Performing Test ${message} - Failed")
SET(${VAR} "" CACHE INTERNAL "Test ${message}")
FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
else(${VAR})
message(STATUS "Performing Test ${message} - Failed")
set(${VAR} "" CACHE INTERNAL "Test ${message}")
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
"Performing C SOURCE FILE Test ${message} failed with the following output:\n"
"${OUTPUT}\n"
"Source file was:\n${src}\n")
ENDIF(${VAR})
ENDIF("${VAR}" MATCHES "^${VAR}$" OR "${VAR}" MATCHES "UNKNOWN")
ENDMACRO(CURL_CHECK_C_SOURCE_COMPILES)
endif(${VAR})
endif("${VAR}" MATCHES "^${VAR}$" OR "${VAR}" MATCHES "UNKNOWN")
endmacro(CURL_CHECK_C_SOURCE_COMPILES)

Просмотреть файл

@ -12,43 +12,43 @@
# CMAKE_REQUIRED_INCLUDES = list of include directories
# CMAKE_REQUIRED_LIBRARIES = list of libraries to link
MACRO(CURL_CHECK_C_SOURCE_RUNS SOURCE VAR)
IF("${VAR}" MATCHES "^${VAR}$" OR "${VAR}" MATCHES "UNKNOWN")
SET(message "${VAR}")
macro(CURL_CHECK_C_SOURCE_RUNS SOURCE VAR)
if("${VAR}" MATCHES "^${VAR}$" OR "${VAR}" MATCHES "UNKNOWN")
set(message "${VAR}")
# If the number of arguments is greater than 2 (SOURCE VAR)
IF(${ARGC} GREATER 2)
if(${ARGC} GREATER 2)
# then add the third argument as a message
SET(message "${ARGV2} (${VAR})")
ENDIF(${ARGC} GREATER 2)
SET(MACRO_CHECK_FUNCTION_DEFINITIONS
set(message "${ARGV2} (${VAR})")
endif(${ARGC} GREATER 2)
set(MACRO_CHECK_FUNCTION_DEFINITIONS
"-D${VAR} ${CMAKE_REQUIRED_FLAGS}")
IF(CMAKE_REQUIRED_LIBRARIES)
SET(CURL_CHECK_C_SOURCE_COMPILES_ADD_LIBRARIES
if(CMAKE_REQUIRED_LIBRARIES)
set(CURL_CHECK_C_SOURCE_COMPILES_ADD_LIBRARIES
"-DLINK_LIBRARIES:STRING=${CMAKE_REQUIRED_LIBRARIES}")
ELSE(CMAKE_REQUIRED_LIBRARIES)
SET(CURL_CHECK_C_SOURCE_COMPILES_ADD_LIBRARIES)
ENDIF(CMAKE_REQUIRED_LIBRARIES)
IF(CMAKE_REQUIRED_INCLUDES)
SET(CURL_CHECK_C_SOURCE_COMPILES_ADD_INCLUDES
else(CMAKE_REQUIRED_LIBRARIES)
set(CURL_CHECK_C_SOURCE_COMPILES_ADD_LIBRARIES)
endif(CMAKE_REQUIRED_LIBRARIES)
if(CMAKE_REQUIRED_INCLUDES)
set(CURL_CHECK_C_SOURCE_COMPILES_ADD_INCLUDES
"-DINCLUDE_DIRECTORIES:STRING=${CMAKE_REQUIRED_INCLUDES}")
ELSE(CMAKE_REQUIRED_INCLUDES)
SET(CURL_CHECK_C_SOURCE_COMPILES_ADD_INCLUDES)
ENDIF(CMAKE_REQUIRED_INCLUDES)
SET(src "")
FOREACH(def ${EXTRA_DEFINES})
SET(src "${src}#define ${def} 1\n")
ENDFOREACH(def)
FOREACH(inc ${HEADER_INCLUDES})
SET(src "${src}#include <${inc}>\n")
ENDFOREACH(inc)
else(CMAKE_REQUIRED_INCLUDES)
set(CURL_CHECK_C_SOURCE_COMPILES_ADD_INCLUDES)
endif(CMAKE_REQUIRED_INCLUDES)
set(src "")
foreach(def ${EXTRA_DEFINES})
set(src "${src}#define ${def} 1\n")
endforeach(def)
foreach(inc ${HEADER_INCLUDES})
set(src "${src}#include <${inc}>\n")
endforeach(inc)
SET(src "${src}\nint main() { ${SOURCE} ; return 0; }")
SET(CMAKE_CONFIGURABLE_FILE_CONTENT "${src}")
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/CMake/CMakeConfigurableFile.in
set(src "${src}\nint main() { ${SOURCE} ; return 0; }")
set(CMAKE_CONFIGURABLE_FILE_CONTENT "${src}")
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/CMake/CMakeConfigurableFile.in
"${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/src.c"
IMMEDIATE)
MESSAGE(STATUS "Performing Test ${message}")
TRY_RUN(${VAR} ${VAR}_COMPILED
message(STATUS "Performing Test ${message}")
try_run(${VAR} ${VAR}_COMPILED
${CMAKE_BINARY_DIR}
${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/src.c
COMPILE_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS}
@ -57,27 +57,27 @@ MACRO(CURL_CHECK_C_SOURCE_RUNS SOURCE VAR)
"${CURL_CHECK_C_SOURCE_COMPILES_ADD_INCLUDES}"
OUTPUT_VARIABLE OUTPUT)
# if it did not compile make the return value fail code of 1
IF(NOT ${VAR}_COMPILED)
SET(${VAR} 1)
ENDIF(NOT ${VAR}_COMPILED)
if(NOT ${VAR}_COMPILED)
set(${VAR} 1)
endif(NOT ${VAR}_COMPILED)
# if the return value was 0 then it worked
SET(result_var ${${VAR}})
IF("${result_var}" EQUAL 0)
SET(${VAR} 1 CACHE INTERNAL "Test ${message}")
MESSAGE(STATUS "Performing Test ${message} - Success")
FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
set(result_var ${${VAR}})
if("${result_var}" EQUAL 0)
set(${VAR} 1 CACHE INTERNAL "Test ${message}")
message(STATUS "Performing Test ${message} - Success")
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
"Performing C SOURCE FILE Test ${message} succeded with the following output:\n"
"${OUTPUT}\n"
"Return value: ${${VAR}}\n"
"Source file was:\n${src}\n")
ELSE("${result_var}" EQUAL 0)
MESSAGE(STATUS "Performing Test ${message} - Failed")
SET(${VAR} "" CACHE INTERNAL "Test ${message}")
FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
else("${result_var}" EQUAL 0)
message(STATUS "Performing Test ${message} - Failed")
set(${VAR} "" CACHE INTERNAL "Test ${message}")
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
"Performing C SOURCE FILE Test ${message} failed with the following output:\n"
"${OUTPUT}\n"
"Return value: ${result_var}\n"
"Source file was:\n${src}\n")
ENDIF("${result_var}" EQUAL 0)
ENDIF("${VAR}" MATCHES "^${VAR}$" OR "${VAR}" MATCHES "UNKNOWN")
ENDMACRO(CURL_CHECK_C_SOURCE_RUNS)
endif("${result_var}" EQUAL 0)
endif("${VAR}" MATCHES "^${VAR}$" OR "${VAR}" MATCHES "UNKNOWN")
endmacro(CURL_CHECK_C_SOURCE_RUNS)

Просмотреть файл

@ -1,19 +1,19 @@
# Extension of the standard FindOpenSSL.cmake
# Adds OPENSSL_INCLUDE_DIRS and libeay32
INCLUDE("${CMAKE_ROOT}/Modules/FindOpenSSL.cmake")
include("${CMAKE_ROOT}/Modules/FindOpenSSL.cmake")
# Bill Hoffman told that libeay32 is necessary for him:
FIND_LIBRARY(SSL_LIBEAY NAMES libeay32)
find_library(SSL_LIBEAY NAMES libeay32)
IF(OPENSSL_FOUND)
IF(SSL_LIBEAY)
LIST(APPEND OPENSSL_LIBRARIES ${SSL_LIBEAY})
ELSE()
SET(OPENSSL_FOUND FALSE)
ENDIF()
ENDIF()
if(OPENSSL_FOUND)
if(SSL_LIBEAY)
list(APPEND OPENSSL_LIBRARIES ${SSL_LIBEAY})
else()
set(OPENSSL_FOUND FALSE)
endif()
endif()
IF(OPENSSL_FOUND)
SET(OPENSSL_INCLUDE_DIRS ${OPENSSL_INCLUDE_DIR})
ENDIF()
if(OPENSSL_FOUND)
set(OPENSSL_INCLUDE_DIRS ${OPENSSL_INCLUDE_DIR})
endif()

Просмотреть файл

@ -1,8 +1,8 @@
# Locate zlib
INCLUDE("${CMAKE_ROOT}/Modules/FindZLIB.cmake")
include("${CMAKE_ROOT}/Modules/FindZLIB.cmake")
FIND_LIBRARY(ZLIB_LIBRARY_DEBUG NAMES zd zlibd zdlld zlib1d )
find_library(ZLIB_LIBRARY_DEBUG NAMES zd zlibd zdlld zlib1d )
IF(ZLIB_FOUND AND ZLIB_LIBRARY_DEBUG)
SET( ZLIB_LIBRARIES optimized "${ZLIB_LIBRARY}" debug ${ZLIB_LIBRARY_DEBUG})
ENDIF()
if(ZLIB_FOUND AND ZLIB_LIBRARY_DEBUG)
set( ZLIB_LIBRARIES optimized "${ZLIB_LIBRARY}" debug ${ZLIB_LIBRARY_DEBUG})
endif()

Просмотреть файл

@ -1,250 +1,250 @@
INCLUDE(CurlCheckCSourceCompiles)
SET(EXTRA_DEFINES "__unused1\n#undef inline\n#define __unused2")
SET(HEADER_INCLUDES)
SET(headers_hack)
include(CurlCheckCSourceCompiles)
set(EXTRA_DEFINES "__unused1\n#undef inline\n#define __unused2")
set(HEADER_INCLUDES)
set(headers_hack)
MACRO(add_header_include check header)
IF(${check})
SET(headers_hack
macro(add_header_include check header)
if(${check})
set(headers_hack
"${headers_hack}\n#include <${header}>")
#SET(HEADER_INCLUDES
# ${HEADER_INCLUDES}
# "${header}")
ENDIF(${check})
ENDMACRO(add_header_include)
endif(${check})
endmacro(add_header_include)
SET(signature_call_conv)
IF(HAVE_WINDOWS_H)
set(signature_call_conv)
if(HAVE_WINDOWS_H)
add_header_include(HAVE_WINDOWS_H "windows.h")
add_header_include(HAVE_WINSOCK2_H "winsock2.h")
add_header_include(HAVE_WINSOCK_H "winsock.h")
SET(EXTRA_DEFINES ${EXTRA_DEFINES}
set(EXTRA_DEFINES ${EXTRA_DEFINES}
"__unused7\n#ifndef WIN32_LEAN_AND_MEAN\n#define WIN32_LEAN_AND_MEAN\n#endif\n#define __unused3")
SET(signature_call_conv "PASCAL")
ELSE(HAVE_WINDOWS_H)
set(signature_call_conv "PASCAL")
else(HAVE_WINDOWS_H)
add_header_include(HAVE_SYS_TYPES_H "sys/types.h")
add_header_include(HAVE_SYS_SOCKET_H "sys/socket.h")
ENDIF(HAVE_WINDOWS_H)
endif(HAVE_WINDOWS_H)
SET(EXTRA_DEFINES_BACKUP "${EXTRA_DEFINES}")
SET(EXTRA_DEFINES "${EXTRA_DEFINES_BACKUP}\n${headers_hack}\n${extern_line}\n#define __unused5")
CURL_CHECK_C_SOURCE_COMPILES("recv(0, 0, 0, 0)" curl_cv_recv)
IF(curl_cv_recv)
set(EXTRA_DEFINES_BACKUP "${EXTRA_DEFINES}")
set(EXTRA_DEFINES "${EXTRA_DEFINES_BACKUP}\n${headers_hack}\n${extern_line}\n#define __unused5")
curl_check_c_source_compiles("recv(0, 0, 0, 0)" curl_cv_recv)
if(curl_cv_recv)
# AC_CACHE_CHECK([types of arguments and return type for recv],
#[curl_cv_func_recv_args], [
#SET(curl_cv_func_recv_args "unknown")
#for recv_retv in 'int' 'ssize_t'; do
IF(NOT DEFINED curl_cv_func_recv_args OR "${curl_cv_func_recv_args}" STREQUAL "unknown")
FOREACH(recv_retv "int" "ssize_t" )
FOREACH(recv_arg1 "int" "ssize_t" "SOCKET")
FOREACH(recv_arg2 "void *" "char *")
FOREACH(recv_arg3 "size_t" "int" "socklen_t" "unsigned int")
FOREACH(recv_arg4 "int" "unsigned int")
IF(NOT curl_cv_func_recv_done)
SET(curl_cv_func_recv_test "UNKNOWN")
SET(extern_line "extern ${recv_retv} ${signature_call_conv} recv(${recv_arg1}, ${recv_arg2}, ${recv_arg3}, ${recv_arg4})\;")
SET(EXTRA_DEFINES "${EXTRA_DEFINES_BACKUP}\n${headers_hack}\n${extern_line}\n#define __unused5")
CURL_CHECK_C_SOURCE_COMPILES("
if(NOT DEFINED curl_cv_func_recv_args OR "${curl_cv_func_recv_args}" STREQUAL "unknown")
foreach(recv_retv "int" "ssize_t" )
foreach(recv_arg1 "int" "ssize_t" "SOCKET")
foreach(recv_arg2 "void *" "char *")
foreach(recv_arg3 "size_t" "int" "socklen_t" "unsigned int")
foreach(recv_arg4 "int" "unsigned int")
if(NOT curl_cv_func_recv_done)
set(curl_cv_func_recv_test "UNKNOWN")
set(extern_line "extern ${recv_retv} ${signature_call_conv} recv(${recv_arg1}, ${recv_arg2}, ${recv_arg3}, ${recv_arg4})\;")
set(EXTRA_DEFINES "${EXTRA_DEFINES_BACKUP}\n${headers_hack}\n${extern_line}\n#define __unused5")
curl_check_c_source_compiles("
${recv_arg1} s=0;
${recv_arg2} buf=0;
${recv_arg3} len=0;
${recv_arg4} flags=0;
${recv_retv} res = recv(s, buf, len, flags)"
curl_cv_func_recv_test
"${recv_retv} recv(${recv_arg1}, ${recv_arg2}, ${recv_arg3}, ${recv_arg4})")
IF(curl_cv_func_recv_test)
SET(curl_cv_func_recv_args
curl_cv_func_recv_test
"${recv_retv} recv(${recv_arg1}, ${recv_arg2}, ${recv_arg3}, ${recv_arg4})")
if(curl_cv_func_recv_test)
set(curl_cv_func_recv_args
"${recv_arg1},${recv_arg2},${recv_arg3},${recv_arg4},${recv_retv}")
SET(RECV_TYPE_ARG1 "${recv_arg1}")
SET(RECV_TYPE_ARG2 "${recv_arg2}")
SET(RECV_TYPE_ARG3 "${recv_arg3}")
SET(RECV_TYPE_ARG4 "${recv_arg4}")
SET(RECV_TYPE_RETV "${recv_retv}")
SET(HAVE_RECV 1)
SET(curl_cv_func_recv_done 1)
ENDIF(curl_cv_func_recv_test)
ENDIF(NOT curl_cv_func_recv_done)
ENDFOREACH(recv_arg4)
ENDFOREACH(recv_arg3)
ENDFOREACH(recv_arg2)
ENDFOREACH(recv_arg1)
ENDFOREACH(recv_retv)
ELSE(NOT DEFINED curl_cv_func_recv_args OR "${curl_cv_func_recv_args}" STREQUAL "unknown")
STRING(REGEX REPLACE "^([^,]*),[^,]*,[^,]*,[^,]*,[^,]*$" "\\1" RECV_TYPE_ARG1 "${curl_cv_func_recv_args}")
STRING(REGEX REPLACE "^[^,]*,([^,]*),[^,]*,[^,]*,[^,]*$" "\\1" RECV_TYPE_ARG2 "${curl_cv_func_recv_args}")
STRING(REGEX REPLACE "^[^,]*,[^,]*,([^,]*),[^,]*,[^,]*$" "\\1" RECV_TYPE_ARG3 "${curl_cv_func_recv_args}")
STRING(REGEX REPLACE "^[^,]*,[^,]*,[^,]*,([^,]*),[^,]*$" "\\1" RECV_TYPE_ARG4 "${curl_cv_func_recv_args}")
STRING(REGEX REPLACE "^[^,]*,[^,]*,[^,]*,[^,]*,([^,]*)$" "\\1" RECV_TYPE_RETV "${curl_cv_func_recv_args}")
set(RECV_TYPE_ARG1 "${recv_arg1}")
set(RECV_TYPE_ARG2 "${recv_arg2}")
set(RECV_TYPE_ARG3 "${recv_arg3}")
set(RECV_TYPE_ARG4 "${recv_arg4}")
set(RECV_TYPE_RETV "${recv_retv}")
set(HAVE_RECV 1)
set(curl_cv_func_recv_done 1)
endif(curl_cv_func_recv_test)
endif(NOT curl_cv_func_recv_done)
endforeach(recv_arg4)
endforeach(recv_arg3)
endforeach(recv_arg2)
endforeach(recv_arg1)
endforeach(recv_retv)
else(NOT DEFINED curl_cv_func_recv_args OR "${curl_cv_func_recv_args}" STREQUAL "unknown")
string(REGEX REPLACE "^([^,]*),[^,]*,[^,]*,[^,]*,[^,]*$" "\\1" RECV_TYPE_ARG1 "${curl_cv_func_recv_args}")
string(REGEX REPLACE "^[^,]*,([^,]*),[^,]*,[^,]*,[^,]*$" "\\1" RECV_TYPE_ARG2 "${curl_cv_func_recv_args}")
string(REGEX REPLACE "^[^,]*,[^,]*,([^,]*),[^,]*,[^,]*$" "\\1" RECV_TYPE_ARG3 "${curl_cv_func_recv_args}")
string(REGEX REPLACE "^[^,]*,[^,]*,[^,]*,([^,]*),[^,]*$" "\\1" RECV_TYPE_ARG4 "${curl_cv_func_recv_args}")
string(REGEX REPLACE "^[^,]*,[^,]*,[^,]*,[^,]*,([^,]*)$" "\\1" RECV_TYPE_RETV "${curl_cv_func_recv_args}")
#MESSAGE("RECV_TYPE_ARG1 ${RECV_TYPE_ARG1}")
#MESSAGE("RECV_TYPE_ARG2 ${RECV_TYPE_ARG2}")
#MESSAGE("RECV_TYPE_ARG3 ${RECV_TYPE_ARG3}")
#MESSAGE("RECV_TYPE_ARG4 ${RECV_TYPE_ARG4}")
#MESSAGE("RECV_TYPE_RETV ${RECV_TYPE_RETV}")
ENDIF(NOT DEFINED curl_cv_func_recv_args OR "${curl_cv_func_recv_args}" STREQUAL "unknown")
endif(NOT DEFINED curl_cv_func_recv_args OR "${curl_cv_func_recv_args}" STREQUAL "unknown")
IF("${curl_cv_func_recv_args}" STREQUAL "unknown")
MESSAGE(FATAL_ERROR "Cannot find proper types to use for recv args")
ENDIF("${curl_cv_func_recv_args}" STREQUAL "unknown")
ELSE(curl_cv_recv)
MESSAGE(FATAL_ERROR "Unable to link function recv")
ENDIF(curl_cv_recv)
SET(curl_cv_func_recv_args "${curl_cv_func_recv_args}" CACHE INTERNAL "Arguments for recv")
SET(HAVE_RECV 1)
if("${curl_cv_func_recv_args}" STREQUAL "unknown")
message(FATAL_ERROR "Cannot find proper types to use for recv args")
endif("${curl_cv_func_recv_args}" STREQUAL "unknown")
else(curl_cv_recv)
message(FATAL_ERROR "Unable to link function recv")
endif(curl_cv_recv)
set(curl_cv_func_recv_args "${curl_cv_func_recv_args}" CACHE INTERNAL "Arguments for recv")
set(HAVE_RECV 1)
CURL_CHECK_C_SOURCE_COMPILES("send(0, 0, 0, 0)" curl_cv_send)
IF(curl_cv_send)
curl_check_c_source_compiles("send(0, 0, 0, 0)" curl_cv_send)
if(curl_cv_send)
# AC_CACHE_CHECK([types of arguments and return type for send],
#[curl_cv_func_send_args], [
#SET(curl_cv_func_send_args "unknown")
#for send_retv in 'int' 'ssize_t'; do
IF(NOT DEFINED curl_cv_func_send_args OR "${curl_cv_func_send_args}" STREQUAL "unknown")
FOREACH(send_retv "int" "ssize_t" )
FOREACH(send_arg1 "int" "ssize_t" "SOCKET")
FOREACH(send_arg2 "const void *" "void *" "char *" "const char *")
FOREACH(send_arg3 "size_t" "int" "socklen_t" "unsigned int")
FOREACH(send_arg4 "int" "unsigned int")
IF(NOT curl_cv_func_send_done)
SET(curl_cv_func_send_test "UNKNOWN")
SET(extern_line "extern ${send_retv} ${signature_call_conv} send(${send_arg1}, ${send_arg2}, ${send_arg3}, ${send_arg4})\;")
SET(EXTRA_DEFINES "${EXTRA_DEFINES_BACKUP}\n${headers_hack}\n${extern_line}\n#define __unused5")
CURL_CHECK_C_SOURCE_COMPILES("
if(NOT DEFINED curl_cv_func_send_args OR "${curl_cv_func_send_args}" STREQUAL "unknown")
foreach(send_retv "int" "ssize_t" )
foreach(send_arg1 "int" "ssize_t" "SOCKET")
foreach(send_arg2 "const void *" "void *" "char *" "const char *")
foreach(send_arg3 "size_t" "int" "socklen_t" "unsigned int")
foreach(send_arg4 "int" "unsigned int")
if(NOT curl_cv_func_send_done)
set(curl_cv_func_send_test "UNKNOWN")
set(extern_line "extern ${send_retv} ${signature_call_conv} send(${send_arg1}, ${send_arg2}, ${send_arg3}, ${send_arg4})\;")
set(EXTRA_DEFINES "${EXTRA_DEFINES_BACKUP}\n${headers_hack}\n${extern_line}\n#define __unused5")
curl_check_c_source_compiles("
${send_arg1} s=0;
${send_arg2} buf=0;
${send_arg3} len=0;
${send_arg4} flags=0;
${send_retv} res = send(s, buf, len, flags)"
curl_cv_func_send_test
"${send_retv} send(${send_arg1}, ${send_arg2}, ${send_arg3}, ${send_arg4})")
IF(curl_cv_func_send_test)
curl_cv_func_send_test
"${send_retv} send(${send_arg1}, ${send_arg2}, ${send_arg3}, ${send_arg4})")
if(curl_cv_func_send_test)
#MESSAGE("Found arguments: ${curl_cv_func_send_test}")
STRING(REGEX REPLACE "(const) .*" "\\1" send_qual_arg2 "${send_arg2}")
STRING(REGEX REPLACE "const (.*)" "\\1" send_arg2 "${send_arg2}")
SET(curl_cv_func_send_args
string(REGEX REPLACE "(const) .*" "\\1" send_qual_arg2 "${send_arg2}")
string(REGEX REPLACE "const (.*)" "\\1" send_arg2 "${send_arg2}")
set(curl_cv_func_send_args
"${send_arg1},${send_arg2},${send_arg3},${send_arg4},${send_retv},${send_qual_arg2}")
SET(SEND_TYPE_ARG1 "${send_arg1}")
SET(SEND_TYPE_ARG2 "${send_arg2}")
SET(SEND_TYPE_ARG3 "${send_arg3}")
SET(SEND_TYPE_ARG4 "${send_arg4}")
SET(SEND_TYPE_RETV "${send_retv}")
SET(HAVE_SEND 1)
SET(curl_cv_func_send_done 1)
ENDIF(curl_cv_func_send_test)
ENDIF(NOT curl_cv_func_send_done)
ENDFOREACH(send_arg4)
ENDFOREACH(send_arg3)
ENDFOREACH(send_arg2)
ENDFOREACH(send_arg1)
ENDFOREACH(send_retv)
ELSE(NOT DEFINED curl_cv_func_send_args OR "${curl_cv_func_send_args}" STREQUAL "unknown")
STRING(REGEX REPLACE "^([^,]*),[^,]*,[^,]*,[^,]*,[^,]*,[^,]*$" "\\1" SEND_TYPE_ARG1 "${curl_cv_func_send_args}")
STRING(REGEX REPLACE "^[^,]*,([^,]*),[^,]*,[^,]*,[^,]*,[^,]*$" "\\1" SEND_TYPE_ARG2 "${curl_cv_func_send_args}")
STRING(REGEX REPLACE "^[^,]*,[^,]*,([^,]*),[^,]*,[^,]*,[^,]*$" "\\1" SEND_TYPE_ARG3 "${curl_cv_func_send_args}")
STRING(REGEX REPLACE "^[^,]*,[^,]*,[^,]*,([^,]*),[^,]*,[^,]*$" "\\1" SEND_TYPE_ARG4 "${curl_cv_func_send_args}")
STRING(REGEX REPLACE "^[^,]*,[^,]*,[^,]*,[^,]*,([^,]*),[^,]*$" "\\1" SEND_TYPE_RETV "${curl_cv_func_send_args}")
STRING(REGEX REPLACE "^[^,]*,[^,]*,[^,]*,[^,]*,[^,]*,([^,]*)$" "\\1" SEND_QUAL_ARG2 "${curl_cv_func_send_args}")
set(SEND_TYPE_ARG1 "${send_arg1}")
set(SEND_TYPE_ARG2 "${send_arg2}")
set(SEND_TYPE_ARG3 "${send_arg3}")
set(SEND_TYPE_ARG4 "${send_arg4}")
set(SEND_TYPE_RETV "${send_retv}")
set(HAVE_SEND 1)
set(curl_cv_func_send_done 1)
endif(curl_cv_func_send_test)
endif(NOT curl_cv_func_send_done)
endforeach(send_arg4)
endforeach(send_arg3)
endforeach(send_arg2)
endforeach(send_arg1)
endforeach(send_retv)
else(NOT DEFINED curl_cv_func_send_args OR "${curl_cv_func_send_args}" STREQUAL "unknown")
string(REGEX REPLACE "^([^,]*),[^,]*,[^,]*,[^,]*,[^,]*,[^,]*$" "\\1" SEND_TYPE_ARG1 "${curl_cv_func_send_args}")
string(REGEX REPLACE "^[^,]*,([^,]*),[^,]*,[^,]*,[^,]*,[^,]*$" "\\1" SEND_TYPE_ARG2 "${curl_cv_func_send_args}")
string(REGEX REPLACE "^[^,]*,[^,]*,([^,]*),[^,]*,[^,]*,[^,]*$" "\\1" SEND_TYPE_ARG3 "${curl_cv_func_send_args}")
string(REGEX REPLACE "^[^,]*,[^,]*,[^,]*,([^,]*),[^,]*,[^,]*$" "\\1" SEND_TYPE_ARG4 "${curl_cv_func_send_args}")
string(REGEX REPLACE "^[^,]*,[^,]*,[^,]*,[^,]*,([^,]*),[^,]*$" "\\1" SEND_TYPE_RETV "${curl_cv_func_send_args}")
string(REGEX REPLACE "^[^,]*,[^,]*,[^,]*,[^,]*,[^,]*,([^,]*)$" "\\1" SEND_QUAL_ARG2 "${curl_cv_func_send_args}")
#MESSAGE("SEND_TYPE_ARG1 ${SEND_TYPE_ARG1}")
#MESSAGE("SEND_TYPE_ARG2 ${SEND_TYPE_ARG2}")
#MESSAGE("SEND_TYPE_ARG3 ${SEND_TYPE_ARG3}")
#MESSAGE("SEND_TYPE_ARG4 ${SEND_TYPE_ARG4}")
#MESSAGE("SEND_TYPE_RETV ${SEND_TYPE_RETV}")
#MESSAGE("SEND_QUAL_ARG2 ${SEND_QUAL_ARG2}")
ENDIF(NOT DEFINED curl_cv_func_send_args OR "${curl_cv_func_send_args}" STREQUAL "unknown")
endif(NOT DEFINED curl_cv_func_send_args OR "${curl_cv_func_send_args}" STREQUAL "unknown")
IF("${curl_cv_func_send_args}" STREQUAL "unknown")
MESSAGE(FATAL_ERROR "Cannot find proper types to use for send args")
ENDIF("${curl_cv_func_send_args}" STREQUAL "unknown")
SET(SEND_QUAL_ARG2 "const")
ELSE(curl_cv_send)
MESSAGE(FATAL_ERROR "Unable to link function send")
ENDIF(curl_cv_send)
SET(curl_cv_func_send_args "${curl_cv_func_send_args}" CACHE INTERNAL "Arguments for send")
SET(HAVE_SEND 1)
if("${curl_cv_func_send_args}" STREQUAL "unknown")
message(FATAL_ERROR "Cannot find proper types to use for send args")
endif("${curl_cv_func_send_args}" STREQUAL "unknown")
set(SEND_QUAL_ARG2 "const")
else(curl_cv_send)
message(FATAL_ERROR "Unable to link function send")
endif(curl_cv_send)
set(curl_cv_func_send_args "${curl_cv_func_send_args}" CACHE INTERNAL "Arguments for send")
set(HAVE_SEND 1)
SET(EXTRA_DEFINES "${EXTRA_DEFINES}\n${headers_hack}\n#define __unused5")
CURL_CHECK_C_SOURCE_COMPILES("int flag = MSG_NOSIGNAL" HAVE_MSG_NOSIGNAL)
set(EXTRA_DEFINES "${EXTRA_DEFINES}\n${headers_hack}\n#define __unused5")
curl_check_c_source_compiles("int flag = MSG_NOSIGNAL" HAVE_MSG_NOSIGNAL)
SET(EXTRA_DEFINES "__unused1\n#undef inline\n#define __unused2")
SET(HEADER_INCLUDES)
SET(headers_hack)
set(EXTRA_DEFINES "__unused1\n#undef inline\n#define __unused2")
set(HEADER_INCLUDES)
set(headers_hack)
MACRO(add_header_include check header)
IF(${check})
SET(headers_hack
macro(add_header_include check header)
if(${check})
set(headers_hack
"${headers_hack}\n#include <${header}>")
#SET(HEADER_INCLUDES
# ${HEADER_INCLUDES}
# "${header}")
ENDIF(${check})
ENDMACRO(add_header_include header)
endif(${check})
endmacro(add_header_include header)
IF(HAVE_WINDOWS_H)
SET(EXTRA_DEFINES ${EXTRA_DEFINES}
if(HAVE_WINDOWS_H)
set(EXTRA_DEFINES ${EXTRA_DEFINES}
"__unused7\n#ifndef WIN32_LEAN_AND_MEAN\n#define WIN32_LEAN_AND_MEAN\n#endif\n#define __unused3")
add_header_include(HAVE_WINDOWS_H "windows.h")
add_header_include(HAVE_WINSOCK2_H "winsock2.h")
add_header_include(HAVE_WINSOCK_H "winsock.h")
ELSE(HAVE_WINDOWS_H)
else(HAVE_WINDOWS_H)
add_header_include(HAVE_SYS_TYPES_H "sys/types.h")
add_header_include(HAVE_SYS_TIME_H "sys/time.h")
add_header_include(TIME_WITH_SYS_TIME "time.h")
add_header_include(HAVE_TIME_H "time.h")
ENDIF(HAVE_WINDOWS_H)
SET(EXTRA_DEFINES "${EXTRA_DEFINES}\n${headers_hack}\n#define __unused5")
CURL_CHECK_C_SOURCE_COMPILES("struct timeval ts;\nts.tv_sec = 0;\nts.tv_usec = 0" HAVE_STRUCT_TIMEVAL)
endif(HAVE_WINDOWS_H)
set(EXTRA_DEFINES "${EXTRA_DEFINES}\n${headers_hack}\n#define __unused5")
curl_check_c_source_compiles("struct timeval ts;\nts.tv_sec = 0;\nts.tv_usec = 0" HAVE_STRUCT_TIMEVAL)
INCLUDE(CurlCheckCSourceRuns)
SET(EXTRA_DEFINES)
SET(HEADER_INCLUDES)
IF(HAVE_SYS_POLL_H)
SET(HEADER_INCLUDES "sys/poll.h")
ENDIF(HAVE_SYS_POLL_H)
CURL_CHECK_C_SOURCE_RUNS("return poll((void *)0, 0, 10 /*ms*/)" HAVE_POLL_FINE)
include(CurlCheckCSourceRuns)
set(EXTRA_DEFINES)
set(HEADER_INCLUDES)
if(HAVE_SYS_POLL_H)
set(HEADER_INCLUDES "sys/poll.h")
endif(HAVE_SYS_POLL_H)
curl_check_c_source_runs("return poll((void *)0, 0, 10 /*ms*/)" HAVE_POLL_FINE)
SET(HAVE_SIG_ATOMIC_T 1)
SET(EXTRA_DEFINES)
SET(HEADER_INCLUDES)
IF(HAVE_SIGNAL_H)
SET(HEADER_INCLUDES "signal.h")
SET(CMAKE_EXTRA_INCLUDE_FILES "signal.h")
ENDIF(HAVE_SIGNAL_H)
CHECK_TYPE_SIZE("sig_atomic_t" SIZEOF_SIG_ATOMIC_T)
IF(HAVE_SIZEOF_SIG_ATOMIC_T)
CURL_CHECK_C_SOURCE_COMPILES("static volatile sig_atomic_t dummy = 0" HAVE_SIG_ATOMIC_T_NOT_VOLATILE)
IF(NOT HAVE_SIG_ATOMIC_T_NOT_VOLATILE)
SET(HAVE_SIG_ATOMIC_T_VOLATILE 1)
ENDIF(NOT HAVE_SIG_ATOMIC_T_NOT_VOLATILE)
ENDIF(HAVE_SIZEOF_SIG_ATOMIC_T)
set(HAVE_SIG_ATOMIC_T 1)
set(EXTRA_DEFINES)
set(HEADER_INCLUDES)
if(HAVE_SIGNAL_H)
set(HEADER_INCLUDES "signal.h")
set(CMAKE_EXTRA_INCLUDE_FILES "signal.h")
endif(HAVE_SIGNAL_H)
check_type_size("sig_atomic_t" SIZEOF_SIG_ATOMIC_T)
if(HAVE_SIZEOF_SIG_ATOMIC_T)
curl_check_c_source_compiles("static volatile sig_atomic_t dummy = 0" HAVE_SIG_ATOMIC_T_NOT_VOLATILE)
if(NOT HAVE_SIG_ATOMIC_T_NOT_VOLATILE)
set(HAVE_SIG_ATOMIC_T_VOLATILE 1)
endif(NOT HAVE_SIG_ATOMIC_T_NOT_VOLATILE)
endif(HAVE_SIZEOF_SIG_ATOMIC_T)
SET(CHECK_TYPE_SIZE_PREINCLUDE
set(CHECK_TYPE_SIZE_PREINCLUDE
"#undef inline")
IF(HAVE_WINDOWS_H)
SET(CHECK_TYPE_SIZE_PREINCLUDE "${CHECK_TYPE_SIZE_PREINCLUDE}
if(HAVE_WINDOWS_H)
set(CHECK_TYPE_SIZE_PREINCLUDE "${CHECK_TYPE_SIZE_PREINCLUDE}
#ifndef WIN32_LEAN_AND_MEAN
#define WIN32_LEAN_AND_MEAN
#endif
#include <windows.h>")
IF(HAVE_WINSOCK2_H)
SET(CHECK_TYPE_SIZE_PREINCLUDE "${CHECK_TYPE_SIZE_PREINCLUDE}\n#include <winsock2.h>")
ENDIF(HAVE_WINSOCK2_H)
ELSE(HAVE_WINDOWS_H)
IF(HAVE_SYS_SOCKET_H)
SET(CMAKE_EXTRA_INCLUDE_FILES ${CMAKE_EXTRA_INCLUDE_FILES}
if(HAVE_WINSOCK2_H)
set(CHECK_TYPE_SIZE_PREINCLUDE "${CHECK_TYPE_SIZE_PREINCLUDE}\n#include <winsock2.h>")
endif(HAVE_WINSOCK2_H)
else(HAVE_WINDOWS_H)
if(HAVE_SYS_SOCKET_H)
set(CMAKE_EXTRA_INCLUDE_FILES ${CMAKE_EXTRA_INCLUDE_FILES}
"sys/socket.h")
ENDIF(HAVE_SYS_SOCKET_H)
IF(HAVE_NETINET_IN_H)
SET(CMAKE_EXTRA_INCLUDE_FILES ${CMAKE_EXTRA_INCLUDE_FILES}
endif(HAVE_SYS_SOCKET_H)
if(HAVE_NETINET_IN_H)
set(CMAKE_EXTRA_INCLUDE_FILES ${CMAKE_EXTRA_INCLUDE_FILES}
"netinet/in.h")
ENDIF(HAVE_NETINET_IN_H)
IF(HAVE_ARPA_INET_H)
SET(CMAKE_EXTRA_INCLUDE_FILES ${CMAKE_EXTRA_INCLUDE_FILES}
endif(HAVE_NETINET_IN_H)
if(HAVE_ARPA_INET_H)
set(CMAKE_EXTRA_INCLUDE_FILES ${CMAKE_EXTRA_INCLUDE_FILES}
"arpa/inet.h")
ENDIF(HAVE_ARPA_INET_H)
ENDIF(HAVE_WINDOWS_H)
endif(HAVE_ARPA_INET_H)
endif(HAVE_WINDOWS_H)
CHECK_TYPE_SIZE("struct sockaddr_storage" SIZEOF_STRUCT_SOCKADDR_STORAGE)
IF(HAVE_SIZEOF_STRUCT_SOCKADDR_STORAGE)
SET(HAVE_STRUCT_SOCKADDR_STORAGE 1)
ENDIF(HAVE_SIZEOF_STRUCT_SOCKADDR_STORAGE)
check_type_size("struct sockaddr_storage" SIZEOF_STRUCT_SOCKADDR_STORAGE)
if(HAVE_SIZEOF_STRUCT_SOCKADDR_STORAGE)
set(HAVE_STRUCT_SOCKADDR_STORAGE 1)
endif(HAVE_SIZEOF_STRUCT_SOCKADDR_STORAGE)

Просмотреть файл

@ -1,121 +1,121 @@
IF(NOT UNIX)
IF(WIN32)
SET(HAVE_LIBDL 0)
SET(HAVE_LIBUCB 0)
SET(HAVE_LIBSOCKET 0)
SET(NOT_NEED_LIBNSL 0)
SET(HAVE_LIBNSL 0)
SET(HAVE_LIBZ 0)
SET(HAVE_LIBCRYPTO 0)
if(NOT UNIX)
if(WIN32)
set(HAVE_LIBDL 0)
set(HAVE_LIBUCB 0)
set(HAVE_LIBSOCKET 0)
set(NOT_NEED_LIBNSL 0)
set(HAVE_LIBNSL 0)
set(HAVE_LIBZ 0)
set(HAVE_LIBCRYPTO 0)
SET(HAVE_DLOPEN 0)
set(HAVE_DLOPEN 0)
SET(HAVE_ALLOCA_H 0)
SET(HAVE_ARPA_INET_H 0)
SET(HAVE_DLFCN_H 0)
SET(HAVE_FCNTL_H 1)
SET(HAVE_FEATURES_H 0)
SET(HAVE_INTTYPES_H 0)
SET(HAVE_IO_H 1)
SET(HAVE_MALLOC_H 1)
SET(HAVE_MEMORY_H 1)
SET(HAVE_NETDB_H 0)
SET(HAVE_NETINET_IF_ETHER_H 0)
SET(HAVE_NETINET_IN_H 0)
SET(HAVE_NET_IF_H 0)
SET(HAVE_PROCESS_H 1)
SET(HAVE_PWD_H 0)
SET(HAVE_SETJMP_H 1)
SET(HAVE_SGTTY_H 0)
SET(HAVE_SIGNAL_H 1)
SET(HAVE_SOCKIO_H 0)
SET(HAVE_STDINT_H 0)
SET(HAVE_STDLIB_H 1)
SET(HAVE_STRINGS_H 0)
SET(HAVE_STRING_H 1)
SET(HAVE_SYS_PARAM_H 0)
SET(HAVE_SYS_POLL_H 0)
SET(HAVE_SYS_SELECT_H 0)
SET(HAVE_SYS_SOCKET_H 0)
SET(HAVE_SYS_SOCKIO_H 0)
SET(HAVE_SYS_STAT_H 1)
SET(HAVE_SYS_TIME_H 0)
SET(HAVE_SYS_TYPES_H 1)
SET(HAVE_SYS_UTIME_H 1)
SET(HAVE_TERMIOS_H 0)
SET(HAVE_TERMIO_H 0)
SET(HAVE_TIME_H 1)
SET(HAVE_UNISTD_H 0)
SET(HAVE_UTIME_H 0)
SET(HAVE_X509_H 0)
SET(HAVE_ZLIB_H 0)
set(HAVE_ALLOCA_H 0)
set(HAVE_ARPA_INET_H 0)
set(HAVE_DLFCN_H 0)
set(HAVE_FCNTL_H 1)
set(HAVE_FEATURES_H 0)
set(HAVE_INTTYPES_H 0)
set(HAVE_IO_H 1)
set(HAVE_MALLOC_H 1)
set(HAVE_MEMORY_H 1)
set(HAVE_NETDB_H 0)
set(HAVE_NETINET_IF_ETHER_H 0)
set(HAVE_NETINET_IN_H 0)
set(HAVE_NET_IF_H 0)
set(HAVE_PROCESS_H 1)
set(HAVE_PWD_H 0)
set(HAVE_SETJMP_H 1)
set(HAVE_SGTTY_H 0)
set(HAVE_SIGNAL_H 1)
set(HAVE_SOCKIO_H 0)
set(HAVE_STDINT_H 0)
set(HAVE_STDLIB_H 1)
set(HAVE_STRINGS_H 0)
set(HAVE_STRING_H 1)
set(HAVE_SYS_PARAM_H 0)
set(HAVE_SYS_POLL_H 0)
set(HAVE_SYS_SELECT_H 0)
set(HAVE_SYS_SOCKET_H 0)
set(HAVE_SYS_SOCKIO_H 0)
set(HAVE_SYS_STAT_H 1)
set(HAVE_SYS_TIME_H 0)
set(HAVE_SYS_TYPES_H 1)
set(HAVE_SYS_UTIME_H 1)
set(HAVE_TERMIOS_H 0)
set(HAVE_TERMIO_H 0)
set(HAVE_TIME_H 1)
set(HAVE_UNISTD_H 0)
set(HAVE_UTIME_H 0)
set(HAVE_X509_H 0)
set(HAVE_ZLIB_H 0)
SET(HAVE_SIZEOF_LONG_DOUBLE 1)
SET(SIZEOF_LONG_DOUBLE 8)
set(HAVE_SIZEOF_LONG_DOUBLE 1)
set(SIZEOF_LONG_DOUBLE 8)
SET(HAVE_SOCKET 1)
SET(HAVE_POLL 0)
SET(HAVE_SELECT 1)
SET(HAVE_STRDUP 1)
SET(HAVE_STRSTR 1)
SET(HAVE_STRTOK_R 0)
SET(HAVE_STRFTIME 1)
SET(HAVE_UNAME 0)
SET(HAVE_STRCASECMP 0)
SET(HAVE_STRICMP 1)
SET(HAVE_STRCMPI 1)
SET(HAVE_GETHOSTBYADDR 1)
SET(HAVE_GETTIMEOFDAY 0)
SET(HAVE_INET_ADDR 1)
SET(HAVE_INET_NTOA 1)
SET(HAVE_INET_NTOA_R 0)
SET(HAVE_TCGETATTR 0)
SET(HAVE_TCSETATTR 0)
SET(HAVE_PERROR 1)
SET(HAVE_CLOSESOCKET 1)
SET(HAVE_SETVBUF 0)
SET(HAVE_SIGSETJMP 0)
SET(HAVE_GETPASS_R 0)
SET(HAVE_STRLCAT 0)
SET(HAVE_GETPWUID 0)
SET(HAVE_GETEUID 0)
SET(HAVE_UTIME 1)
SET(HAVE_RAND_EGD 0)
SET(HAVE_RAND_SCREEN 0)
SET(HAVE_RAND_STATUS 0)
SET(HAVE_GMTIME_R 0)
SET(HAVE_LOCALTIME_R 0)
SET(HAVE_GETHOSTBYADDR_R 0)
SET(HAVE_GETHOSTBYNAME_R 0)
SET(HAVE_SIGNAL_FUNC 1)
SET(HAVE_SIGNAL_MACRO 0)
set(HAVE_SOCKET 1)
set(HAVE_POLL 0)
set(HAVE_SELECT 1)
set(HAVE_STRDUP 1)
set(HAVE_STRSTR 1)
set(HAVE_STRTOK_R 0)
set(HAVE_STRFTIME 1)
set(HAVE_UNAME 0)
set(HAVE_STRCASECMP 0)
set(HAVE_STRICMP 1)
set(HAVE_STRCMPI 1)
set(HAVE_GETHOSTBYADDR 1)
set(HAVE_GETTIMEOFDAY 0)
set(HAVE_INET_ADDR 1)
set(HAVE_INET_NTOA 1)
set(HAVE_INET_NTOA_R 0)
set(HAVE_TCGETATTR 0)
set(HAVE_TCSETATTR 0)
set(HAVE_PERROR 1)
set(HAVE_CLOSESOCKET 1)
set(HAVE_SETVBUF 0)
set(HAVE_SIGSETJMP 0)
set(HAVE_GETPASS_R 0)
set(HAVE_STRLCAT 0)
set(HAVE_GETPWUID 0)
set(HAVE_GETEUID 0)
set(HAVE_UTIME 1)
set(HAVE_RAND_EGD 0)
set(HAVE_RAND_SCREEN 0)
set(HAVE_RAND_STATUS 0)
set(HAVE_GMTIME_R 0)
set(HAVE_LOCALTIME_R 0)
set(HAVE_GETHOSTBYADDR_R 0)
set(HAVE_GETHOSTBYNAME_R 0)
set(HAVE_SIGNAL_FUNC 1)
set(HAVE_SIGNAL_MACRO 0)
SET(HAVE_GETHOSTBYADDR_R_5 0)
SET(HAVE_GETHOSTBYADDR_R_5_REENTRANT 0)
SET(HAVE_GETHOSTBYADDR_R_7 0)
SET(HAVE_GETHOSTBYADDR_R_7_REENTRANT 0)
SET(HAVE_GETHOSTBYADDR_R_8 0)
SET(HAVE_GETHOSTBYADDR_R_8_REENTRANT 0)
SET(HAVE_GETHOSTBYNAME_R_3 0)
SET(HAVE_GETHOSTBYNAME_R_3_REENTRANT 0)
SET(HAVE_GETHOSTBYNAME_R_5 0)
SET(HAVE_GETHOSTBYNAME_R_5_REENTRANT 0)
SET(HAVE_GETHOSTBYNAME_R_6 0)
SET(HAVE_GETHOSTBYNAME_R_6_REENTRANT 0)
set(HAVE_GETHOSTBYADDR_R_5 0)
set(HAVE_GETHOSTBYADDR_R_5_REENTRANT 0)
set(HAVE_GETHOSTBYADDR_R_7 0)
set(HAVE_GETHOSTBYADDR_R_7_REENTRANT 0)
set(HAVE_GETHOSTBYADDR_R_8 0)
set(HAVE_GETHOSTBYADDR_R_8_REENTRANT 0)
set(HAVE_GETHOSTBYNAME_R_3 0)
set(HAVE_GETHOSTBYNAME_R_3_REENTRANT 0)
set(HAVE_GETHOSTBYNAME_R_5 0)
set(HAVE_GETHOSTBYNAME_R_5_REENTRANT 0)
set(HAVE_GETHOSTBYNAME_R_6 0)
set(HAVE_GETHOSTBYNAME_R_6_REENTRANT 0)
SET(TIME_WITH_SYS_TIME 0)
SET(HAVE_O_NONBLOCK 0)
SET(HAVE_IN_ADDR_T 0)
SET(HAVE_INET_NTOA_R_DECL 0)
SET(HAVE_INET_NTOA_R_DECL_REENTRANT 0)
SET(HAVE_GETADDRINFO 0)
SET(STDC_HEADERS 1)
SET(RETSIGTYPE_TEST 1)
set(TIME_WITH_SYS_TIME 0)
set(HAVE_O_NONBLOCK 0)
set(HAVE_IN_ADDR_T 0)
set(HAVE_INET_NTOA_R_DECL 0)
set(HAVE_INET_NTOA_R_DECL_REENTRANT 0)
set(HAVE_GETADDRINFO 0)
set(STDC_HEADERS 1)
set(RETSIGTYPE_TEST 1)
SET(HAVE_SIGACTION 0)
SET(HAVE_MACRO_SIGSETJMP 0)
ELSE(WIN32)
MESSAGE("This file should be included on Windows platform only")
ENDIF(WIN32)
ENDIF(NOT UNIX)
set(HAVE_SIGACTION 0)
set(HAVE_MACRO_SIGSETJMP 0)
else(WIN32)
message("This file should be included on Windows platform only")
endif(WIN32)
endif(NOT UNIX)

Просмотреть файл

@ -1,31 +1,31 @@
# File containing various utilities
# Converts a CMake list to a string containing elements separated by spaces
FUNCTION(TO_LIST_SPACES _LIST_NAME OUTPUT_VAR)
SET(NEW_LIST_SPACE)
FOREACH(ITEM ${${_LIST_NAME}})
SET(NEW_LIST_SPACE "${NEW_LIST_SPACE} ${ITEM}")
ENDFOREACH()
STRING(STRIP ${NEW_LIST_SPACE} NEW_LIST_SPACE)
SET(${OUTPUT_VAR} "${NEW_LIST_SPACE}" PARENT_SCOPE)
ENDFUNCTION()
function(TO_LIST_SPACES _LIST_NAME OUTPUT_VAR)
set(NEW_LIST_SPACE)
foreach(ITEM ${${_LIST_NAME}})
set(NEW_LIST_SPACE "${NEW_LIST_SPACE} ${ITEM}")
endforeach()
string(STRIP ${NEW_LIST_SPACE} NEW_LIST_SPACE)
set(${OUTPUT_VAR} "${NEW_LIST_SPACE}" PARENT_SCOPE)
endfunction()
# Appends a lis of item to a string which is a space-separated list, if they don't already exist.
FUNCTION(LIST_SPACES_APPEND_ONCE LIST_NAME)
STRING(REPLACE " " ";" _LIST ${${LIST_NAME}})
LIST(APPEND _LIST ${ARGN})
LIST(REMOVE_DUPLICATES _LIST)
TO_LIST_SPACES(_LIST NEW_LIST_SPACE)
SET(${LIST_NAME} "${NEW_LIST_SPACE}" PARENT_SCOPE)
ENDFUNCTION()
function(LIST_SPACES_APPEND_ONCE LIST_NAME)
string(REPLACE " " ";" _LIST ${${LIST_NAME}})
list(APPEND _LIST ${ARGN})
list(REMOVE_DUPLICATES _LIST)
to_list_spaces(_LIST NEW_LIST_SPACE)
set(${LIST_NAME} "${NEW_LIST_SPACE}" PARENT_SCOPE)
endfunction()
# Convinience function that does the same as LIST(FIND ...) but with a TRUE/FALSE return value.
# Ex: IN_STR_LIST(MY_LIST "Searched item" WAS_FOUND)
FUNCTION(IN_STR_LIST LIST_NAME ITEM_SEARCHED RETVAL)
LIST(FIND ${LIST_NAME} ${ITEM_SEARCHED} FIND_POS)
IF(${FIND_POS} EQUAL -1)
SET(${RETVAL} FALSE PARENT_SCOPE)
ELSE()
SET(${RETVAL} TRUE PARENT_SCOPE)
ENDIF()
ENDFUNCTION()
function(IN_STR_LIST LIST_NAME ITEM_SEARCHED RETVAL)
list(FIND ${LIST_NAME} ${ITEM_SEARCHED} FIND_POS)
if(${FIND_POS} EQUAL -1)
set(${RETVAL} FALSE PARENT_SCOPE)
else()
set(${RETVAL} TRUE PARENT_SCOPE)
endif()
endfunction()

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Просмотреть файл

@ -1,56 +1,56 @@
SET(LIB_NAME libcurl)
set(LIB_NAME libcurl)
CONFIGURE_FILE(${CURL_SOURCE_DIR}/include/curl/curlbuild.h.cmake
configure_file(${CURL_SOURCE_DIR}/include/curl/curlbuild.h.cmake
${CURL_BINARY_DIR}/include/curl/curlbuild.h)
CONFIGURE_FILE(config.h.cmake
configure_file(config.h.cmake
${CMAKE_CURRENT_BINARY_DIR}/config.h)
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)
LIST(APPEND HHEADERS
${CMAKE_CURRENT_BINARY_DIR}/config.h
${CURL_BINARY_DIR}/include/curl/curlbuild.h
)
list(APPEND HHEADERS
${CMAKE_CURRENT_BINARY_DIR}/config.h
${CURL_BINARY_DIR}/include/curl/curlbuild.h
)
IF(MSVC)
LIST(APPEND CSOURCES libcurl.rc)
ENDIF()
if(MSVC)
list(APPEND CSOURCES libcurl.rc)
endif()
# SET(CSOURCES
# # memdebug.c -not used
# # nwlib.c - Not used
# # strtok.c - specify later
# # strtoofft.c - specify later
# # memdebug.c -not used
# # nwlib.c - Not used
# # strtok.c - specify later
# # strtoofft.c - specify later
# )
# # if we have Kerberos 4, right now this is never on
# #OPTION(CURL_KRB4 "Use Kerberos 4" OFF)
# IF(CURL_KRB4)
# SET(CSOURCES ${CSOURCES}
# krb4.c
# security.c
# )
# SET(CSOURCES ${CSOURCES}
# krb4.c
# security.c
# )
# ENDIF(CURL_KRB4)
# #OPTION(CURL_MALLOC_DEBUG "Debug mallocs in Curl" OFF)
# MARK_AS_ADVANCED(CURL_MALLOC_DEBUG)
# IF(CURL_MALLOC_DEBUG)
# SET(CSOURCES ${CSOURCES}
# memdebug.c
# )
# SET(CSOURCES ${CSOURCES}
# memdebug.c
# )
# ENDIF(CURL_MALLOC_DEBUG)
# # only build compat strtoofft if we need to
# IF(NOT HAVE_STRTOLL AND NOT HAVE__STRTOI64)
# SET(CSOURCES ${CSOURCES}
# strtoofft.c
# )
# SET(CSOURCES ${CSOURCES}
# strtoofft.c
# )
# ENDIF(NOT HAVE_STRTOLL AND NOT HAVE__STRTOI64)
IF(HAVE_FEATURES_H)
SET_SOURCE_FILES_PROPERTIES(
if(HAVE_FEATURES_H)
set_source_files_properties(
cookie.c
easy.c
formdata.c
@ -65,57 +65,57 @@ IF(HAVE_FEATURES_H)
transfer.c
url.c
COMPILE_FLAGS -D_BSD_SOURCE)
ENDIF(HAVE_FEATURES_H)
endif(HAVE_FEATURES_H)
# The rest of the build
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}/../include)
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/..)
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/../include)
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}/..)
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR})
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR})
include_directories(${CMAKE_CURRENT_BINARY_DIR}/../include)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/..)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../include)
include_directories(${CMAKE_CURRENT_BINARY_DIR}/..)
include_directories(${CMAKE_CURRENT_SOURCE_DIR})
include_directories(${CMAKE_CURRENT_BINARY_DIR})
IF(CURL_STATICLIB)
# Static lib
SET(CURL_USER_DEFINED_DYNAMIC_OR_STATIC STATIC)
ELSE()
# DLL / so dynamic lib
SET(CURL_USER_DEFINED_DYNAMIC_OR_STATIC SHARED)
ENDIF()
if(CURL_STATICLIB)
# Static lib
set(CURL_USER_DEFINED_DYNAMIC_OR_STATIC STATIC)
else()
# DLL / so dynamic lib
set(CURL_USER_DEFINED_DYNAMIC_OR_STATIC SHARED)
endif()
ADD_LIBRARY(
${LIB_NAME}
${CURL_USER_DEFINED_DYNAMIC_OR_STATIC}
${HHEADERS} ${CSOURCES}
)
add_library(
${LIB_NAME}
${CURL_USER_DEFINED_DYNAMIC_OR_STATIC}
${HHEADERS} ${CSOURCES}
)
TARGET_LINK_LIBRARIES(${LIB_NAME} ${CURL_LIBS})
target_link_libraries(${LIB_NAME} ${CURL_LIBS})
IF(WIN32)
ADD_DEFINITIONS( -D_USRDLL )
ENDIF()
if(WIN32)
add_definitions( -D_USRDLL )
endif()
SET_TARGET_PROPERTIES(${LIB_NAME} PROPERTIES COMPILE_DEFINITIONS BUILDING_LIBCURL)
set_target_properties(${LIB_NAME} PROPERTIES COMPILE_DEFINITIONS BUILDING_LIBCURL)
SETUP_CURL_DEPENDENCIES(${LIB_NAME})
setup_curl_dependencies(${LIB_NAME})
# Remove the "lib" prefix since the library is already named "libcurl".
SET_TARGET_PROPERTIES(${LIB_NAME} PROPERTIES PREFIX "")
SET_TARGET_PROPERTIES(${LIB_NAME} PROPERTIES IMPORT_PREFIX "")
set_target_properties(${LIB_NAME} PROPERTIES PREFIX "")
set_target_properties(${LIB_NAME} PROPERTIES IMPORT_PREFIX "")
IF(MSVC)
IF(NOT BUILD_RELEASE_DEBUG_DIRS)
# Ugly workaround to remove the "/debug" or "/release" in each output
SET_TARGET_PROPERTIES(${LIB_NAME} PROPERTIES PREFIX "../")
SET_TARGET_PROPERTIES(${LIB_NAME} PROPERTIES IMPORT_PREFIX "../")
ENDIF()
ENDIF()
if(MSVC)
if(NOT BUILD_RELEASE_DEBUG_DIRS)
# Ugly workaround to remove the "/debug" or "/release" in each output
set_target_properties(${LIB_NAME} PROPERTIES PREFIX "../")
set_target_properties(${LIB_NAME} PROPERTIES IMPORT_PREFIX "../")
endif()
endif()
IF(WIN32)
IF(NOT CURL_STATICLIB)
# Add "_imp" as a suffix before the extension to avoid conflicting with the statically linked "libcurl.lib"
SET_TARGET_PROPERTIES(${LIB_NAME} PROPERTIES IMPORT_SUFFIX "_imp.lib")
ENDIF()
ENDIF()
if(WIN32)
if(NOT CURL_STATICLIB)
# Add "_imp" as a suffix before the extension to avoid conflicting with the statically linked "libcurl.lib"
set_target_properties(${LIB_NAME} PROPERTIES IMPORT_SUFFIX "_imp.lib")
endif()
endif()

Просмотреть файл

@ -1,39 +1,39 @@
SET(EXE_NAME curl)
set(EXE_NAME curl)
# First try to locate hugehelp.c to see if it has already been created
# TODO Find the file WITHOUT adding a cache entry!!! Or else the user can delete the file after the script was first run, and the script won't notice it has gone.
FIND_FILE(HUGEHELP_C_FILE hugehelp.c PATHS . NO_DEFAULT_PATH)
IF (NOT HUGEHELP_C_FILE)
MESSAGE(STATUS "Warning: hugehelp.c file was not generated before. Generating an 'empty' file...")
FILE(WRITE hugehelp.c "/* built-in manual is disabled, blank function */\n#include \"hugehelp.h\"\nvoid hugehelp(void) {}\n\n")
ENDIF()
find_file(HUGEHELP_C_FILE hugehelp.c PATHS . NO_DEFAULT_PATH)
if (NOT HUGEHELP_C_FILE)
message(STATUS "Warning: hugehelp.c file was not generated before. Generating an 'empty' file...")
file(WRITE hugehelp.c "/* built-in manual is disabled, blank function */\n#include \"hugehelp.h\"\nvoid hugehelp(void) {}\n\n")
endif()
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)
IF(MSVC)
LIST(APPEND CURL_SOURCE curl.rc)
ENDIF()
if(MSVC)
list(APPEND CURL_SOURCE curl.rc)
endif()
ADD_EXECUTABLE(
${EXE_NAME}
${curl_SOURCES}
)
add_executable(
${EXE_NAME}
${curl_SOURCES}
)
SOURCE_GROUP("cURLX source files" FILES ${CURLX_ONES})
SOURCE_GROUP("cURL source files" FILES ${CURL_SOURCES})
SOURCE_GROUP("cURL header files" FILES ${CURL_HFILES})
source_group("cURLX source files" FILES ${CURLX_ONES})
source_group("cURL source files" FILES ${CURL_SOURCES})
source_group("cURL header files" FILES ${CURL_HFILES})
INCLUDE_DIRECTORIES(
${CURL_SOURCE_DIR}/lib # To be able to reach "setup_once.h"
${CURL_BINARY_DIR}/lib # To be able to reach "config.h"
${CURL_BINARY_DIR}/include # To be able to reach "curl/curlbuild.h"
)
include_directories(
${CURL_SOURCE_DIR}/lib # To be able to reach "setup_once.h"
${CURL_BINARY_DIR}/lib # To be able to reach "config.h"
${CURL_BINARY_DIR}/include # To be able to reach "curl/curlbuild.h"
)
# Setup dependencies
SETUP_CURL_DEPENDENCIES(${EXE_NAME})
TARGET_LINK_LIBRARIES( ${EXE_NAME} libcurl )
setup_curl_dependencies(${EXE_NAME})
target_link_libraries( ${EXE_NAME} libcurl )
################################################################################
@ -43,13 +43,14 @@ TARGET_LINK_LIBRARIES( ${EXE_NAME} libcurl )
#SET_TARGET_PROPERTIES(${EXE_NAME} LIBRARY_OUTPUT_DIRECTORY "blah blah blah")
# Add the postfix to the executable since it is not added automatically as for modules and shared libraries
SET_TARGET_PROPERTIES(${EXE_NAME} PROPERTIES DEBUG_POSTFIX "${CMAKE_DEBUG_POSTFIX}")
set_target_properties(${EXE_NAME} PROPERTIES
DEBUG_POSTFIX "${CMAKE_DEBUG_POSTFIX}")
IF(MSVC)
IF(NOT BUILD_RELEASE_DEBUG_DIRS)
# Ugly workaround to remove the "/debug" or "/release" in each output
SET_TARGET_PROPERTIES(${EXE_NAME} PROPERTIES PREFIX "../")
ENDIF()
ENDIF()
if(MSVC)
if(NOT BUILD_RELEASE_DEBUG_DIRS)
# Ugly workaround to remove the "/debug" or "/release" in each output
set_target_properties(${EXE_NAME} PROPERTIES PREFIX "../")
endif()
endif()
#INCLUDE(ModuleInstall OPTIONAL)

Просмотреть файл

@ -1,2 +1,2 @@
ADD_SUBDIRECTORY(libtest)
ADD_SUBDIRECTORY(server)
add_subdirectory(libtest)
add_subdirectory(server)

Просмотреть файл

@ -1,41 +1,45 @@
SET(TARGET_LABEL_PREFIX "Test ")
set(TARGET_LABEL_PREFIX "Test ")
FUNCTION(SETUP_TEST TEST_NAME) # ARGN are the files in the test
ADD_EXECUTABLE( ${TEST_NAME} ${ARGN} )
STRING(TOUPPER ${TEST_NAME} UPPER_TEST_NAME)
function(SETUP_TEST TEST_NAME) # ARGN are the files in the test
add_executable( ${TEST_NAME} ${ARGN} )
string(TOUPPER ${TEST_NAME} UPPER_TEST_NAME)
INCLUDE_DIRECTORIES(
${CURL_SOURCE_DIR}/lib # To be able to reach "setup_once.h"
${CURL_BINARY_DIR}/lib # To be able to reach "config.h"
${CURL_BINARY_DIR}/include # To be able to reach "curl/curlbuild.h"
)
include_directories(
${CURL_SOURCE_DIR}/lib # To be able to reach "setup_once.h"
${CURL_BINARY_DIR}/lib # To be able to reach "config.h"
${CURL_BINARY_DIR}/include # To be able to reach "curl/curlbuild.h"
)
SETUP_CURL_DEPENDENCIES(${TEST_NAME})
TARGET_LINK_LIBRARIES( ${TEST_NAME} libcurl )
setup_curl_dependencies(${TEST_NAME})
target_link_libraries( ${TEST_NAME} libcurl )
SET_TARGET_PROPERTIES(${TEST_NAME} PROPERTIES COMPILE_DEFINITIONS ${UPPER_TEST_NAME})
SET_TARGET_PROPERTIES(${TEST_NAME} PROPERTIES PROJECT_LABEL "${TARGET_LABEL_PREFIX}${TEST_NAME}")
set_target_properties(${TEST_NAME}
PROPERTIES COMPILE_DEFINITIONS ${UPPER_TEST_NAME})
set_target_properties(${TEST_NAME}
PROPERTIES PROJECT_LABEL "${TARGET_LABEL_PREFIX}${TEST_NAME}")
# Add the postfix to the executable since it is not added automatically as for modules and shared libraries
SET_TARGET_PROPERTIES(${TEST_NAME} PROPERTIES DEBUG_POSTFIX "${CMAKE_DEBUG_POSTFIX}")
# Add the postfix to the executable since it is
# not added automatically as for modules and shared libraries
set_target_properties(${TEST_NAME}
PROPERTIES DEBUG_POSTFIX "${CMAKE_DEBUG_POSTFIX}")
IF(MSVC)
IF(NOT BUILD_RELEASE_DEBUG_DIRS)
# Ugly workaround to remove the "/debug" or "/release" in each output
SET_TARGET_PROPERTIES(${TEST_NAME} PROPERTIES PREFIX "../")
SET_TARGET_PROPERTIES(${TEST_NAME} PROPERTIES IMPORT_PREFIX "../")
ENDIF()
ENDIF()
if(MSVC)
if(NOT BUILD_RELEASE_DEBUG_DIRS)
# Ugly workaround to remove the "/debug" or "/release" in each output
set_target_properties(${TEST_NAME} PROPERTIES PREFIX "../")
set_target_properties(${TEST_NAME} PROPERTIES IMPORT_PREFIX "../")
endif()
endif()
ENDFUNCTION()
endfunction()
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(TEST_NAME ${noinst_PROGRAMS})
SETUP_TEST(${TEST_NAME} ${${TEST_NAME}_SOURCES})
ENDFOREACH()
foreach(TEST_NAME ${noinst_PROGRAMS})
setup_test(${TEST_NAME} ${${TEST_NAME}_SOURCES})
endforeach()
# # files used only in some libcurl test programs
@ -46,47 +50,47 @@ ENDFOREACH()
# # These are all libcurl test programs
# SET(noinst_PROGRAMS
# lib500 lib501 lib502 lib503 lib504 lib505 lib506
# lib507 lib508 lib510 lib511 lib512 lib513 lib514 lib515 lib516
# lib517 lib518 lib519 lib520 lib521 lib523 lib524 lib525 lib526
# #lib527
# #lib529
# lib530
# #lib532
# lib533 lib536 lib537 lib540 lib541 lib542 lib543
# lib544
# #lib545
# lib547
# #lib548
# lib549 lib552 lib553 lib554 lib555 lib556
# lib539 lib557 lib558
# #lib559
# lib560
# lib500 lib501 lib502 lib503 lib504 lib505 lib506
# lib507 lib508 lib510 lib511 lib512 lib513 lib514 lib515 lib516
# lib517 lib518 lib519 lib520 lib521 lib523 lib524 lib525 lib526
# #lib527
# #lib529
# lib530
# #lib532
# lib533 lib536 lib537 lib540 lib541 lib542 lib543
# lib544
# #lib545
# lib547
# #lib548
# lib549 lib552 lib553 lib554 lib555 lib556
# lib539 lib557 lib558
# #lib559
# lib560
# )
# SET(noinst_PROGRAMS_USE_TESTUTIL
# lib502 lib503 lib504
# lib507
# lib525 lib526 lib527
# lib529
# lib530
# lib532
# lib533 lib536
# lib555
# lib502 lib503 lib504
# lib507
# lib525 lib526 lib527
# lib529
# lib530
# lib532
# lib533 lib536
# lib555
# )
# MACRO(ADD_TESTUTIL_IF_NECESSARY TEST_NAME)
# LIST(FIND noinst_PROGRAMS_USE_TESTUTIL ${TEST_NAME} USES_TESTUTIL)
# IF(NOT ${USES_TESTUTIL} EQUAL -1)
# LIST(APPEND SOURCE ${TESTUTIL}) # Need TestUtil
# ENDIF()
# LIST(FIND noinst_PROGRAMS_USE_TESTUTIL ${TEST_NAME} USES_TESTUTIL)
# IF(NOT ${USES_TESTUTIL} EQUAL -1)
# LIST(APPEND SOURCE ${TESTUTIL}) # Need TestUtil
# ENDIF()
# ENDMACRO()
# # General case
# FOREACH(TEST_NAME ${noinst_PROGRAMS})
# SET(SOURCE "${TEST_NAME}.c" ${SUPPORTFILES})
# ADD_TESTUTIL_IF_NECESSARY(${TEST_NAME})
# SETUP_TEST(${TEST_NAME} ${SOURCE})
# SET(SOURCE "${TEST_NAME}.c" ${SUPPORTFILES})
# ADD_TESTUTIL_IF_NECESSARY(${TEST_NAME})
# SETUP_TEST(${TEST_NAME} ${SOURCE})
# ENDFOREACH()
# # Special cases

Просмотреть файл

@ -1,58 +1,63 @@
SET(TARGET_LABEL_PREFIX "Test server ")
set(TARGET_LABEL_PREFIX "Test server ")
FUNCTION(SETUP_EXECUTABLE TEST_NAME) # ARGN are the files in the test
ADD_EXECUTABLE( ${TEST_NAME} ${ARGN} )
STRING(TOUPPER ${TEST_NAME} UPPER_TEST_NAME)
function(SETUP_EXECUTABLE TEST_NAME) # ARGN are the files in the test
add_executable( ${TEST_NAME} ${ARGN} )
string(TOUPPER ${TEST_NAME} UPPER_TEST_NAME)
INCLUDE_DIRECTORIES(
${CURL_SOURCE_DIR}/lib # To be able to reach "setup_once.h"
${CURL_BINARY_DIR}/lib # To be able to reach "config.h"
${CURL_BINARY_DIR}/include # To be able to reach "curl/curlbuild.h"
)
include_directories(
${CURL_SOURCE_DIR}/lib # To be able to reach "setup_once.h"
${CURL_BINARY_DIR}/lib # To be able to reach "config.h"
${CURL_BINARY_DIR}/include # To be able to reach "curl/curlbuild.h"
)
SETUP_CURL_DEPENDENCIES(${TEST_NAME})
#TARGET_LINK_LIBRARIES( ${TEST_NAME} libcurl )
setup_curl_dependencies(${TEST_NAME})
#TARGET_LINK_LIBRARIES( ${TEST_NAME} libcurl )
# Test servers simply are standalone programs that do not use libcurl
# library. For convinience and to ease portability of these servers,
# some source code files from the libcurl subdirectory are also used
# to build the servers. In order to achieve proper linkage of these
# files on Win32 targets it is necessary to build the test servers
# with CURL_STATICLIB defined, independently of how libcurl is built.
IF(NOT CURL_STATICLIB)
SET_TARGET_PROPERTIES(${TEST_NAME} PROPERTIES COMPILE_DEFINITIONS CURL_STATICLIB) # ${UPPER_TEST_NAME}
ENDIF()
SET_TARGET_PROPERTIES(${TEST_NAME} PROPERTIES PROJECT_LABEL "${TARGET_LABEL_PREFIX}${TEST_NAME}")
# Test servers simply are standalone programs that do not use libcurl
# library. For convinience and to ease portability of these servers,
# some source code files from the libcurl subdirectory are also used
# to build the servers. In order to achieve proper linkage of these
# files on Win32 targets it is necessary to build the test servers
# with CURL_STATICLIB defined, independently of how libcurl is built.
if(NOT CURL_STATICLIB)
set_target_properties(${TEST_NAME} PROPERTIES
COMPILE_DEFINITIONS CURL_STATICLIB) # ${UPPER_TEST_NAME}
endif()
set_target_properties(${TEST_NAME} PROPERTIES
PROJECT_LABEL "${TARGET_LABEL_PREFIX}${TEST_NAME}")
# Add the postfix to the executable since it is not added automatically as for modules and shared libraries
SET_TARGET_PROPERTIES(${TEST_NAME} PROPERTIES DEBUG_POSTFIX "${CMAKE_DEBUG_POSTFIX}")
# Add the postfix to the executable since it is not added
# automatically as for modules and shared libraries
set_target_properties(${TEST_NAME} PROPERTIES
DEBUG_POSTFIX "${CMAKE_DEBUG_POSTFIX}")
IF(MSVC)
IF(NOT BUILD_RELEASE_DEBUG_DIRS)
# Ugly workaround to remove the "/debug" or "/release" in each output
SET_TARGET_PROPERTIES(${TEST_NAME} PROPERTIES PREFIX "../")
SET_TARGET_PROPERTIES(${TEST_NAME} PROPERTIES IMPORT_PREFIX "../")
ENDIF()
ENDIF()
if(MSVC)
if(NOT BUILD_RELEASE_DEBUG_DIRS)
# Ugly workaround to remove the "/debug" or "/release" in each output
set_target_properties(${TEST_NAME} PROPERTIES PREFIX "../")
set_target_properties(${TEST_NAME} PROPERTIES IMPORT_PREFIX "../")
endif()
endif()
ENDFUNCTION()
endfunction()
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(EXECUTABLE_NAME ${noinst_PROGRAMS})
SETUP_EXECUTABLE(${EXECUTABLE_NAME} ${${EXECUTABLE_NAME}_SOURCES})
ENDFOREACH()
foreach(EXECUTABLE_NAME ${noinst_PROGRAMS})
setup_executable(${EXECUTABLE_NAME} ${${EXECUTABLE_NAME}_SOURCES})
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
# 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})