diff --git a/CMakeLists.txt b/CMakeLists.txt index a54953de0..03a0e58d3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -227,8 +227,8 @@ MACRO (CMAKE_BUILD_UTILITIES) # Everything in the tree should be able to include files from the # Utilities directory. INCLUDE_DIRECTORIES( - ${CMake_SOURCE_DIR}/Utilities ${CMake_BINARY_DIR}/Utilities + ${CMake_SOURCE_DIR}/Utilities ) # check for the use of system libraries versus builtin ones @@ -269,7 +269,13 @@ MACRO (CMAKE_BUILD_UTILITIES) ADD_DEFINITIONS(-DCURL_STATICLIB) SET(CMAKE_CURL_INCLUDES) SET(CMAKE_CURL_LIBRARIES cmcurl) - SUBDIRS(Utilities/cmcurl) + IF(CMAKE_USE_NEW_CURL) + # for cmake never build examples + SET(CURL_SKIP_EXAMPLES TRUE) + ADD_SUBDIRECTORY(Utilities/cmcurl-7.19.0) + ELSE(CMAKE_USE_NEW_CURL) + SUBDIRS(Utilities/cmcurl) + ENDIF(CMAKE_USE_NEW_CURL) ENDIF(CMAKE_USE_SYSTEM_CURL) #--------------------------------------------------------------------- diff --git a/Utilities/cmThirdParty.h.in b/Utilities/cmThirdParty.h.in index 845a1bd5f..0133428c9 100644 --- a/Utilities/cmThirdParty.h.in +++ b/Utilities/cmThirdParty.h.in @@ -22,5 +22,6 @@ #cmakedefine CMAKE_USE_SYSTEM_EXPAT #cmakedefine CMAKE_USE_SYSTEM_XMLRPC #cmakedefine CMAKE_USE_SYSTEM_ZLIB +#cmakedefine CMAKE_USE_NEW_CURL #endif diff --git a/Utilities/cm_curl.h b/Utilities/cm_curl.h index 0fcb5c514..9736b357c 100644 --- a/Utilities/cm_curl.h +++ b/Utilities/cm_curl.h @@ -22,7 +22,11 @@ #ifdef CMAKE_USE_SYSTEM_CURL # include #else -# include +# ifdef CMAKE_USE_NEW_CURL +# include +# else CMAKE_USE_NEW_CURL +# include +# endif #endif #endif diff --git a/Utilities/cmcurl-7.19.0/CMakeLists.txt b/Utilities/cmcurl-7.19.0/CMakeLists.txt index 69945eff1..f9a215102 100644 --- a/Utilities/cmcurl-7.19.0/CMakeLists.txt +++ b/Utilities/cmcurl-7.19.0/CMakeLists.txt @@ -42,7 +42,7 @@ if(CMAKE_COMPILER_2005) endif(CMAKE_COMPILER_2005) add_definitions(-DHAVE_CONFIG_H -DCURL_STATICLIB) - +option(CURL_SKIP_EXAMPLES "Skip building the curl examples" FALSE) add_subdirectory(lib) add_subdirectory(src) add_subdirectory(docs) diff --git a/Utilities/cmcurl-7.19.0/docs/CMakeLists.txt b/Utilities/cmcurl-7.19.0/docs/CMakeLists.txt index 2d2cfee5f..5b7c064a4 100644 --- a/Utilities/cmcurl-7.19.0/docs/CMakeLists.txt +++ b/Utilities/cmcurl-7.19.0/docs/CMakeLists.txt @@ -1 +1,4 @@ -add_subdirectory(examples) +if(NOT CURL_SKIP_EXAMPLES) + add_subdirectory(examples) +endif(NOT CURL_SKIP_EXAMPLES) + diff --git a/Utilities/cmcurl-7.19.0/include/curl/curl.h b/Utilities/cmcurl-7.19.0/include/curl/curl.h index c9a763537..8ce31fa2d 100644 --- a/Utilities/cmcurl-7.19.0/include/curl/curl.h +++ b/Utilities/cmcurl-7.19.0/include/curl/curl.h @@ -32,7 +32,7 @@ */ #include "curlver.h" /* libcurl version defines */ -#include "curl/curlbuild.h" /* libcurl build definitions */ +#include "cmcurl-7.19.0/include/curl/curlbuild.h" /* libcurl build definitions */ #include "curlrules.h" /* libcurl rules enforcement */ /* diff --git a/Utilities/cmcurl-7.19.0/lib/CMakeLists.txt b/Utilities/cmcurl-7.19.0/lib/CMakeLists.txt index 99e231496..4b01adb9d 100644 --- a/Utilities/cmcurl-7.19.0/lib/CMakeLists.txt +++ b/Utilities/cmcurl-7.19.0/lib/CMakeLists.txt @@ -564,7 +564,6 @@ configure_file(${CURL_SOURCE_DIR}/lib/config.cmake.h.in set(CURL_SIZEOF_LONG ${SIZEOF_LONG}) configure_file(${CURL_SOURCE_DIR}/include/curl/curlbuild.cmake.h.in ${CURL_BINARY_DIR}/include/curl/curlbuild.h) - add_library(cmcurl ${libCurl_SRCS}) target_link_libraries(cmcurl ${CURL_LIBS})