aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CMakeLists.txt245
1 files changed, 130 insertions, 115 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 2efaeee99..023e2e1f8 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -9,9 +9,9 @@
# Check on all possible platforms
# Test with as many configurations possible (With or without any option)
# Create scripts that help keeping the CMake build system up to date (to reduce maintenance). According to Tetetest:
-# - lists of headers that 'configure' checks for;
-# - curl-specific tests (the ones that are in m4/curl-*.m4 files);
-# - (most obvious thing:) curl version numbers.
+# - lists of headers that 'configure' checks for;
+# - curl-specific tests (the ones that are in m4/curl-*.m4 files);
+# - (most obvious thing:) curl version numbers.
# Add documentation subproject
#
# To check:
@@ -21,12 +21,31 @@
CMAKE_MINIMUM_REQUIRED(VERSION 2.6.2 FATAL_ERROR)
SET(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/CMake;${CMAKE_MODULE_PATH}")
+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()
+
+
project( CURL C )
SET(CURL_MAJOR_VERSION 7)
SET(CURL_MINOR_VERSION 19)
SET(CURL_PATCH_VERSION 4)
-INCLUDE_REGULAR_EXPRESSION("^.*$") # Sukender: Is it necessary?
+INCLUDE_REGULAR_EXPRESSION("^.*$") # Sukender: Is it necessary?
# Setup package meta-data
# SET(PACKAGE "curl")
@@ -45,14 +64,8 @@ SET(OS "\"${CMAKE_SYSTEM_NAME}\"")
# ENDIF()
INCLUDE_DIRECTORIES( ${CURL_SOURCE_DIR}/include )
-# Save C and CXX STD libs (we may need to modify them)
-IF(NOT CURL_CONFIG_HAS_BEEN_RUN_BEFORE)
- SET(CMAKE_CXX_STANDARD_LIBRARIES_INITIAL ${CMAKE_CXX_STANDARD_LIBRARIES} CACHE INTERNAL "Initial C++ libs")
- SET(CMAKE_C_STANDARD_LIBRARIES_INITIAL ${CMAKE_C_STANDARD_LIBRARIES} CACHE INTERNAL "Initial C libs")
-ENDIF()
-
IF(WIN32)
- SET(NATIVE_WINDOWS ON)
+ SET(NATIVE_WINDOWS ON)
ENDIF()
OPTION(BUILD_CURL_EXE "Set to ON to build cURL executable." ON)
@@ -66,16 +79,16 @@ IF(BUILD_DASHBOARD_REPORTS)
ENDIF(BUILD_DASHBOARD_REPORTS)
IF(MSVC)
- OPTION(BUILD_RELEASE_DEBUG_DIRS "Set OFF to build each configuration to a separate directory" OFF)
- MARK_AS_ADVANCED(BUILD_RELEASE_DEBUG_DIRS)
+ OPTION(BUILD_RELEASE_DEBUG_DIRS "Set OFF to build each configuration to a separate directory" OFF)
+ MARK_AS_ADVANCED(BUILD_RELEASE_DEBUG_DIRS)
ENDIF()
-OPTION(CURL_HIDDEN_SYMBOLS "Set to ON to hide libcurl internal symbols (=hide all symbols that aren't officially external)." OFF)
+OPTION(CURL_HIDDEN_SYMBOLS "Set to ON to hide libcurl internal symbols (=hide all symbols that aren't officially external)." ON)
MARK_AS_ADVANCED(CURL_HIDDEN_SYMBOLS)
# IF(WIN32)
- # OPTION(CURL_WINDOWS_SSPI "Use windows libraries to allow NTLM authentication without openssl" ON)
- # MARK_AS_ADVANCED(CURL_WINDOWS_SSPI)
+ # OPTION(CURL_WINDOWS_SSPI "Use windows libraries to allow NTLM authentication without openssl" ON)
+ # MARK_AS_ADVANCED(CURL_WINDOWS_SSPI)
# ENDIF()
OPTION(HTTP_ONLY "disables all protocols except HTTP (This overrides all CURL_DISABLE_* options)" OFF)
@@ -98,22 +111,22 @@ MARK_AS_ADVANCED(CURL_DISABLE_HTTP)
OPTION(CURL_DISABLE_LDAPS "to disable LDAPS" OFF)
MARK_AS_ADVANCED(CURL_DISABLE_LDAPS)
IF(WIN32)
- SET(CURL_LDAP_HYBRID OFF)
- OPTION(CURL_LDAP_WIN "Use W$ LDAP implementation" ON)
- MARK_AS_ADVANCED(CURL_LDAP_WIN)
+ SET(CURL_LDAP_HYBRID OFF)
+ OPTION(CURL_LDAP_WIN "Use W$ LDAP implementation" ON)
+ MARK_AS_ADVANCED(CURL_LDAP_WIN)
ELSE()
- OPTION(CURL_LDAP_HYBRID "W$ LDAP with non-W$ compiler" OFF)
- MARK_AS_ADVANCED(CURL_LDAP_HYBRID)
- SET(CURL_LDAP_WIN OFF)
+ OPTION(CURL_LDAP_HYBRID "W$ LDAP with non-W$ compiler" OFF)
+ MARK_AS_ADVANCED(CURL_LDAP_HYBRID)
+ SET(CURL_LDAP_WIN OFF)
ENDIF()
IF(HTTP_ONLY)
- SET(CURL_DISABLE_FTP ON)
- SET(CURL_DISABLE_LDAP ON)
- SET(CURL_DISABLE_TELNET ON)
- SET(CURL_DISABLE_DICT ON)
- SET(CURL_DISABLE_FILE ON)
- SET(CURL_DISABLE_TFTP ON)
+ SET(CURL_DISABLE_FTP ON)
+ SET(CURL_DISABLE_LDAP ON)
+ SET(CURL_DISABLE_TELNET ON)
+ SET(CURL_DISABLE_DICT ON)
+ SET(CURL_DISABLE_FILE ON)
+ SET(CURL_DISABLE_TFTP ON)
ENDIF()
OPTION(CURL_DISABLE_COOKIES "to disable cookies support" OFF)
@@ -130,15 +143,17 @@ MARK_AS_ADVANCED(ENABLE_IPV6)
IF(WIN32)
- IF(CURL_DISABLE_LDAP)
- #SET(CMAKE_CXX_STANDARD_LIBRARIES "${CMAKE_CXX_STANDARD_LIBRARIES} wsock32.lib bufferoverflowu.lib ws2_32.lib" CACHE STRING "" FORCE)
- #SET(CMAKE_C_STANDARD_LIBRARIES "${CMAKE_C_STANDARD_LIBRARIES_INITIAL} wsock32.lib bufferoverflowu.lib ws2_32.lib" CACHE STRING "" FORCE)
- SET(CMAKE_C_STANDARD_LIBRARIES "${CMAKE_C_STANDARD_LIBRARIES_INITIAL} wsock32.lib ws2_32.lib" CACHE STRING "" FORCE)
- ELSE()
- #SET(CMAKE_CXX_STANDARD_LIBRARIES "${CMAKE_CXX_STANDARD_LIBRARIES} wsock32.lib bufferoverflowu.lib ws2_32.lib wldap32.lib" CACHE STRING "" FORCE)
- #SET(CMAKE_C_STANDARD_LIBRARIES "${CMAKE_C_STANDARD_LIBRARIES_INITIAL} wsock32.lib bufferoverflowu.lib ws2_32.lib wldap32.lib" CACHE STRING "" FORCE)
- SET(CMAKE_C_STANDARD_LIBRARIES "${CMAKE_C_STANDARD_LIBRARIES_INITIAL} wsock32.lib ws2_32.lib wldap32.lib" CACHE STRING "" FORCE)
- ENDIF()
+ LIST_SPACES_APPEND_ONCE(CMAKE_C_STANDARD_LIBRARIES wsock32.lib ws2_32.lib) # bufferoverflowu.lib
+ IF(CURL_DISABLE_LDAP)
+ # Remove wldap32.lib from space-separated list
+ STRING(REPLACE " " ";" _LIST ${CMAKE_C_STANDARD_LIBRARIES})
+ LIST(REMOVE_ITEM _LIST "wldap32.lib")
+ TO_LIST_SPACES(_LIST CMAKE_C_STANDARD_LIBRARIES)
+ ELSE()
+ # Append wldap32.lib
+ LIST_SPACES_APPEND_ONCE(CMAKE_C_STANDARD_LIBRARIES wldap32.lib)
+ ENDIF()
+ SET(CMAKE_C_STANDARD_LIBRARIES "${CMAKE_C_STANDARD_LIBRARIES}" CACHE STRING "" FORCE)
ENDIF()
@@ -213,12 +228,12 @@ OPTION(CMAKE_USE_OPENSSL "Use OpenSSL code. Experimental" ON)
MARK_AS_ADVANCED(CMAKE_USE_OPENSSL)
IF(CMAKE_USE_OPENSSL)
IF(WIN32)
- FIND_PACKAGE(OpenSSL)
- IF(OPENSSL_FOUND)
- SET(USE_SSLEAY TRUE)
- SET(USE_OPENSSL TRUE)
- LIST(APPEND CURL_LIBS ${OPENSSL_LIBRARIES} )
- ENDIF()
+ FIND_PACKAGE(OpenSSL)
+ IF(OPENSSL_FOUND)
+ SET(USE_SSLEAY TRUE)
+ SET(USE_OPENSSL TRUE)
+ LIST(APPEND CURL_LIBS ${OPENSSL_LIBRARIES} )
+ ENDIF()
#FIND_LIBRARY(LIBEAY NAMES libeay32)
#LIST(APPEND CURL_LIBS ${LIBEAY} )
ELSE(WIN32)
@@ -246,13 +261,13 @@ OPTION(CURL_ZLIB "Set to ON to enable building cURL with zlib support." ON)
SET(HAVE_LIBZ OFF)
SET(HAVE_ZLIB_H OFF)
SET(HAVE_ZLIB OFF)
-IF(CURL_ZLIB) # AND CURL_CONFIG_HAS_BEEN_RUN_BEFORE
- FIND_PACKAGE(ZLIB)
- IF(ZLIB_FOUND)
- SET(HAVE_ZLIB_H ON)
- SET(HAVE_ZLIB ON)
- SET(HAVE_LIBZ ON)
- ENDIF()
+IF(CURL_ZLIB) # AND CURL_CONFIG_HAS_BEEN_RUN_BEFORE
+ FIND_PACKAGE(ZLIB)
+ IF(ZLIB_FOUND)
+ SET(HAVE_ZLIB_H ON)
+ SET(HAVE_ZLIB ON)
+ SET(HAVE_LIBZ ON)
+ ENDIF()
ENDIF()
# If we have features.h, then do the _BSD_SOURCE magic
@@ -477,8 +492,8 @@ IF(CMAKE_USE_OPENSSL)
CHECK_SYMBOL_EXISTS(CRYPTO_cleanup_all_ex_data "${CURL_INCLUDES}"
HAVE_CRYPTO_CLEANUP_ALL_EX_DATA)
IF(HAVE_LIBCRYPTO AND HAVE_LIBSSL)
- SET(USE_OPENSSL 1)
- SET(USE_SSLEAY 1)
+ SET(USE_OPENSSL 1)
+ SET(USE_SSLEAY 1)
ENDIF(HAVE_LIBCRYPTO AND HAVE_LIBSSL)
ENDIF(CMAKE_USE_OPENSSL)
CHECK_SYMBOL_EXISTS(gmtime_r "${CURL_INCLUDES}" HAVE_GMTIME_R)
@@ -619,7 +634,7 @@ FOREACH(CURL_TEST
HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID
TIME_WITH_SYS_TIME
HAVE_O_NONBLOCK
- HAVE_GETHOSTBYADDR_R_5
+ HAVE_GETHOSTBYADDR_R_5
HAVE_GETHOSTBYADDR_R_7
HAVE_GETHOSTBYADDR_R_8
HAVE_GETHOSTBYADDR_R_5_REENTRANT
@@ -762,7 +777,7 @@ ADD_DEFINITIONS(-DHAVE_CONFIG_H)
# For windows, do not allow the compiler to use default target (Vista).
IF(WIN32)
- ADD_DEFINITIONS(-D_WIN32_WINNT=0x0501)
+ ADD_DEFINITIONS(-D_WIN32_WINNT=0x0501)
ENDIF(WIN32)
IF(MSVC)
@@ -772,77 +787,77 @@ ENDIF(MSVC)
# Sets up the dependencies (zlib, OpenSSL, etc.) of a cURL subproject according to options.
# TODO This is far to be complete!
FUNCTION(SETUP_CURL_DEPENDENCIES TARGET_NAME)
- IF(CURL_ZLIB AND ZLIB_FOUND)
- INCLUDE_DIRECTORIES(${ZLIB_INCLUDE_DIR})
- ENDIF()
- IF(CURL_ZLIB AND ZLIB_FOUND)
- TARGET_LINK_LIBRARIES(${TARGET_NAME} ${ZLIB_LIBRARIES})
- #ADD_DEFINITIONS( -DHAVE_ZLIB_H -DHAVE_ZLIB -DHAVE_LIBZ )
- ENDIF()
-
- IF(CMAKE_USE_OPENSSL AND OPENSSL_FOUND)
- INCLUDE_DIRECTORIES(${OPENSSL_INCLUDE_DIR})
- ENDIF()
- IF(CURL_SSL AND CURL_CONFIG_HAS_BEEN_RUN_BEFORE)
- TARGET_LINK_LIBRARIES(${TARGET_NAME} ${OPENSSL_LIBRARIES})
- #ADD_DEFINITIONS( -DUSE_SSLEAY )
- ENDIF()
+ IF(CURL_ZLIB AND ZLIB_FOUND)
+ INCLUDE_DIRECTORIES(${ZLIB_INCLUDE_DIR})
+ ENDIF()
+ IF(CURL_ZLIB AND ZLIB_FOUND)
+ TARGET_LINK_LIBRARIES(${TARGET_NAME} ${ZLIB_LIBRARIES})
+ #ADD_DEFINITIONS( -DHAVE_ZLIB_H -DHAVE_ZLIB -DHAVE_LIBZ )
+ ENDIF()
+
+ IF(CMAKE_USE_OPENSSL AND OPENSSL_FOUND)
+ INCLUDE_DIRECTORIES(${OPENSSL_INCLUDE_DIR})
+ ENDIF()
+ IF(CURL_SSL AND CURL_CONFIG_HAS_BEEN_RUN_BEFORE)
+ TARGET_LINK_LIBRARIES(${TARGET_NAME} ${OPENSSL_LIBRARIES})
+ #ADD_DEFINITIONS( -DUSE_SSLEAY )
+ ENDIF()
ENDFUNCTION()
# 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})
- STRING(REPLACE "$(top_builddir)" "\${CURL_BINARY_DIR}" MAKEFILE_INC_TEXT ${MAKEFILE_INC_TEXT})
-
- STRING(REGEX REPLACE "\\\\\n" "§!§" MAKEFILE_INC_TEXT ${MAKEFILE_INC_TEXT})
- STRING(REGEX REPLACE "([a-zA-Z_][a-zA-Z0-9_]*)[\t ]*=[\t ]*([^\n]*\n)" "SET(\\1 \\2)\n" 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.
- FILE(WRITE ${OUTPUT_FILE} ${MAKEFILE_INC_TEXT})
-
- ### BUGGY METHOD 1
- # FILE(STRINGS Makefile.inc MAKEFILE_INC_TEXT)
- # STRING(REPLACE "# ./lib/Makefile.inc" "" MAKEFILE_INC_TEXT ${MAKEFILE_INC_TEXT})
- # STRING(REPLACE " " " " MAKEFILE_INC_TEXT ${MAKEFILE_INC_TEXT}) # Replace tabs with spaces
-
- # #STRING(REGEX MATCH "CSOURCES *=" AAA ${MAKEFILE_INC_TEXT})
- # #MESSAGE(STATUS ${AAA})
-
- # STRING(REPLACE "CSOURCES =" "" MAKEFILE_INC_TEXT ${MAKEFILE_INC_TEXT})
- # STRING(REPLACE "HHEADERS =" "" MAKEFILE_INC_TEXT ${MAKEFILE_INC_TEXT})
-
- # STRING(REGEX REPLACE "[^ ]+\\.c" "" ${HEADERS_VAR} ${MAKEFILE_INC_TEXT}) # Remove source files and store into headers var
- # STRING(REGEX REPLACE " +" " " ${HEADERS_VAR} ${${HEADERS_VAR}})
- # STRING(REGEX REPLACE " " ";" ${HEADERS_VAR} ${${HEADERS_VAR}})
-
- # STRING(REGEX REPLACE "[^ ]+\\.h" "" ${SOURCES_VAR} ${MAKEFILE_INC_TEXT}) # Remove headers and store into source files var
- # STRING(REGEX REPLACE " +" " " ${SOURCES_VAR} ${${SOURCES_VAR}})
- # STRING(REGEX REPLACE " " ";" ${SOURCES_VAR} ${${SOURCES_VAR}})
-
- # SET(${HEADERS_VAR} ${${HEADERS_VAR}} PARENT_SCOPE)
- # SET(${SOURCES_VAR} ${${SOURCES_VAR}} PARENT_SCOPE)
-
- ### BUGGY METHOD 2
- # FILE(READ Makefile.inc MAKEFILE_INC_TEXT)
- # #STRING(REPLACE "\t" " " MAKEFILE_INC_TEXT ${MAKEFILE_INC_TEXT}) # Replace tabs with spaces
- # #STRING(REGEX REPLACE "\n+" "\n" MAKEFILE_INC_TEXT ${MAKEFILE_INC_TEXT}) # Remove empty lines (allow a simplification in the script)
- # STRING(REGEX REPLACE "([A-Z]+)[\t ]*=[\t ]*" "SET(\\1 " MAKEFILE_INC_TEXT ${MAKEFILE_INC_TEXT})
- # #STRING(REGEX REPLACE "^(.*)[\t ]*[^\\]$" ")" MAKEFILE_INC_TEXT ${MAKEFILE_INC_TEXT})
- # STRING(REGEX REPLACE "([^\\])\n" "\\1)\n" MAKEFILE_INC_TEXT ${MAKEFILE_INC_TEXT})
- # # STRING(REGEX REPLACE "CSOURCES *=" "SET(libCurl_SRCS " MAKEFILE_INC_TEXT ${MAKEFILE_INC_TEXT})
- # # STRING(REGEX REPLACE "HHEADERS *=" "SET(libCurl_HEADERS " MAKEFILE_INC_TEXT ${MAKEFILE_INC_TEXT})
- # FILE(WRITE Makefile.inc.cmake ${MAKEFILE_INC_TEXT})
+ FILE(READ ${INPUT_FILE} MAKEFILE_INC_TEXT)
+ STRING(REPLACE "$(top_srcdir)" "\${CURL_SOURCE_DIR}" MAKEFILE_INC_TEXT ${MAKEFILE_INC_TEXT})
+ STRING(REPLACE "$(top_builddir)" "\${CURL_BINARY_DIR}" MAKEFILE_INC_TEXT ${MAKEFILE_INC_TEXT})
+
+ STRING(REGEX REPLACE "\\\\\n" "§!§" MAKEFILE_INC_TEXT ${MAKEFILE_INC_TEXT})
+ STRING(REGEX REPLACE "([a-zA-Z_][a-zA-Z0-9_]*)[\t ]*=[\t ]*([^\n]*\n)" "SET(\\1 \\2)\n" 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.
+ FILE(WRITE ${OUTPUT_FILE} ${MAKEFILE_INC_TEXT})
+
+ ### BUGGY METHOD 1
+ # FILE(STRINGS Makefile.inc MAKEFILE_INC_TEXT)
+ # STRING(REPLACE "# ./lib/Makefile.inc" "" MAKEFILE_INC_TEXT ${MAKEFILE_INC_TEXT})
+ # STRING(REPLACE " " " " MAKEFILE_INC_TEXT ${MAKEFILE_INC_TEXT}) # Replace tabs with spaces
+
+ # #STRING(REGEX MATCH "CSOURCES *=" AAA ${MAKEFILE_INC_TEXT})
+ # #MESSAGE(STATUS ${AAA})
+
+ # STRING(REPLACE "CSOURCES =" "" MAKEFILE_INC_TEXT ${MAKEFILE_INC_TEXT})
+ # STRING(REPLACE "HHEADERS =" "" MAKEFILE_INC_TEXT ${MAKEFILE_INC_TEXT})
+
+ # STRING(REGEX REPLACE "[^ ]+\\.c" "" ${HEADERS_VAR} ${MAKEFILE_INC_TEXT}) # Remove source files and store into headers var
+ # STRING(REGEX REPLACE " +" " " ${HEADERS_VAR} ${${HEADERS_VAR}})
+ # STRING(REGEX REPLACE " " ";" ${HEADERS_VAR} ${${HEADERS_VAR}})
+
+ # STRING(REGEX REPLACE "[^ ]+\\.h" "" ${SOURCES_VAR} ${MAKEFILE_INC_TEXT}) # Remove headers and store into source files var
+ # STRING(REGEX REPLACE " +" " " ${SOURCES_VAR} ${${SOURCES_VAR}})
+ # STRING(REGEX REPLACE " " ";" ${SOURCES_VAR} ${${SOURCES_VAR}})
+
+ # SET(${HEADERS_VAR} ${${HEADERS_VAR}} PARENT_SCOPE)
+ # SET(${SOURCES_VAR} ${${SOURCES_VAR}} PARENT_SCOPE)
+
+ ### BUGGY METHOD 2
+ # FILE(READ Makefile.inc MAKEFILE_INC_TEXT)
+ # #STRING(REPLACE "\t" " " MAKEFILE_INC_TEXT ${MAKEFILE_INC_TEXT}) # Replace tabs with spaces
+ # #STRING(REGEX REPLACE "\n+" "\n" MAKEFILE_INC_TEXT ${MAKEFILE_INC_TEXT}) # Remove empty lines (allow a simplification in the script)
+ # STRING(REGEX REPLACE "([A-Z]+)[\t ]*=[\t ]*" "SET(\\1 " MAKEFILE_INC_TEXT ${MAKEFILE_INC_TEXT})
+ # #STRING(REGEX REPLACE "^(.*)[\t ]*[^\\]$" ")" MAKEFILE_INC_TEXT ${MAKEFILE_INC_TEXT})
+ # STRING(REGEX REPLACE "([^\\])\n" "\\1)\n" MAKEFILE_INC_TEXT ${MAKEFILE_INC_TEXT})
+ # # STRING(REGEX REPLACE "CSOURCES *=" "SET(libCurl_SRCS " MAKEFILE_INC_TEXT ${MAKEFILE_INC_TEXT})
+ # # STRING(REGEX REPLACE "HHEADERS *=" "SET(libCurl_HEADERS " MAKEFILE_INC_TEXT ${MAKEFILE_INC_TEXT})
+ # FILE(WRITE Makefile.inc.cmake ${MAKEFILE_INC_TEXT})
ENDFUNCTION()
ADD_SUBDIRECTORY(lib)
IF(BUILD_CURL_EXE)
- ADD_SUBDIRECTORY(src)
+ ADD_SUBDIRECTORY(src)
ENDIF()
IF(BUILD_CURL_TESTS)
- ADD_SUBDIRECTORY(tests)
+ ADD_SUBDIRECTORY(tests)
ENDIF()
# This needs to be run very last so other parts of the scripts can take advantage of this.