From c3629117d87ff49251f8b3f57bda2b475b86376b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luis=20D=C3=ADaz=20M=C3=A1s?= Date: Tue, 22 May 2018 17:06:46 +0200 Subject: [PATCH] conan: Upgrade libcurl version Thanks to this upgrade the cmake code that handles the CURL dependency can be simplified. Now we can use the shared version of CURL in all the platforms. However we will use for the moment the static version on Mac, since we are having some issues with 'make tests'. Once those tests are migrated to python we can also use the shared version there. --- CMakeLists.txt | 3 ++- conanfile.py | 7 ++----- src/CMakeLists.txt | 12 ++---------- 3 files changed, 6 insertions(+), 16 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 96426850..dfe0099e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -14,8 +14,9 @@ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG ${CMAKE_BINARY_DIR}/bin) set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE ${CMAKE_BINARY_DIR}/bin) set(CMAKE_MACOSX_RPATH ON) + if (APPLE) - set(CMAKE_INSTALL_RPATH "@executable_path/../lib") + set(CMAKE_INSTALL_RPATH "@loader_path") endif() set( PACKAGE_COPYRIGHT "Andreas Huggel" ) diff --git a/conanfile.py b/conanfile.py index 098984c9..b7ce787c 100644 --- a/conanfile.py +++ b/conanfile.py @@ -8,17 +8,14 @@ class Exiv2Conan(ConanFile): default_options = 'unitTests=True' def configure(self): - # Note : The linking in exiv2lib fails if we try to use the static version of libcurl. - # The libcurl CMake code is not mature enough and therefore the conan recipe for - # Windows also has some problems (since it uses CMake for configuring the project). - if os_info.is_windows: + if not os_info.is_macos: self.options['libcurl'].shared = True self.options['gtest'].shared = True def requirements(self): self.requires('Expat/2.2.5@pix4d/stable') self.requires('zlib/1.2.11@conan/stable') - self.requires('libcurl/7.56.1@bincrafters/stable') # from conan-bincrafters + self.requires('libcurl/7.60.0@bincrafters/stable') if self.options.unitTests: self.requires('gtest/1.8.0@bincrafters/stable') diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 6bf82a39..16096b01 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -229,19 +229,11 @@ if (EXIV2_ENABLE_WEBREADY) if( EXIV2_ENABLE_CURL ) target_include_directories(exiv2lib SYSTEM PUBLIC ${CURL_INCLUDE_DIR} ) - + target_link_libraries(exiv2lib PUBLIC ${CURL_LIBRARIES}) if (USING_CONAN) - # TODO : Improve libcurl recipe so we do not need to have all these conditionals here - if ( MSVC ) - target_link_libraries( exiv2lib PUBLIC ${CURL_LIBRARY}) - else() - target_link_libraries( exiv2lib PUBLIC ${CONAN_LIBS_LIBCURL}) - endif() target_compile_definitions(exiv2lib PUBLIC ${CONAN_COMPILE_DEFINITIONS_LIBCURL}) - else() - target_link_libraries( exiv2lib PUBLIC ${CURL_LIBRARIES}) + target_link_libraries(exiv2lib PUBLIC ${CONAN_EXE_LINKER_FLAGS_LIBCURL}) endif() - endif() endif()