From dc79df8ee647179ac4e9caef3bcd4c2d4a969d17 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luis=20D=C3=ADaz=20M=C3=A1s?= Date: Sun, 27 Aug 2017 17:40:19 +0200 Subject: [PATCH] Only use CURL and SSH when their support is enabled --- src/CMakeLists.txt | 32 +++++++++++++++++--------------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 7635a2d4..a48dad9a 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -207,24 +207,26 @@ target_include_directories(exiv2lib PUBLIC ) if (EXIV2_ENABLE_WEBREADY) - target_include_directories(exiv2lib SYSTEM - PUBLIC - ${CURL_INCLUDE_DIR} - ${SSH_INCLUDE_DIR} - ) - # TODO : There should not be needed to make this difference. Improve LIBCURL conan recipe - if (EXISTS ${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) - target_link_libraries( exiv2lib PUBLIC ${CONAN_LIBS_LIBCURL}) - else() - target_link_libraries( exiv2lib PUBLIC ${CURL_LIBRARIES}) + if( EXIV2_ENABLE_SSH ) + target_include_directories(exiv2lib SYSTEM PUBLIC ${SSH_INCLUDE_DIR} ) + target_link_libraries( exiv2lib PUBLIC ${SSH_LIBRARIES}) + endif() + + if( EXIV2_ENABLE_CURL ) + target_include_directories(exiv2lib SYSTEM PUBLIC ${CURL_INCLUDE_DIR} ) + # TODO : There should not be needed to make this difference. Improve LIBCURL conan recipe + if (EXISTS ${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) + target_link_libraries( exiv2lib PUBLIC ${CURL_LIBRARY}) + #target_link_libraries( exiv2lib PUBLIC ${CONAN_LIBS_LIBCURL}) + target_compile_definitions(exiv2lib PUBLIC ${CONAN_COMPILE_DEFINITIONS_LIBCURL}) + else() + target_link_libraries( exiv2lib PUBLIC ${CURL_LIBRARIES}) + endif() + + target_compile_definitions (exiv2lib PUBLIC ${CONAN_COMPILE_DEFINITIONS_LIBCURL}) endif() - target_link_libraries( exiv2lib PUBLIC ${SSH_LIBRARIES}) - target_compile_definitions (exiv2lib - PUBLIC - ${CONAN_COMPILE_DEFINITIONS_LIBCURL} - ) endif() if ( MSVC )