-
Notifications
You must be signed in to change notification settings - Fork 67
/
Copy pathCMakeLists.txt
63 lines (44 loc) · 1.58 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
cmake_minimum_required(VERSION 3.0)
project(deepin-movie-reborn)
option(USE_DXCB "integration with dxcb platform plugin" OFF)
option(DMR_DEBUG "turn on debug output" off)
option(DTK_DMAN_PORTAL "turn on dman portal support" off)
execute_process(COMMAND uname -m OUTPUT_VARIABLE MACH
ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE)
if (CMAKE_BUILD_TYPE STREQUAL "Debug")
set(DMR_DEBUG on)
endif()
if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
endif()
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_EXPORT_COMPILE_COMMANDS on)
find_package(PkgConfig REQUIRED)
pkg_check_modules(MPRIS REQUIRED IMPORTED_TARGET mpris-qt5)
# test deepin fork mpris-qt5
try_compile(USE_FORK_MPRIS
${CMAKE_CURRENT_BINARY_DIR}/try_compile
SOURCES
${CMAKE_CURRENT_SOURCE_DIR}/tests/mpris_test.cc
LINK_LIBRARIES
PkgConfig::MPRIS
OUTPUT_VARIABLE TRY_COMPILE_OUTPUT
)
message(STATUS "use deepin fork mpris-qt5: ${USE_FORK_MPRIS}")
if(USE_FORK_MPRIS)
add_definitions(-DUSE_FORK_MPRIS)
endif()
# Find includes in corresponding build directories
set(CMAKE_INCLUDE_CURRENT_DIR ON)
include_directories(${PROJECT_BINARY_DIR})
include_directories(${PROJECT_SOURCE_DIR})
include(GNUInstallDirs)
if (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
set(CMAKE_INSTALL_PREFIX /usr)
endif()
configure_file(${PROJECT_SOURCE_DIR}/config.h.in ${PROJECT_BINARY_DIR}/config.h @ONLY)
add_subdirectory(src)
add_subdirectory(examples/test)
if (CMAKE_BUILD_TYPE STREQUAL "Debug")
add_subdirectory(tests)
endif()