Commit 3c45295e authored by Emmanuel Christophe's avatar Emmanuel Christophe
Browse files

ENH: add autodetection of curlmulti capabilities

parent ef07174f
#include "curl/curl.h"
#include <iostream>
int main(int argc,char * argv[])
{
CURLM * multiHandle;
multiHandle = curl_multi_init();
curl_multi_cleanup(multiHandle);
return 0;
}
......@@ -367,9 +367,14 @@ IF(OTB_USE_CURL)
INCLUDE_DIRECTORIES(${CURL_INCLUDE_DIR})
# TODO add test to check if curl multi is available
OPTION(OTB_CURL_MULTI_AVAILABLE "Whether or not the curl has curlmulti capabilities" ON)
MARK_AS_ADVANCED(OTB_CURL_MULTI_AVAILABLE)
ADD_DEFINITIONS(-DOTB_CURL_MULTI_AVAILABLE)
TRY_COMPILE(OTB_CURL_MULTI_AVAILABLE
${CMAKE_CURRENT_BINARY_DIR}/CMake
${CMAKE_CURRENT_SOURCE_DIR}/CMake/TestCurlMulti.cxx
CMAKE_FLAGS "-DINCLUDE_DIRECTORIES:PATH=${CURL_INCLUDE_DIR}" "-DLINK_LIBRARIES:STRING=${CURL_LIBRARY}"
OUTPUT_VARIABLE OUTPUT)
IF (OTB_CURL_MULTI_AVAILABLE)
ADD_DEFINITIONS(-DOTB_CURL_MULTI_AVAILABLE)
ENDIF (OTB_CURL_MULTI_AVAILABLE)
ENDIF(OTB_USE_CURL)
#-------------------------------
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment