From c6ea264f24b9b387caa978b30399d2d3e5709dcc Mon Sep 17 00:00:00 2001 From: kervala Date: Thu, 5 Nov 2015 16:47:07 +0100 Subject: [PATCH] Fixed: cURL static version needs to be linked against libidn under Linux too --HG-- branch : develop --- code/CMakeLists.txt | 28 ++++++++++++++++++---------- 1 file changed, 18 insertions(+), 10 deletions(-) diff --git a/code/CMakeLists.txt b/code/CMakeLists.txt index 848403148..22686bba0 100644 --- a/code/CMakeLists.txt +++ b/code/CMakeLists.txt @@ -158,9 +158,9 @@ IF(WITH_NEL) IF((WIN32 OR CURL_LIBRARIES MATCHES "\\.a") AND WITH_STATIC_CURL) SET(CURL_STATIC ON) - ELSE((WIN32 OR CURL_LIBRARIES MATCHES "\\.a") AND WITH_STATIC_CURL) + ELSE() SET(CURL_STATIC OFF) - ENDIF((WIN32 OR CURL_LIBRARIES MATCHES "\\.a") AND WITH_STATIC_CURL) + ENDIF() IF(CURL_STATIC) SET(CURL_DEFINITIONS -DCURL_STATICLIB) @@ -172,15 +172,23 @@ IF(WITH_NEL) SET(CURL_LIBRARIES ${CURL_LIBRARIES} ${OPENSSL_LIBRARIES}) ENDIF(OPENSSL_FOUND) - # CURL Macports version depends on libidn, libintl and libiconv too - IF(APPLE) + IF(UNIX) + # CURL depends on libidn FIND_LIBRARY(IDN_LIBRARY idn) - FIND_LIBRARY(INTL_LIBRARY intl) - - SET(CURL_LIBRARIES ${CURL_LIBRARIES} ${IDN_LIBRARY} ${INTL_LIBRARY}) - ENDIF(APPLE) - ENDIF(CURL_STATIC) - ENDIF(WITH_GUI) + IF(IDN_LIBRARY) + SET(CURL_LIBRARIES ${CURL_LIBRARIES} ${IDN_LIBRARY}) + ENDIF() + + # CURL Macports version depends on libidn, libintl and libiconv too + IF(APPLE) + FIND_LIBRARY(INTL_LIBRARY intl) + IF(INTL_LIBRARY) + SET(CURL_LIBRARIES ${CURL_LIBRARIES} ${INTL_LIBRARY}) + ENDIF() + ENDIF() + ENDIF() + ENDIF() + ENDIF() INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/nel/include ${LIBXML2_INCLUDE_DIR}) ADD_DEFINITIONS(${LIBXML2_DEFINITIONS})