aboutsummaryrefslogtreecommitdiffstats
path: root/src/CMakeLists.txt
diff options
context:
space:
mode:
authorChuck Claunch <[email protected]>2017-06-12 22:21:44 -0500
committerChuck Claunch <[email protected]>2017-06-12 22:21:44 -0500
commitd5d1d6066deae98e479f849c4c5ef1bf8a21d587 (patch)
treed16ccbc7c62309abb15a7536a6136acac9d1f34f /src/CMakeLists.txt
parent7afdda37826d56ecf407e9d79bbafabeac4ce79e (diff)
Removed generated dbus code and added call to gdbus-codegen in the build process
Signed-off-by: Chuck Claunch <[email protected]>
Diffstat (limited to 'src/CMakeLists.txt')
-rw-r--r--src/CMakeLists.txt19
1 files changed, 17 insertions, 2 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 238549e..201d8ba 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -9,6 +9,7 @@ include_directories(
${GLIB2_INCLUDE_DIRS}
${GIO_INCLUDE_DIRS}
${GIO-UNIX_INCLUDE_DIRS}
+ ${CMAKE_CURRENT_BINARY_DIR}
)
set (tinyb_LIB_SRCS
@@ -22,15 +23,29 @@ set (tinyb_LIB_SRCS
${PROJECT_SOURCE_DIR}/src/BluetoothGattDescriptor.cpp
${PROJECT_SOURCE_DIR}/src/BluetoothUUID.cpp
${PROJECT_SOURCE_DIR}/src/tinyb_utils.cpp
- ${PROJECT_SOURCE_DIR}/src/generated-code.c
-# autogenerated version file
+# autogenerated files
${CMAKE_CURRENT_BINARY_DIR}/version.c
+ ${CMAKE_CURRENT_BINARY_DIR}/orgbluez-dbus.c
)
set (tinyb_LIB_GLOB_HEADERS
${PROJECT_SOURCE_DIR}/api/tinyb.hpp
)
+find_program(GDBUS_CODEGEN NAMES gdbus-codegen)
+if (NOT GDBUS_CODEGEN)
+ message(FATAL_ERROR "gdbus-codegen not found")
+else ()
+ message(STATUS "gdbus-codegen found")
+endif ()
+
+add_custom_command(OUTPUT orgbluez-dbus.c orgbluez-dbus.h
+ COMMAND ${GDBUS_CODEGEN}
+ --interface-prefix org.bluez
+ --generate-c-code orgbluez-dbus
+ --c-generate-object-manager ${PROJECT_SOURCE_DIR}/src/org.bluez.xml
+ COMMENT "Generating dbus code from org.bluez.xml")
+
add_library (tinyb SHARED ${tinyb_LIB_SRCS})
target_link_libraries (
tinyb