- if possible on Linux compilers, force static linking of libcurl
This commit is contained in:
parent
5f831db095
commit
a36f0c38d6
|
@ -19,8 +19,26 @@ INCLUDE(FindPackageHandleStandardArgs)
|
||||||
FIND_PACKAGE_HANDLE_STANDARD_ARGS(CURL DEFAULT_MSG CURL_LIBRARY CURL_INCLUDE_DIR)
|
FIND_PACKAGE_HANDLE_STANDARD_ARGS(CURL DEFAULT_MSG CURL_LIBRARY CURL_INCLUDE_DIR)
|
||||||
|
|
||||||
IF(CURL_FOUND)
|
IF(CURL_FOUND)
|
||||||
|
|
||||||
SET(CURL_LIBRARIES ${CURL_LIBRARY})
|
SET(CURL_LIBRARIES ${CURL_LIBRARY})
|
||||||
SET(CURL_INCLUDE_DIRS ${CURL_INCLUDE_DIR})
|
SET(CURL_INCLUDE_DIRS ${CURL_INCLUDE_DIR})
|
||||||
|
|
||||||
|
# IF we are using a system that supports curl-config use it
|
||||||
|
# and force using static libs
|
||||||
|
IF(UNIX AND NOT APPLE)
|
||||||
|
FIND_PROGRAM( CMAKE_CURL_CONFIG curl-config)
|
||||||
|
|
||||||
|
IF(CMAKE_CURL_CONFIG)
|
||||||
|
# run the curl-config program to get --static-libs
|
||||||
|
EXEC_PROGRAM(sh
|
||||||
|
ARGS "${CMAKE_CURL_CONFIG} --static-libs"
|
||||||
|
OUTPUT_VARIABLE CURL_STATIC_LIBS
|
||||||
|
RETURN_VALUE RET)
|
||||||
|
|
||||||
|
SET(CURL_LIBRARIES "-static ${CURL_STATIC_LIBS}")
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
|
ENDIF()
|
||||||
ELSE(CURL_FOUND)
|
ELSE(CURL_FOUND)
|
||||||
SET(CURL_LIBRARIES)
|
SET(CURL_LIBRARIES)
|
||||||
SET(CURL_INCLUDE_DIRS)
|
SET(CURL_INCLUDE_DIRS)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user