forked from rossy/SMPlayer2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
62 lines (48 loc) · 1.82 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
cmake_minimum_required(VERSION 2.6)
include(cmake/Summary.cmake)
project(smplayer2)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${PROJECT_SOURCE_DIR}/cmake)
find_program(QT_LRELEASE_EXECUTABLE NAMES lrelease PATHS ${QT_BINARY_DIR} NO_DEFAULT_PATH)
find_program(QT_LRELEASE_EXECUTABLE NAMES lrelease)
set(SMPLAYER2_VERSION_MAJOR 0)
set(SMPLAYER2_VERSION_MINOR 7)
set(SMPLAYER2_VERSION_RELEASE 3)
execute_process(COMMAND ${PROJECT_SOURCE_DIR}/version.sh WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
OUTPUT_VARIABLE SMPLAYER2_VERSION_GITREV OUTPUT_STRIP_TRAILING_WHITESPACE
)
set(SMPLAYER2_VERSION "${SMPLAYER2_VERSION_MAJOR}.${SMPLAYER2_VERSION_MINOR}.${SMPLAYER2_VERSION_RELEASE}${SMPLAYER2_VERSION_GITREV}")
add_definitions("-Wall -pedantic -std=c++0x")
if (MINGW)
add_definitions("-U__STRICT_ANSI__")
endif()
find_package(Quazip)
if (QUAZIP_FOUND)
option(ENABLE_DOWNLOAD_SUBS "Enable subtitle downloader (requires QuaZip)" ON)
option(QUAZIP_STATIC "Enable this if QuaZip has been built as a static library" OFF)
endif()
option(DEBUG_OUTPUT "Enable debug output on terminal" OFF)
if (ENABLE_DOWNLOAD_SUBS AND QUAZIP_FOUND)
set(HAVE_DOWNLOAD_SUBS ON)
if (QUAZIP_STATIC)
add_definitions(-DQUAZIP_STATIC)
endif()
endif()
if (NOT DEBUG_OUTPUT)
add_definitions(-DNO_DEBUG_ON_CONSOLE)
endif()
option(ENABLE_DBUS "Enable D-Bus. Required for MPRIS2 support." ON)
add_subdirectory(src)
add_subdirectory(icons)
summary_add("MPRIS2 Support" ENABLE_DBUS)
summary_add("Subtitle downloader" HAVE_DOWNLOAD_SUBS)
summary_show()
install(FILES smplayer2.desktop
DESTINATION share/applications
)
# uninstall target
configure_file(
"${CMAKE_CURRENT_SOURCE_DIR}/cmake_uninstall.cmake.in"
"${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake"
IMMEDIATE @ONLY)
add_custom_target(uninstall
COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake)