author | František Kučera <franta-hg@frantovo.cz> |
Tue, 03 Sep 2019 00:43:12 +0200 | |
branch | v_0 |
changeset 18 | 7323a89c15e9 |
parent 16 | 2705911938b4 |
child 21 | 642f32f76c9d |
permissions | -rw-r--r-- |
14 | 1 |
set(EXECUTABLE_FILE "cadMousePro-gui") |
2 |
||
3 |
# Qt libraries: |
|
4 |
set(CMAKE_INCLUDE_CURRENT_DIR ON) # Find includes in corresponding build directories |
|
5 |
set(CMAKE_AUTOMOC ON) # Instruct CMake to run moc automatically when needed |
|
6 |
set(CMAKE_AUTOUIC ON) # Create code from a list of Qt designer ui files |
|
7 |
find_package(Qt5 CONFIG REQUIRED Core DBus) |
|
15 | 8 |
find_package(Qt5Widgets CONFIG REQUIRED) |
14 | 9 |
|
10 |
# Add ASan AddressSanitizer |
|
11 |
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -fno-omit-frame-pointer -fsanitize=address") |
|
12 |
set(CMAKE_LINKER_FLAGS_DEBUG "${CMAKE_LINKER_FLAGS_DEBUG} -fno-omit-frame-pointer -fsanitize=address") |
|
13 |
||
14 |
# Generate C++ interface classes from D-Bus XML: |
|
15 |
file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/generated-sources/) |
|
16 |
set(DBUS_XML ${CMAKE_CURRENT_SOURCE_DIR}/../../d-bus/info.globalcode.mouse.cadMousePro.xml) |
|
17 |
set(GENERATED_SOURCES ${CMAKE_CURRENT_BINARY_DIR}/generated-sources/) |
|
18 |
add_custom_command( |
|
19 |
DEPENDS ${DBUS_XML} |
|
20 |
OUTPUT ${GENERATED_SOURCES}/Proxy.h |
|
21 |
OUTPUT ${GENERATED_SOURCES}/Proxy.cpp |
|
22 |
COMMAND qdbusxml2cpp -p Proxy.h:Proxy.cpp ${DBUS_XML} |
|
23 |
WORKING_DIRECTORY ${GENERATED_SOURCES} |
|
24 |
) |
|
25 |
cmake_policy(SET CMP0071 NEW) # Let AUTOMOC and AUTOUIC process GENERATED files. |
|
26 |
||
27 |
# Executable output: |
|
28 |
add_executable( |
|
29 |
${EXECUTABLE_FILE} |
|
30 |
${CMAKE_CURRENT_BINARY_DIR}/generated-sources/Proxy.h |
|
31 |
${CMAKE_CURRENT_BINARY_DIR}/generated-sources/Proxy.cpp |
|
15 | 32 |
MouseMainWindow.h |
16
2705911938b4
GUI for mouse configuration over D-Bus daemon
František Kučera <franta-hg@frantovo.cz>
parents:
15
diff
changeset
|
33 |
MouseMainWindow.cpp |
14 | 34 |
cadMouseProGUI.cpp |
35 |
) |
|
36 |
||
37 |
# Link libraries: |
|
38 |
target_link_libraries(${EXECUTABLE_FILE} Qt5::DBus) |
|
15 | 39 |
target_link_libraries(${EXECUTABLE_FILE} Qt5::Widgets) |
14 | 40 |
set_property(TARGET ${EXECUTABLE_FILE} PROPERTY INSTALL_RPATH_USE_LINK_PATH TRUE) |