CMakeLists.txt 1.9 KB
Newer Older
Hrvoje Senjan's avatar
Hrvoje Senjan committed
1
project(ffmpegthumbs)
2

Hrvoje Senjan's avatar
Hrvoje Senjan committed
3
4
cmake_minimum_required(VERSION 2.8.12 FATAL_ERROR)
set(QT_MIN_VERSION "5.2.0")
5

Hrvoje Senjan's avatar
Hrvoje Senjan committed
6
7
8
9
10
11
12
find_package(ECM 1.0.0 REQUIRED NO_MODULE)
set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH} ${ECM_KDE_MODULE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/cmake)

include(FeatureSummary)
include(WriteBasicConfigVersionFile)
include(KDEInstallDirs)
include(KDECMakeSettings)
13
include(KDECompilerSettings NO_POLICY_SCOPE)
Hrvoje Senjan's avatar
Hrvoje Senjan committed
14

15
16
find_package(Qt5 ${QT_MIN_VERSION} CONFIG REQUIRED COMPONENTS Core Gui)
find_package(KF5 REQUIRED COMPONENTS KIO I18n Config)
17
find_package(FFmpeg COMPONENTS AVCODEC AVFORMAT SWSCALE)
18
find_package(Taglib REQUIRED)
19

20
include_directories(
21
    ${CMAKE_CURRENT_BINARY_DIR}
22
23
    ${PC_AVCODEC_INCLUDEDIR}
    ${PC_AVFORMAT_INCLUDEDIR}
24
25
26
    ${FFMPEG_INCLUDE_DIR}
    )

27
# Certain versions of FFMPEG need this to be defined
28
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D __STDC_CONSTANT_MACROS")
29

30
31
add_definitions(-DTRANSLATION_DOMAIN=\"ffmpegthumbs\")

32
set( ffmpegthumbs_PART_SRCS
33
34
35
36
37
38
39
  ffmpegthumbnailer.cpp
  ffmpegthumbnailer/filmstripfilter.cpp
  ffmpegthumbnailer/moviedecoder.cpp
  ffmpegthumbnailer/imagewriter.cpp
  ffmpegthumbnailer/videothumbnailer.cpp
)

40
kconfig_add_kcfg_files(ffmpegthumbs_PART_SRCS ffmpegthumbnailersettings5.kcfgc)
Hrvoje Senjan's avatar
Hrvoje Senjan committed
41
add_library(ffmpegthumbs MODULE ${ffmpegthumbs_PART_SRCS})
42

43
target_link_libraries(ffmpegthumbs Qt5::Core Qt5::Gui KF5::KIOWidgets KF5::KIOCore KF5::I18n KF5::ConfigCore KF5::ConfigGui ${AVUTIL_LIBRARIES} ${AVFILTER_LIBRARIES} ${AVFORMAT_LIBRARIES} ${AVCODEC_LIBRARIES} ${SWSCALE_LIBRARIES} Taglib::Taglib )
44

45
install(FILES ffmpegthumbnailersettings5.kcfg DESTINATION ${KCFG_INSTALL_DIR})
46
47
48
49
50
51
install(TARGETS ffmpegthumbs DESTINATION ${PLUGIN_INSTALL_DIR})

########### install files ###############

install(FILES  ffmpegthumbs.desktop DESTINATION ${SERVICES_INSTALL_DIR})

52
install(FILES org.kde.ffmpegthumbs.metainfo.xml
53
54
        DESTINATION ${KDE_INSTALL_METAINFODIR})

Hrvoje Senjan's avatar
Hrvoje Senjan committed
55
56
57
if(BUILD_TESTING)
    add_subdirectory(tests)
endif()