Make LENSFUN_HAS_LOAD_DIRECTORY test actually succeed when it should

This commit is contained in:
Alberto Griggio 2017-09-17 00:18:33 +02:00
parent 10a4c5f1de
commit 7ee485e89c
2 changed files with 6 additions and 1 deletions

View File

@ -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 <lensfun.h>
int main()

View File

@ -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;