forked from hzeller/timg
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
61 lines (46 loc) · 2.47 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
cmake_minimum_required(VERSION 3.10)
project(timg VERSION 1.4.2 LANGUAGES CXX)
option(WITH_VIDEO_DECODING "Enables video decoding feature" ON)
option(WITH_VIDEO_DEVICE "Enables reading videos from devices e.g. v4l2 (requires WITH_VIDEO_DECODING)" ON)
option(WITH_OPENSLIDE_SUPPORT "Enables support to scientific OpenSlide formats" OFF)
# Options that should be typically on, but could be disabled for special
# applications where less dependencies are required
option(WITH_GRAPHICSMAGICK "Enable general image loading with Graphicsmagick. You typically want this." ON)
option(WITH_TURBOJPEG "Optimized JPEG loading. You typically want this." ON)
option(WITH_TERMINAL_QUERY "Query terminals for availability of kitty/iterm capabilities and background color. If not compiled in, choose with -p (pixelation) and -b (background)" ON)
option(WITH_STB_IMAGE "Use STB image, a self-contained albeit limited image loading and lower quality. Use if WITH_GRAPHICSMAGICK is not possible and want to limit dependencies." OFF)
# Note: The version string can be ammended with -DDISTRIBUTION_VERSION, see src/timg-version.h.in
option(TIMG_VERSION_FROM_GIT "Get the program version from the git repository" ON)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
include(FindPkgConfig)
include(GNUInstallDirs)
if(TIMG_VERSION_FROM_GIT)
find_package(Git REQUIRED)
include(GetGitRevisionDescription)
endif()
pkg_check_modules(ZLIB REQUIRED IMPORTED_TARGET zlib)
if(WITH_TURBOJPEG)
pkg_check_modules(TURBOJPEG REQUIRED IMPORTED_TARGET libturbojpeg)
pkg_check_modules(EXIF REQUIRED IMPORTED_TARGET libexif)
pkg_check_modules(AVUTIL REQUIRED IMPORTED_TARGET libavutil)
pkg_check_modules(SWSCALE IMPORTED_TARGET REQUIRED libswscale)
endif()
if(WITH_GRAPHICSMAGICK)
pkg_check_modules(GRAPHICSMAGICKXX IMPORTED_TARGET REQUIRED GraphicsMagick++)
endif()
if(WITH_OPENSLIDE_SUPPORT)
pkg_check_modules(OPENSLIDE IMPORTED_TARGET REQUIRED openslide)
pkg_check_modules(AVUTIL REQUIRED IMPORTED_TARGET libavutil)
pkg_check_modules(SWSCALE IMPORTED_TARGET REQUIRED libswscale)
endif()
if(WITH_VIDEO_DECODING)
pkg_check_modules(LIBAV IMPORTED_TARGET REQUIRED libavcodec libavutil libavformat)
pkg_check_modules(AVUTIL REQUIRED IMPORTED_TARGET libavutil)
pkg_check_modules(SWSCALE IMPORTED_TARGET REQUIRED libswscale)
if (WITH_VIDEO_DEVICE)
pkg_check_modules(LIBAV_DEVICE IMPORTED_TARGET REQUIRED libavdevice)
endif()
endif()
find_package(Threads)
add_subdirectory(src)
add_subdirectory(man)