cadMousePro-daemon/src/CMakeLists.txt
author František Kučera <franta-hg@frantovo.cz>
Thu, 29 Aug 2019 17:57:30 +0200
branchv_0
changeset 12 cf77c218b0b1
parent 8 465572518625
child 13 52d92c1b340e
permissions -rw-r--r--
D-Bus interface
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
0
6ff501639c23 project skeleton, open USB HID device
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     1
set(EXECUTABLE_FILE "cadMousePro")
6ff501639c23 project skeleton, open USB HID device
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     2
6ff501639c23 project skeleton, open USB HID device
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     3
# USB libraries:
6ff501639c23 project skeleton, open USB HID device
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     4
INCLUDE(FindPkgConfig)
12
cf77c218b0b1 D-Bus interface
František Kučera <franta-hg@frantovo.cz>
parents: 8
diff changeset
     5
cf77c218b0b1 D-Bus interface
František Kučera <franta-hg@frantovo.cz>
parents: 8
diff changeset
     6
# Qt libraries:
cf77c218b0b1 D-Bus interface
František Kučera <franta-hg@frantovo.cz>
parents: 8
diff changeset
     7
set(CMAKE_INCLUDE_CURRENT_DIR ON) # Find includes in corresponding build directories
cf77c218b0b1 D-Bus interface
František Kučera <franta-hg@frantovo.cz>
parents: 8
diff changeset
     8
set(CMAKE_AUTOMOC ON) # Instruct CMake to run moc automatically when needed
cf77c218b0b1 D-Bus interface
František Kučera <franta-hg@frantovo.cz>
parents: 8
diff changeset
     9
set(CMAKE_AUTOUIC ON) # Create code from a list of Qt designer ui files
cf77c218b0b1 D-Bus interface
František Kučera <franta-hg@frantovo.cz>
parents: 8
diff changeset
    10
find_package(Qt5 CONFIG REQUIRED Core DBus)
cf77c218b0b1 D-Bus interface
František Kučera <franta-hg@frantovo.cz>
parents: 8
diff changeset
    11
0
6ff501639c23 project skeleton, open USB HID device
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    12
pkg_check_modules (USB_LIBS hidapi-hidraw)
6ff501639c23 project skeleton, open USB HID device
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    13
include_directories(${USB_LIBS_INCLUDE_DIRS})
6ff501639c23 project skeleton, open USB HID device
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    14
link_directories(${USB_LIBS_LIBRARY_DIRS})
6ff501639c23 project skeleton, open USB HID device
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    15
6ff501639c23 project skeleton, open USB HID device
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    16
# Add ASan AddressSanitizer
6ff501639c23 project skeleton, open USB HID device
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    17
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -fno-omit-frame-pointer -fsanitize=address")
6ff501639c23 project skeleton, open USB HID device
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    18
set(CMAKE_LINKER_FLAGS_DEBUG "${CMAKE_LINKER_FLAGS_DEBUG} -fno-omit-frame-pointer -fsanitize=address")
6ff501639c23 project skeleton, open USB HID device
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    19
6ff501639c23 project skeleton, open USB HID device
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    20
# Executable output:
6ff501639c23 project skeleton, open USB HID device
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    21
add_executable(
6ff501639c23 project skeleton, open USB HID device
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    22
	${EXECUTABLE_FILE}
12
cf77c218b0b1 D-Bus interface
František Kučera <franta-hg@frantovo.cz>
parents: 8
diff changeset
    23
	Daemon.h
cf77c218b0b1 D-Bus interface
František Kučera <franta-hg@frantovo.cz>
parents: 8
diff changeset
    24
	generated-sources/DBusAdaptor.h
cf77c218b0b1 D-Bus interface
František Kučera <franta-hg@frantovo.cz>
parents: 8
diff changeset
    25
	generated-sources/DBusAdaptor.cpp
0
6ff501639c23 project skeleton, open USB HID device
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    26
	cadMousePro.cpp
6ff501639c23 project skeleton, open USB HID device
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    27
)
6ff501639c23 project skeleton, open USB HID device
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    28
6ff501639c23 project skeleton, open USB HID device
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    29
# Link libraries:
12
cf77c218b0b1 D-Bus interface
František Kučera <franta-hg@frantovo.cz>
parents: 8
diff changeset
    30
target_link_libraries(${EXECUTABLE_FILE} ${USB_LIBS_LIBRARIES} Qt5::DBus)
0
6ff501639c23 project skeleton, open USB HID device
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    31
set_property(TARGET ${EXECUTABLE_FILE} PROPERTY INSTALL_RPATH_USE_LINK_PATH TRUE)