diff -urN a/CMakeLists.txt b/CMakeLists.txt --- a/CMakeLists.txt 2015-12-04 22:59:30.000000000 +0100 +++ b/CMakeLists.txt 2016-01-18 10:39:12.056321760 +0100 @@ -43,8 +43,8 @@ pkg_check_modules(ORC REQUIRED orc-0.4) ENDIF(NOT MINGW) -#FIND_PACKAGE(LibRaw 0.13 REQUIRED) -#pkg_check_modules(LIBRAW REQUIRED libraw) +FIND_PACKAGE(LibRaw 0.13 REQUIRED) +pkg_check_modules(LIBRAW REQUIRED libraw) #find_package (LibXML++ REQUIRED) #pkg_check_modules(LIBXML REQUIRED libxml++-2.6) diff -urN a/src/CMakeLists.txt b/src/CMakeLists.txt --- a/src/CMakeLists.txt 2015-12-04 22:59:30.000000000 +0100 +++ b/src/CMakeLists.txt 2016-01-18 10:43:00.400850307 +0100 @@ -51,9 +52,10 @@ include_directories(${SIGC2_INCLUDE_DIRS}) link_directories(${SIGC2_LIBRARY_DIRS}) - -include_directories(${CMAKE_CURRENT_SOURCE_DIR}/external) -include_directories(${CMAKE_CURRENT_SOURCE_DIR}/external/LibRaw) +if(LIBRAW_FOUND) + link_directories( ${LIBRAW_LIBRARY_DIRS} ) + include_directories( ${LIBRAW_INCLUDE_DIRS} ) +endif() #if(LENSFUN_FOUND) # link_directories( ${LENSFUN_LIBRARY_DIRS} ) @@ -140,18 +142,6 @@ FILE(GLOB OpIncludes operations/*.hh operations/gmic/*.hh) FILE(GLOB OpSources operations/*.cc operations/gmic/*.cc) -# -# the libraw part is a bit of a hack: -# the static linking didn't work since it was pulling -lstdc++ and -lm into linker flags. -# so we do a custom dependency and pretend an imported liblibraw_r.a so no other -l are -# appended. -# -add_library(libraw_static STATIC IMPORTED) -set_target_properties(libraw_static PROPERTIES IMPORTED_LOCATION ${CMAKE_CURRENT_BINARY_DIR}/external/LibRaw/liblibraw_r.a) -add_subdirectory(external/LibRaw) -list(APPEND LIB_DEPS libraw_r) -list(APPEND STATIC_LIBS libraw_static) - LIST(APPEND CMAKE_MODULE_PATH " ${CMAKE_SOURCE_DIR}/src/external/lensfun/cmake/modules ") set(BUILD_STATIC "ON") add_library(lensfun_static STATIC IMPORTED) @@ -233,7 +223,7 @@ ${GOBJECT_LIBRARIES} ${GTHREAD_LIBRARIES} ${ZLIB_LIBRARIES} - #${LIBRAW_LIBRARIES} + ${LIBRAW_LIBRARIES} ${STATIC_LIBS} ${ORC_LIBRARIES} fftw3 @@ -267,7 +257,7 @@ ${GOBJECT_LIBRARIES} ${GTHREAD_LIBRARIES} ${ZLIB_LIBRARIES} - #${LIBRAW_LIBRARIES} + ${LIBRAW_LIBRARIES} ${STATIC_LIBS} ${ORC_LIBRARIES} fftw3