forked from MadFishTheOne/qtpanel
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
70 lines (70 loc) · 1.93 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
cmake_minimum_required(VERSION 2.8.3)
project(qtpanel)
find_package(X11 REQUIRED)
option(USE_QT5 "Build against Qt5 instead of Qt4." ON)
if(USE_QT5)
message(STATUS "Use Qt5")
find_package(Qt5Core REQUIRED)
find_package(Qt5Widgets REQUIRED)
find_package(Qt5X11Extras REQUIRED)
else()
find_package(Qt4 REQUIRED)
endif()
set(qtpanel_UIS
panelapplicationsettings.ui
)
set(qtpanel_HEADERS
dpisupport.h
iconloader.h
textgraphicsitem.h
animationutils.h
)
set(qtpanel_MOC_HEADERS
x11support.h
desktopapplications.h
panelapplication.h
panelwindow.h
applet.h
demoapplet.h
spacerapplet.h
clockapplet.h
applicationsmenuapplet.h
dockapplet.h
trayapplet.h
)
set(qtpanel_SOURCES
dpisupport.cpp
iconloader.cpp
x11support.cpp
desktopapplications.cpp
main.cpp
panelapplication.cpp
panelwindow.cpp
textgraphicsitem.cpp
applet.cpp
demoapplet.cpp
spacerapplet.cpp
clockapplet.cpp
applicationsmenuapplet.cpp
dockapplet.cpp
trayapplet.cpp
)
if(USE_QT5)
include_directories(${Qt5Widgets_INCLUDE_DIRS} ${Qt5Widgets_LIBRARIES} ${Qt5X11Extras_INCLUDE_DIRS} ${Qt5X11Extras_LIBRARIES} ${Qt5Declarative_INCLUDE_DIRS} ${Qt5Declarative_LIBRARIES})
add_definitions(${Qt5Widgets_DEFINITIONS})
add_definitions(${Qt5X11Extras_DEFINITIONS})
qt5_wrap_ui(qtpanel_UI_HEADERS ${qtpanel_UIS})
qt5_wrap_cpp(qtpanel_MOC_OUTPUT ${qtpanel_MOC_HEADERS})
else()
include(${QT_USE_FILE})
add_definitions(${QT_DEFINITIONS})
qt4_wrap_ui(qtpanel_UI_HEADERS ${qtpanel_UIS})
qt4_wrap_cpp(qtpanel_MOC_OUTPUT ${qtpanel_MOC_HEADERS})
endif()
include_directories(${CMAKE_BINARY_DIR})
add_executable(qtpanel ${qtpanel_SOURCES} ${qtpanel_MOC_OUTPUT} ${qtpanel_HEADERS} ${qtpanel_UI_HEADERS})
if(USE_QT5)
target_link_libraries(qtpanel Qt5::Widgets Qt5::X11Extras ${X11_LIBRARIES} ${X11_Xcomposite_LIB} ${X11_Xdamage_LIB})
else()
target_link_libraries(qtpanel ${QT_LIBRARIES} ${X11_LIBRARIES} ${X11_Xcomposite_LIB} ${X11_Xdamage_LIB})
endif()