-
Notifications
You must be signed in to change notification settings - Fork 171
/
CMakeLists.txt
71 lines (59 loc) · 2.04 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
# qimgv root
cmake_minimum_required(VERSION 3.13)
project(qimgv
VERSION 1.0.2
HOMEPAGE_URL "https://github.com/easymodo/qimgv"
LANGUAGES CXX)
message(STATUS "Build configuration: " ${CMAKE_BUILD_TYPE})
# check for gcc
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND
CMAKE_CXX_COMPILER_VERSION VERSION_LESS 9.0)
message(FATAL_ERROR "\n!!! THIS PROJECT REQUIRES GCC 9.0 OR LATER !!!\n")
endif()
# AUTOMOC
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_AUTOUIC ON)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
# USER OPTIONS
# Usage: cmake -DVIDEO_SUPPORT=ON [...]
option(EXIV2 "For reading/writing exif tags" ON)
option(VIDEO_SUPPORT "Enable video support" ON)
option(OPENCV_SUPPORT "Enable HQ scaling via OpenCV" ON)
option(KDE_SUPPORT "Support blur when using KDE" OFF)
if(UNIX AND NOT APPLE)
set(QT_EXTERN_PATH "" CACHE STRING "Tell compile external QT path, example: (/opt/Qt/6.2.0/gcc_64)")
string(COMPARE EQUAL "${QT_EXTERN_PATH}" "" result)
if (NOT result)
set(CMAKE_INSTALL_RPATH "${QT_EXTERN_PATH}/lib")
endif()
endif()
# FIND PACKAGES
find_package(Qt5 COMPONENTS Widgets QUIET)
if(Qt5_FOUND)
find_package(QT NAMES Qt5 REQUIRED COMPONENTS Core Widgets Svg PrintSupport)
else()
find_package(QT NAMES Qt6 REQUIRED COMPONENTS Core Widgets Svg PrintSupport OpenGLWidgets)
endif()
message(STATUS "Qt Version: " ${QT_VERSION})
if(QT_VERSION_MAJOR GREATER_EQUAL 6)
find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Core Widgets Svg PrintSupport OpenGLWidgets)
else()
find_package(Qt${QT_VERSION_MAJOR} 5.12 REQUIRED COMPONENTS Core Widgets Svg PrintSupport)
endif()
if(EXIV2)
find_package(PkgConfig REQUIRED)
pkg_check_modules(Exiv2 REQUIRED IMPORTED_TARGET exiv2)
endif()
if(KDE_SUPPORT)
find_package(KF5WindowSystem REQUIRED)
endif()
if(OPENCV_SUPPORT)
find_package(PkgConfig REQUIRED)
find_package(OpenCV REQUIRED core imgproc)
endif()
##############################################################
add_subdirectory(qimgv)
if(VIDEO_SUPPORT)
add_subdirectory(plugins/player_mpv)
endif()