aboutsummaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorBenoit Neil <suky0001@free.fr>2009-04-06 21:05:44 +0000
committerBenoit Neil <suky0001@free.fr>2009-04-06 21:05:44 +0000
commitb85154f13fa5bf25d7da2fa4eaa05fb683ba3aa3 (patch)
treefe9841b708e526eaecced55a868c72a2f8af16c1 /CMakeLists.txt
parent06047d91036130bce6fde44ee481582c1a979706 (diff)
Added tests (exes) targets, refactor a few things.
PS: Once again, sorry if the added files have executable perms on Linux.
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)