aboutsummaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt27
1 files changed, 26 insertions, 1 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 71442e47e..c87127be8 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -750,8 +750,33 @@ 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(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()
+
ADD_SUBDIRECTORY(lib)
-ADD_SUBDIRECTORY(src)
+IF(BUILD_CURL_EXE)
+ ADD_SUBDIRECTORY(src)
+ENDIF()
+IF(BUILD_CURL_TESTS)
+ ADD_SUBDIRECTORY(tests)
+ENDIF()
# This needs to be run very last so other parts of the scripts can take advantage of this.
IF(NOT CURL_CONFIG_HAS_BEEN_RUN_BEFORE)