فهرست منبع

ENH: check in ability to build with new curl -f -DCMAKE_USE_NEW_CURL is set

Bill Hoffman 17 سال پیش
والد
کامیت
6cf99d7bea

+ 8 - 2
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)
 
   #---------------------------------------------------------------------

+ 1 - 0
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

+ 5 - 1
Utilities/cm_curl.h

@@ -22,7 +22,11 @@
 #ifdef CMAKE_USE_SYSTEM_CURL
 # include <curl/curl.h>
 #else
-# include <cmcurl/curl/curl.h>
+# ifdef CMAKE_USE_NEW_CURL
+#   include <cmcurl-7.19.0/include/curl/curl.h>
+# else CMAKE_USE_NEW_CURL
+#   include <cmcurl/curl/curl.h>
+# endif
 #endif
 
 #endif

+ 1 - 1
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)

+ 4 - 1
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)
+

+ 1 - 1
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 */
 
 /*

+ 0 - 1
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})