]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
Cmake: Got rid of setup_curl_dependencies
authorJakub Zakrzewski <jzakrzewski@e2ebridge.com>
Fri, 22 Aug 2014 15:02:59 +0000 (17:02 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Thu, 9 Oct 2014 11:48:30 +0000 (13:48 +0200)
There is no need for such function. Include_directories propagate by
themselves and having a function with one simple link statement makes
little sense.

CMakeLists.txt
lib/CMakeLists.txt
src/CMakeLists.txt
tests/libtest/CMakeLists.txt
tests/server/CMakeLists.txt

index fca42e042e687abc774ca54eb080da11c175ef27..c48fd011b1f57d0ddab820cc62067e5cf485b75c 100644 (file)
@@ -378,6 +378,7 @@ if(CURL_ZLIB)
     set(HAVE_ZLIB ON)
     set(HAVE_LIBZ ON)
     list(APPEND CURL_LIBS ${ZLIB_LIBRARIES})
+    include_directories(${ZLIB_INCLUDE_DIR})
   endif()
 endif()
 
@@ -394,6 +395,7 @@ if(CMAKE_USE_LIBSSH2)
     list(APPEND CURL_LIBS ${LIBSSH2_LIBRARY})
     set(CMAKE_REQUIRED_LIBRARIES ${LIBSSH2_LIBRARY})
     set(CMAKE_REQUIRED_INCLUDES "${LIBSSH2_INCLUDE_DIR}")
+    include_directories("${LIBSSH2_INCLUDE_DIR}")
     set(HAVE_LIBSSH2 ON)
     set(USE_LIBSSH2 ON)
 
@@ -870,24 +872,6 @@ if(MSVC)
   add_definitions(-D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE)
 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(CMAKE_USE_OPENSSL AND OPENSSL_FOUND)
-    include_directories(${OPENSSL_INCLUDE_DIR})
-  endif()
-
-  if(CMAKE_USE_LIBSSH2 AND LIBSSH2_FOUND)
-    include_directories(${LIBSSH2_INCLUDE_DIR})
-  endif()
-
-  target_link_libraries(${TARGET_NAME} ${CURL_LIBS})
-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)
index b2bcf090467074c3676025336d45bc010a70cfc8..3ad62df1fa8b27bcb7e1b8c7ccbd533a475f2b77 100644 (file)
@@ -106,8 +106,6 @@ endif()
 
 set_target_properties(${LIB_NAME} PROPERTIES COMPILE_DEFINITIONS BUILDING_LIBCURL)
 
-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 "")
index 2822c5bc2426160f9768ed32d80495c515a0c104..fceaf10fb1506b0fe5aefe16586373991eed0e82 100644 (file)
@@ -30,11 +30,8 @@ include_directories(
   ${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 )
-
+#Build cURL executable
+target_link_libraries( ${EXE_NAME} libcurl ${CURL_LIBS})
 
 ################################################################################
 
index c06b3561998db2d68e4fc8b7b757934e7a7addb9..73aaaa11702ecc60bbc058832c402cb860b5e243 100644 (file)
@@ -12,8 +12,8 @@ function(SETUP_TEST TEST_NAME)          # ARGN are the files in the test
   if(CURL_USE_ARES)
     include_directories(${CARES_INCLUDE_DIR})
   endif()
-  setup_curl_dependencies(${TEST_NAME})
-  target_link_libraries( ${TEST_NAME} libcurl )
+
+  target_link_libraries( ${TEST_NAME} libcurl ${CURL_LIBS})
 
   set_target_properties(${TEST_NAME}
     PROPERTIES COMPILE_DEFINITIONS ${UPPER_TEST_NAME})
index ee08345f816c05b1c047d7daf7fc698341fc513d..031d8171101a277fbdcd6bdb647016049c0251de 100644 (file)
@@ -12,8 +12,8 @@ function(SETUP_EXECUTABLE TEST_NAME)    # ARGN are the files in the test
   if(CURL_USE_ARES)
     include_directories(${CARES_INCLUDE_DIR})
   endif()
-  # resolve test needs this
-  setup_curl_dependencies(${TEST_NAME})
+
+  target_link_libraries(${TEST_NAME} ${CURL_LIBS})
 
   # Test servers simply are standalone programs that do not use libcurl
   # library.  For convinience and to ease portability of these servers,