--- CMakeLists.txt.orig 2014-01-14 12:39:39.038297528 +0400 +++ CMakeLists.txt 2014-01-14 12:41:03.052304850 +0400 @@ -134,43 +134,13 @@ endif (HAVE_EXIV2_HPP) #webp -SET(WEBP_INCLUDE_DIR "") -SET(WEBP_SOURCE "") IF(ENABLE_WEBP) - ADD_DEFINITIONS(-DNDEBUG -DWEBP_USE_THREAD) - - FILE(GLOB WEBP_DEC_SRCS - RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} - ${CMAKE_CURRENT_SOURCE_DIR}/libwebp/src/dec/*c - ) - - FILE(GLOB WEBP_DEMUX_SRCS - RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} - ${CMAKE_CURRENT_SOURCE_DIR}/libwebp/src/demux/*c - ) - - FILE(GLOB WEBP_DSP_SRCS - RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} - ${CMAKE_CURRENT_SOURCE_DIR}/libwebp/src/dsp/*c - ) - - FILE(GLOB WEBP_ENC_SRCS - RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} - ${CMAKE_CURRENT_SOURCE_DIR}/libwebp/src/enc/*c - ) - - FILE(GLOB WEBP_UTILS_SRCS - RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} - ${CMAKE_CURRENT_SOURCE_DIR}/libwebp/src/utils/*c - ) - - FILE(GLOB WEBP_MUX_SRCS - RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} - ${CMAKE_CURRENT_SOURCE_DIR}/libwebp/src/mux/*c - ) - SET(WEBP_SOURCE ${WEBP_DEC_SRCS} ${WEBP_DEMUX_SRCS} ${WEBP_DSP_SRCS} ${WEBP_ENC_SRCS} ${WEBP_UTILS_SRCS} ${WEBP_MUX_SRC}) - SET(WEBP_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/libwebp/src) - add_definitions(-DWITH_WEBP) + pkg_check_modules(WEBP libwebp) + IF(WEBP_FOUND) + add_definitions(-DWITH_WEBP) + ELSE(WEBP_FOUND) + message(FATAL_ERROR "libwebp was not found. It's mandatory when used with ENABLE_WEBP enabled.") + ENDIF(WEBP_FOUND) ENDIF(ENABLE_WEBP) @@ -439,9 +409,9 @@ ELSE() set(EXE_NAME ${CMAKE_PROJECT_NAME}) - link_directories(${LIBRAW_LIBRARY_DIRS} ${OpenCV_LIBRARY_DIRS} ${EXIV2_LIBRARY_DIRS}) - add_executable(${EXE_NAME} WIN32 MACOSX_BUNDLE ${NOMACS_SOURCES} ${NOMACS_UI} ${NOMACS_MOC_SRC} ${NOMACS_RCC} ${NOMACS_HEADERS} ${NOMACS_RC} ${NOMACS_QM} ${NOMACS_TRANSLATIONS} ${LIBQPSD_SOURCES} ${LIBQPSD_HEADERS} ${LIBQPSD_MOC_SRC} ${WEBP_SOURCE}) - target_link_libraries(${EXE_NAME} ${QT_QTCORE_LIBRARY} ${QT_QTGUI_LIBRARY} ${QT_QTNETWORK_LIBRARY} ${QT_QTMAIN_LIBRARY} ${EXIV2_LIBRARIES} ${LIBRAW_LIBRARIES} ${OpenCV_LIBS} ${VERSION_LIB} ${TIFF_LIBRARIES}) + link_directories(${LIBRAW_LIBRARY_DIRS} ${OpenCV_LIBRARY_DIRS} ${EXIV2_LIBRARY_DIRS} ${WEBP_LIBRARY_DIRS}) + add_executable(${EXE_NAME} WIN32 MACOSX_BUNDLE ${NOMACS_SOURCES} ${NOMACS_UI} ${NOMACS_MOC_SRC} ${NOMACS_RCC} ${NOMACS_HEADERS} ${NOMACS_RC} ${NOMACS_QM} ${NOMACS_TRANSLATIONS} ${LIBQPSD_SOURCES} ${LIBQPSD_HEADERS} ${LIBQPSD_MOC_SRC}) + target_link_libraries(${EXE_NAME} ${QT_QTCORE_LIBRARY} ${QT_QTGUI_LIBRARY} ${QT_QTNETWORK_LIBRARY} ${QT_QTMAIN_LIBRARY} ${EXIV2_LIBRARIES} ${LIBRAW_LIBRARIES} ${OpenCV_LIBS} ${VERSION_LIB} ${TIFF_LIBRARIES} ${WEBP_LIBRARIES}) IF (CMAKE_SYSTEM_NAME MATCHES "Linux") SET_TARGET_PROPERTIES(${EXE_NAME} PROPERTIES LINK_FLAGS -fopenmp) --- CMakeLists.txt.orig 2014-01-14 12:57:49.174392532 +0400 +++ CMakeLists.txt 2014-01-14 12:58:02.554393698 +0400 @@ -276,7 +276,7 @@ ${OpenCV_INCLUDE_DIRS} ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_SOURCE_DIR}/src - ${WEBP_INCLUDE_DIR} + ${WEBP_INCLUDE_DIRS} ${TIFF_INCLUDE_DIR} ${TIFF_CONFIG_DIR} )