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/CMakeLists.txt b/rtengine/CMakeLists.txt index 3d87c552d..424b3352e 100644 --- a/rtengine/CMakeLists.txt +++ b/rtengine/CMakeLists.txt @@ -22,6 +22,7 @@ link_directories("${PROJECT_SOURCE_DIR}/rtexif" ${GTHREAD_LIBRARY_DIRS} ${IPTCDATA_LIBRARY_DIRS} ${LCMS_LIBRARY_DIRS} + ${LENSFUN_LIBRARY_DIRS} ) set(CAMCONSTSFILE "camconst.json") diff --git a/rtengine/iptransform.cc b/rtengine/iptransform.cc index 939287341..f227af2ed 100644 --- a/rtengine/iptransform.cc +++ b/rtengine/iptransform.cc @@ -307,7 +307,7 @@ void ImProcFunctions::transform (Imagefloat* original, Imagefloat* transformed, std::unique_ptr pLCPMap; if (needsLensfun()) { - pLCPMap = std::move(LFDatabase::findModifier(params->lensProf, metadata, oW, oH, params->coarse, rawRotationDeg)); + pLCPMap = LFDatabase::findModifier(params->lensProf, metadata, oW, oH, params->coarse, rawRotationDeg); } else if (needsLCP()) { // don't check focal length to allow distortion correction for lenses without chip const std::shared_ptr pLCPProf = LCPStore::getInstance()->getProfile (params->lensProf.lcpFile); diff --git a/rtengine/rawimagesource.cc b/rtengine/rawimagesource.cc index 381863231..6ab9076aa 100644 --- a/rtengine/rawimagesource.cc +++ b/rtengine/rawimagesource.cc @@ -1856,7 +1856,7 @@ void RawImageSource::preprocess (const RAWParams &raw, const LensProfParams &le if (!hasFlatField && lensProf.useVign) { std::unique_ptr pmap; if (lensProf.useLensfun()) { - pmap = std::move(LFDatabase::findModifier(lensProf, idata, W, H, coarse, -1)); + pmap = LFDatabase::findModifier(lensProf, idata, W, H, coarse, -1); } else { const std::shared_ptr pLCPProf = LCPStore::getInstance()->getProfile(lensProf.lcpFile); diff --git a/rtengine/rtlensfun.cc b/rtengine/rtlensfun.cc index a0250cef9..ddbeca9bf 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; diff --git a/rtengine/rtlensfun.h b/rtengine/rtlensfun.h index 05487da8e..207e4e86e 100644 --- a/rtengine/rtlensfun.h +++ b/rtengine/rtlensfun.h @@ -46,7 +46,7 @@ public: bool isCACorrectionAvailable() const override; void correctCA(double &x, double &y, int channel) const override; void processVignetteLine(int width, int y, float *line) const override; - void processVignetteLine3Channels(int width, int y, float *line) const; + void processVignetteLine3Channels(int width, int y, float *line) const override; Glib::ustring getDisplayString() const; @@ -118,7 +118,7 @@ private: int width, int height, bool swap_xy) const; LFDatabase(); bool LoadDirectory(const char *dirname); - + static LFDatabase instance_; lfDatabase *data_; }; diff --git a/rtexif/CMakeLists.txt b/rtexif/CMakeLists.txt index 820f682a4..9747b03fb 100644 --- a/rtexif/CMakeLists.txt +++ b/rtexif/CMakeLists.txt @@ -3,11 +3,11 @@ add_dependencies(rtexif UpdateInfo) if(WIN32) include_directories(${EXTRA_INCDIR} ${GLIB2_INCLUDE_DIRS} ${GLIBMM_INCLUDE_DIRS} ${GTK_INCLUDE_DIRS} ${GTKMM_INCLUDE_DIRS}) - link_directories(. "${PROJECT_SOURCE_DIR}/rtexif" ${EXTRA_LIBDIR} ${GLIB2_LIBRARY_DIRS} ${GLIBMM_LIBRARY_DIRS} ${GTK_LIBRARY_DIRS} ${GTKMM_LIBRARY_DIRS}) + link_directories(. "${PROJECT_SOURCE_DIR}/rtexif" ${EXTRA_LIBDIR} ${GLIB2_LIBRARY_DIRS} ${GLIBMM_LIBRARY_DIRS} ${GTK_LIBRARY_DIRS} ${GTKMM_LIBRARY_DIRS} ${LENSFUN_LIBRARY_DIRS}) else() set_target_properties(rtexif PROPERTIES COMPILE_FLAGS " -fPIC") include_directories(${EXTRA_INCDIR} ${GLIB2_INCLUDE_DIRS} ${GLIBMM_INCLUDE_DIRS} ${GTK_INCLUDE_DIRS} ${GTKMM_INCLUDE_DIRS}) - link_directories(${EXTRA_LIBDIR} ${GLIB2_LIBRARY_DIRS} ${GLIBMM_LIBRARY_DIRS} ${GTK_LIBRARY_DIRS} ${GTKMM_LIBRARY_DIRS}) + link_directories(${EXTRA_LIBDIR} ${GLIB2_LIBRARY_DIRS} ${GLIBMM_LIBRARY_DIRS} ${GTK_LIBRARY_DIRS} ${GTKMM_LIBRARY_DIRS} ${LENSFUN_LIBRARY_DIRS}) endif() include_directories(BEFORE "${CMAKE_CURRENT_BINARY_DIR}") diff --git a/rtgui/CMakeLists.txt b/rtgui/CMakeLists.txt index 377b1bcbe..e8bbf18b1 100644 --- a/rtgui/CMakeLists.txt +++ b/rtgui/CMakeLists.txt @@ -179,6 +179,7 @@ if(WIN32) ${GLIBMM_LIBRARY_DIRS} ${GTKMM_LIBRARY_DIRS} ${GTK_LIBRARY_DIRS} + ${LENSFUN_LIBRARY_DIRS} ) else() include_directories(${EXTRA_INCDIR} @@ -211,6 +212,7 @@ else() ${GTK_LIBRARY_DIRS} ${IPTCDATA_LIBRARY_DIRS} ${LCMS_LIBRARY_DIRS} + ${LENSFUN_LIBRARY_DIRS} ) endif()