forked from tomahawk-player/tomahawk
-
Notifications
You must be signed in to change notification settings - Fork 0
/
TomahawkUse.cmake.in
110 lines (84 loc) · 2.75 KB
/
TomahawkUse.cmake.in
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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
#FIXME: this duplicates top level cmakelists: how can we reduce code duplication?
set( TOMAHAWK_QT5 @TOMAHAWK_QT5@ )
if(TOMAHAWK_QT5)
# CMAKE 2.8.13+/3.0.0+ requires these for IMPORTed targets
find_package(Qt5Core REQUIRED)
find_package(Qt5Concurrent REQUIRED)
find_package(Qt5Svg REQUIRED)
find_package(Qt5UiTools REQUIRED)
find_package(Qt5WebKitWidgets REQUIRED)
find_package(Qt5Widgets REQUIRED)
find_package(Qt5Xml REQUIRED)
find_package(Qt5Sql REQUIRED)
macro(qt_wrap_ui)
qt5_wrap_ui(${ARGN})
endmacro()
macro(qt_add_resources)
qt5_add_resources(${ARGN})
endmacro()
find_package(Qt5LinguistTools REQUIRED)
macro(qt_add_translation)
qt5_add_translation(${ARGN})
endmacro()
if( UNIX AND NOT APPLE )
# We need this to find the paths to qdbusxml2cpp and co
find_package(Qt5DBus REQUIRED)
endif()
if(APPLE)
find_package(Qt5MacExtras REQUIRED)
endif()
if(WIN32)
find_package(Qt5WinExtras REQUIRED)
endif()
macro(qt_wrap_ui)
qt5_wrap_ui(${ARGN})
endmacro()
macro(qt_add_resources)
qt5_add_resources(${ARGN})
endmacro()
find_package(Qt5LinguistTools REQUIRED)
macro(qt_add_translation)
qt5_add_translation(${ARGN})
endmacro()
if( UNIX AND NOT APPLE )
macro(qt_add_dbus_interface)
qt5_add_dbus_interface(${ARGN})
endmacro()
macro(qt_add_dbus_adaptor)
qt5_add_dbus_adaptor(${ARGN})
endmacro()
endif()
macro(setup_qt)
endmacro()
set(QT_RCC_EXECUTABLE "${Qt5Core_RCC_EXECUTABLE}")
#FIXME: CrashReporter depends on deprecated QHttp
set(WITH_KDE4 OFF)
else(TOMAHAWK_QT5)
find_package(Qt4 COMPONENTS QtNetwork QtCore QtGui QtSql REQUIRED)
include( ${QT_USE_FILE} )
set(NEEDED_QT4_COMPONENTS "QtCore" "QtXml" "QtNetwork")
if(BUILD_GUI OR NOT DEFINED BUILD_GUI)
list(APPEND NEEDED_QT4_COMPONENTS "QtGui" "QtWebkit" "QtUiTools" "QtSvg")
endif()
find_package(Qt4 4.7.0 COMPONENTS ${NEEDED_QT4_COMPONENTS})
include( ${QT_USE_FILE} )
macro(qt5_use_modules)
endmacro()
macro(qt_wrap_ui)
qt4_wrap_ui(${ARGN})
endmacro()
macro(qt_add_resources)
qt4_add_resources(${ARGN})
endmacro()
macro(qt_add_translation)
qt4_add_translation(${ARGN})
endmacro()
endif(TOMAHAWK_QT5)
if(NOT TOMAHAWK_CMAKE_DIR)
set(TOMAHAWK_CMAKE_DIR ${CMAKE_CURRENT_LIST_DIR})
endif()
include( "${TOMAHAWK_CMAKE_DIR}/TomahawkAddLibrary.cmake" )
include( "${TOMAHAWK_CMAKE_DIR}/TomahawkAddPlugin.cmake" )
add_definitions( ${TOMAHAWK_DEFINITIONS} )
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${TOMAHAWK_CXX_FLAGS}")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${TOMAHAWK_C_FLAGS}")