From 7ee485e89cf475ecbcc9090460bf901ddeff5730 Mon Sep 17 00:00:00 2001 From: Alberto Griggio Date: Sun, 17 Sep 2017 00:18:33 +0200 Subject: [PATCH] Make LENSFUN_HAS_LOAD_DIRECTORY test actually succeed when it should --- CMakeLists.txt | 5 +++++ rtengine/rtlensfun.cc | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index c75b02288..65ac4bdd4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -448,6 +448,11 @@ endif() # check whether the used version of lensfun has lfDatabase::LoadDirectory include(CheckCXXSourceCompiles) set(CMAKE_REQUIRED_INCLUDES ${LENSFUN_INCLUDE_DIRS}) +set(CMAKE_REQUIRED_LIBRARIES) +foreach(l ${LENSFUN_LIBRARIES}) + find_library(_l ${l} PATHS ${LENSFUN_LIBRARY_DIRS} NO_DEFAULT_PATH) + set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} ${_l}) +endforeach() check_cxx_source_compiles( "#include int main() diff --git a/rtengine/rtlensfun.cc b/rtengine/rtlensfun.cc index 3212c3bb4..2f47ec1a3 100644 --- a/rtengine/rtlensfun.cc +++ b/rtengine/rtlensfun.cc @@ -285,7 +285,7 @@ bool LFDatabase::init(const Glib::ustring &dbdir) bool LFDatabase::LoadDirectory(const char *dirname) { #if RT_LENSFUN_HAS_LOAD_DIRECTORY - instance_.data_->LoadDirectory(dirname); + return instance_.data_->LoadDirectory(dirname); #else // backported from lensfun 0.3.x bool database_found = false;