summaryrefslogtreecommitdiffstats
path: root/Utilities
diff options
context:
space:
mode:
authorBill Hoffman <bill.hoffman@kitware.com>2012-09-06 19:37:00 (GMT)
committerBrad King <brad.king@kitware.com>2012-09-07 15:07:31 (GMT)
commitbc0e8c28ece1d681449b9b4b43b16fb5b331534e (patch)
tree8ba3a98b8fba211bc649a2d4ff065b74bff07dd3 /Utilities
parentc2f47590ef4fb937a5baa4d4b9e0f364e812d407 (diff)
downloadCMake-bc0e8c28ece1d681449b9b4b43b16fb5b331534e.zip
CMake-bc0e8c28ece1d681449b9b4b43b16fb5b331534e.tar.gz
CMake-bc0e8c28ece1d681449b9b4b43b16fb5b331534e.tar.bz2
curl: Make OpenSSL DLLs available to CMake on Windows
Find the OpenSSL runtime DLLs and place them next to the CMake executables in the build tree and the install tree.
Diffstat (limited to 'Utilities')
-rw-r--r--Utilities/cmcurl/CMakeLists.txt26
1 files changed, 24 insertions, 2 deletions
diff --git a/Utilities/cmcurl/CMakeLists.txt b/Utilities/cmcurl/CMakeLists.txt
index 7eb16d3..ef000a1 100644
--- a/Utilities/cmcurl/CMakeLists.txt
+++ b/Utilities/cmcurl/CMakeLists.txt
@@ -182,6 +182,29 @@ IF(CMAKE_USE_OPENSSL)
IF(CURL_CA_BUNDLE)
ADD_DEFINITIONS(-DCURL_CA_BUNDLE="${CURL_CA_BUNDLE}")
ENDIF(CURL_CA_BUNDLE)
+ # for windows we want to install OPENSSL_LIBRARIES dlls
+ # and also copy them into the build tree so that testing
+ # can find them.
+ IF(WIN32)
+ FIND_FILE(CMAKE_EAY_DLL NAME libeay32.dll HINTS ${OPENSSL_INCLUDE_DIR}/..)
+ FIND_FILE(CMAKE_SSL_DLL NAME ssleay32.dll HINTS ${OPENSSL_INCLUDE_DIR}/..)
+ MARK_AS_ADVANCED(CMAKE_EAY_DLL CMAKE_SSL_DLL)
+ IF(CMAKE_SSL_DLL AND CMAKE_EAY_DLL)
+ SET(CMAKE_CURL_SSL_DLLS ${CMake_BIN_DIR}/${CMAKE_CFG_INTDIR}/libeay32.dll
+ ${CMake_BIN_DIR}/${CMAKE_CFG_INTDIR}/ssleay32.dll)
+ ADD_CUSTOM_COMMAND(OUTPUT
+ ${CMake_BIN_DIR}/${CMAKE_CFG_INTDIR}/libeay32.dll
+ DEPENDS ${CMAKE_EAY_DLL}
+ COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_EAY_DLL}
+ ${CMake_BIN_DIR}/${CMAKE_CFG_INTDIR}/libeay32.dll)
+ ADD_CUSTOM_COMMAND(OUTPUT
+ ${CMake_BIN_DIR}/${CMAKE_CFG_INTDIR}/ssleay32.dll
+ DEPENDS ${CMAKE_SSL_DLL}
+ COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_SSL_DLL}
+ ${CMake_BIN_DIR}/${CMAKE_CFG_INTDIR}/ssleay32.dll)
+ INSTALL(PROGRAMS ${CMAKE_EAY_DLL} ${CMAKE_SSL_DLL} DESTINATION bin)
+ ENDIF()
+ ENDIF()
ENDIF(CMAKE_USE_OPENSSL)
# Check for idn
@@ -690,8 +713,7 @@ ENDFOREACH()
CONFIGURE_FILE(${LIBCURL_SOURCE_DIR}/config.h.in
${LIBCURL_BINARY_DIR}/config.h)
-
-ADD_LIBRARY(cmcurl ${LIBRARY_TYPE} ${libCurl_SRCS})
+ADD_LIBRARY(cmcurl ${LIBRARY_TYPE} ${libCurl_SRCS} ${CMAKE_CURL_SSL_DLLS})
TARGET_LINK_LIBRARIES(cmcurl ${CURL_LIBS})
IF(CMAKE_BUILD_CURL_SHARED)
SET_TARGET_PROPERTIES(cmcurl PROPERTIES DEFINE_SYMBOL BUILDING_LIBCURL