--- a/.hgignore Thu Aug 29 17:57:30 2019 +0200
+++ b/.hgignore Thu Aug 29 19:21:45 2019 +0200
@@ -10,4 +10,4 @@
^[^/]+/dist/
^[^/]+/build/
^[^/]+/nbproject/private/
-^[^/]+/src/generated-sources/
+
--- a/cadMousePro-daemon/nbproject/configurations.xml Thu Aug 29 17:57:30 2019 +0200
+++ b/cadMousePro-daemon/nbproject/configurations.xml Thu Aug 29 19:21:45 2019 +0200
@@ -59,9 +59,6 @@
</df>
</df>
<df name="src">
- <df name="generated-sources">
- <in>DBusAdaptor.cpp</in>
- </df>
<in>Daemon.h</in>
<in>cadMousePro.cpp</in>
</df>
@@ -122,7 +119,7 @@
<buildCommandWorkingDir>build/Debug</buildCommandWorkingDir>
<buildCommand>${MAKE} -f Makefile</buildCommand>
<cleanCommand>${MAKE} -f Makefile clean</cleanCommand>
- <executablePath>build/Debug/src/welcome</executablePath>
+ <executablePath>build/Debug/src/cadMousePro</executablePath>
</makeTool>
<preBuild>
<preBuildCommandWorkingDir>build/Debug</preBuildCommandWorkingDir>
@@ -130,13 +127,6 @@
<preBuildFirst>true</preBuildFirst>
</preBuild>
</makefileType>
- <item path="/home/fiki/projekty/spacenav/cadMousePro/cadMousePro-daemon/src/generated-sources/DBusAdaptor.cpp"
- ex="false"
- tool="1"
- flavor2="8">
- <ccTool flags="0">
- </ccTool>
- </item>
<item path="/usr/share/cmake-3.10/Modules/CMakeCXXCompilerABI.cpp"
ex="false"
tool="1"
@@ -145,6 +135,13 @@
<item path="build/Debug/src/DBusAdaptor.cpp" ex="false" tool="1" flavor2="8">
<ccTool flags="0">
<incDir>
+ <pElem>/usr/include/hidapi</pElem>
+ <pElem>/usr/include/x86_64-linux-gnu/qt5</pElem>
+ <pElem>/usr/include/x86_64-linux-gnu/qt5/QtDBus</pElem>
+ <pElem>/usr/include/x86_64-linux-gnu/qt5/QtCore</pElem>
+ <pElem>/usr/lib/x86_64-linux-gnu/qt5/mkspecs/linux-g++</pElem>
+ <pElem>build/Debug/src</pElem>
+ <pElem>src</pElem>
<pElem>build/Debug/src/cadMousePro_autogen/include</pElem>
</incDir>
</ccTool>
@@ -213,11 +210,20 @@
</preprocessorList>
</ccTool>
</folder>
+ <folder path="0/build/Debug/src/generated-sources">
+ <ccTool>
+ <incDir>
+ <pElem>build/Debug/src/cadMousePro_autogen/include</pElem>
+ </incDir>
+ </ccTool>
+ </folder>
<folder path="0/build/qt">
<ccTool>
<incDir>
<pElem>src</pElem>
<pElem>build/qt/src/cadMousePro_autogen/EWIEGA46WW</pElem>
+ <pElem>build/qt/src/cadMousePro_autogen/7JU4VIX55Q</pElem>
+ <pElem>src/generated-sources</pElem>
<pElem>build/qt/src/cadMousePro_autogen</pElem>
<pElem>build/qt/src</pElem>
</incDir>
@@ -298,7 +304,7 @@
<buildCommandWorkingDir>build/Release</buildCommandWorkingDir>
<buildCommand>${MAKE} -f Makefile</buildCommand>
<cleanCommand>${MAKE} -f Makefile clean</cleanCommand>
- <executablePath>build/Release/src/welcome</executablePath>
+ <executablePath>build/Release/src/cadMousePro</executablePath>
<ccTool>
<incDir>
<pElem>build/Release/src</pElem>
--- a/cadMousePro-daemon/src/CMakeLists.txt Thu Aug 29 17:57:30 2019 +0200
+++ b/cadMousePro-daemon/src/CMakeLists.txt Thu Aug 29 19:21:45 2019 +0200
@@ -1,14 +1,13 @@
set(EXECUTABLE_FILE "cadMousePro")
-# USB libraries:
-INCLUDE(FindPkgConfig)
-
# Qt libraries:
set(CMAKE_INCLUDE_CURRENT_DIR ON) # Find includes in corresponding build directories
set(CMAKE_AUTOMOC ON) # Instruct CMake to run moc automatically when needed
set(CMAKE_AUTOUIC ON) # Create code from a list of Qt designer ui files
find_package(Qt5 CONFIG REQUIRED Core DBus)
+# USB libraries:
+INCLUDE(FindPkgConfig)
pkg_check_modules (USB_LIBS hidapi-hidraw)
include_directories(${USB_LIBS_INCLUDE_DIRS})
link_directories(${USB_LIBS_LIBRARY_DIRS})
@@ -17,12 +16,25 @@
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -fno-omit-frame-pointer -fsanitize=address")
set(CMAKE_LINKER_FLAGS_DEBUG "${CMAKE_LINKER_FLAGS_DEBUG} -fno-omit-frame-pointer -fsanitize=address")
+# Generate C++ interface classes from D-Bus XML:
+file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/generated-sources/)
+set(DBUS_XML ${CMAKE_CURRENT_SOURCE_DIR}/../../d-bus/info.globalcode.mouse.cadMousePro.xml)
+set(GENERATED_SOURCES ${CMAKE_CURRENT_BINARY_DIR}/generated-sources/)
+add_custom_command(
+ DEPENDS ${DBUS_XML}
+ OUTPUT ${GENERATED_SOURCES}/DBusAdaptor.h
+ OUTPUT ${GENERATED_SOURCES}/DBusAdaptor.cpp
+ COMMAND qdbusxml2cpp -a DBusAdaptor.h:DBusAdaptor.cpp -c DBusAdaptor -l Daemon -i Daemon.h ${DBUS_XML}
+ WORKING_DIRECTORY ${GENERATED_SOURCES}
+)
+cmake_policy(SET CMP0071 NEW) # Let AUTOMOC and AUTOUIC process GENERATED files.
+
# Executable output:
add_executable(
${EXECUTABLE_FILE}
Daemon.h
- generated-sources/DBusAdaptor.h
- generated-sources/DBusAdaptor.cpp
+ ${CMAKE_CURRENT_BINARY_DIR}/generated-sources/DBusAdaptor.h
+ ${CMAKE_CURRENT_BINARY_DIR}/generated-sources/DBusAdaptor.cpp
cadMousePro.cpp
)
--- a/cadMousePro-daemon/src/Daemon.h Thu Aug 29 17:57:30 2019 +0200
+++ b/cadMousePro-daemon/src/Daemon.h Thu Aug 29 19:21:45 2019 +0200
@@ -20,7 +20,7 @@
#include <iostream>
#include <QObject>
#include <QDBusContext>
-#include <qt5/QtDBus/qdbusconnection.h>
+#include <QDBusConnection>
#include "HID.h"
#include "CadMouseConfig.h"
--- a/cadMousePro-daemon/src/cadMousePro.cpp Thu Aug 29 17:57:30 2019 +0200
+++ b/cadMousePro-daemon/src/cadMousePro.cpp Thu Aug 29 19:21:45 2019 +0200
@@ -25,7 +25,7 @@
#include "CLIParser.h"
#include "HID.h"
#include "Daemon.h"
-#include "generated-sources/DBusAdaptor.h" // to generate this file run: d-bus/generate.sh adaptor
+#include "generated-sources/DBusAdaptor.h"
int main(int argc, char** argv) {
try {
--- a/d-bus/generate.sh Thu Aug 29 17:57:30 2019 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,22 +0,0 @@
-#!/bin/bash
-
-cd "$(dirname "$0")"
-ADAPTOR_DIR="../cadMousePro-daemon/src/generated-sources"
-PROXY_DIR="../cadMousePro-gui/src/generated-sources"
-XML="info.globalcode.mouse.cadMousePro.xml"
-
-case "$1" in
- adaptor)
- qdbusxml2cpp -a DBusAdaptor.h:DBusAdaptor.cpp -c DBusAdaptor -l Daemon -i ../Daemon.h "$XML"
- mkdir -p "$ADAPTOR_DIR"
- mv DBusAdaptor.h DBusAdaptor.cpp "$ADAPTOR_DIR"
- ;;
- proxy)
- qdbusxml2cpp -l Daemon -i ../Daemon.h -p Proxy.h "$XML"
- mkdir -p "$PROXY_DIR"
- mv Proxy.h "$PROXY_DIR"
- ;;
- *)
- echo $"Usage: $0 (adaptor|proxy)"
- exit 1
-esac