-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
63 lines (55 loc) · 1.56 KB
/
CMakeLists.txt
File metadata and controls
63 lines (55 loc) · 1.56 KB
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
rock_find_qt4(OPTIONAL QtCore QtGui QtDesigner)
rock_find_qt5(OPTIONAL Core Gui Widgets UiPlugin)
include(RockQt)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
SET(MOC_HDRS
MyWidget.h
MyWidgetPlugin.h
)
SET(INSTALLED_HDRS
MyWidget.h
)
SET(SRCS
MyWidget.cc
MyWidgetPlugin.cc
)
# Alternatively, FILE(GLOB) can find any matching file in the directory.
# For this reason, the mywidgetTest executable uses main.cpp instead of main.cc.
#FILE(GLOB SRCS
# *.cc
#)
SET(QtApp_RCCS resources.qrc)
if(ROCK_QT4)
QT4_ADD_RESOURCES(QtApp_RCC_SRCS_QT4 ${QtApp_RCCS})
endif()
if(ROCK_QT5)
QT5_ADD_RESOURCES(QtApp_RCC_SRCS_QT5 ${QtApp_RCCS})
endif()
rock_qt_vizkit_widget(
TARGETPREFIX MyWidget
QT4_SUFFIX ""
SOURCES ${SRCS}
SOURCES_QT4 ${QtApp_RCC_SRCS_QT4}
SOURCES_QT5 ${QtApp_RCC_SRCS_QT5}
HEADERS ${INSTALLED_HDRS}
MOC ${MOC_HDRS}
DEPS_PKGCONFIG base-types base-lib
# Using the cmake targets for target_link_libraries but the
# pkgconfig packages in the .pc file.
# equivalent pkgconfig based configuration:
# DEPS_PKGCONFIG_QT4 QtCore QtGui
# DEPS_PKGCONFIG_QT5 Qt5Core Qt5Gui Qt5Widgets
# above will also add the dependencies to the .pc file, so they
# are not needed in the .pc.in.
LIBS_QT4 Qt4::QtCore Qt4::QtGui
LIBS_QT5 Qt5::Core Qt5::Gui Qt5::Widgets
# for include directories. These do not need to be added to the .pc files,
# the INSTALLED_HDRS do not use them.
LIBS_QT4 Qt4::QtDesigner
LIBS_QT5 Qt5::UiPlugin
)
rock_qt_executable(
TARGETPREFIX mywidgetTest
QT4_SUFFIX ""
SOURCES main.cpp
DEPS_QT MyWidget)