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()