|
|
#################################################
|
|
|
#
|
|
|
# (C) 2020 Emanoil Kotsev
|
|
|
# deloptes (AT) gmail.com
|
|
|
#
|
|
|
# Improvements and feedback are welcome
|
|
|
#
|
|
|
# This file is released under GPL >= 3
|
|
|
#
|
|
|
#################################################
|
|
|
|
|
|
include_directories(
|
|
|
${CMAKE_CURRENT_BINARY_DIR}
|
|
|
${TQT_INCLUDE_DIRS}
|
|
|
${DBUS_TQT_INCLUDE_DIRS}
|
|
|
)
|
|
|
|
|
|
set( INTROSPECTIONPATH ${CMAKE_SOURCE_DIR}/interfaces )
|
|
|
set( DBUSXML2QT3_EXECUTABLE dbusxml2qt3 )
|
|
|
|
|
|
set( HardwareControl_HDRS brightnessInterface.h brightnessProxy.h cpugovernorInterface.h cpugovernorProxy.h dbusbaseNode.h hardwarecontrolNode.h inputeventsInterface.h inputeventsProxy.h introspectableInterface.h powerInterface.h powerProxy.h propertiesInterface.h propertiesProxy.h )
|
|
|
set( HardwareControl_SRCS brightnessInterface.cpp brightnessProxy.cpp cpugovernorInterface.cpp cpugovernorProxy.cpp dbusbaseNode.cpp hardwarecontrolNode.cpp inputeventsInterface.cpp inputeventsProxy.cpp introspectableInterface.cpp powerInterface.cpp powerProxy.cpp propertiesInterface.cpp propertiesProxy.cpp)
|
|
|
|
|
|
function( make_moc fileinput )
|
|
|
add_custom_command( OUTPUT ${fileinput}.moc
|
|
|
COMMAND ${TMOC_EXECUTABLE} ${fileinput}.h -o ${fileinput}.moc
|
|
|
DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${fileinput}.h
|
|
|
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
|
|
|
)
|
|
|
set_property( SOURCE ${CMAKE_CURRENT_BINARY_DIR}/${fileinput}.cpp APPEND
|
|
|
PROPERTY OBJECT_DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${fileinput}.moc )
|
|
|
endfunction( )
|
|
|
|
|
|
##### HardwareControl #########################
|
|
|
add_custom_command(
|
|
|
OUTPUT ${HardwareControl_HDRS} ${HardwareControl_SRCS}
|
|
|
COMMAND ${DBUSXML2QT3_EXECUTABLE} ${INTROSPECTIONPATH}/org.trinitydesktop.hardwarecontrol.xml 2>/dev/null
|
|
|
DEPENDS ${INTROSPECTIONPATH}/org.trinitydesktop.hardwarecontrol.xml
|
|
|
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
|
|
|
)
|
|
|
|
|
|
make_moc ( brightnessProxy )
|
|
|
make_moc ( cpugovernorProxy )
|
|
|
make_moc ( inputeventsProxy)
|
|
|
make_moc ( powerProxy )
|
|
|
make_moc ( propertiesProxy )
|
|
|
|
|
|
tde_add_library( hwcontrolinterfaces STATIC_PIC AUTOMOC
|
|
|
SOURCES ${HardwareControl_SRCS}
|
|
|
LINK ${DBUS_TQT_LIBRARIES}
|
|
|
)
|
|
|
|
|
|
##### install headers ###################################
|
|
|
|
|
|
#file( GLOB _bin_dirs RELATIVE ${CMAKE_CURRENT_BINARY_DIR}
|
|
|
# ${CMAKE_CURRENT_BINARY_DIR}/* )
|
|
|
#unset( _exclude_dirs )
|
|
|
#foreach( _dir IN LISTS _bin_dirs )
|
|
|
# if(IS_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${_dir} )
|
|
|
# list( APPEND _exclude_dirs PATTERN ${_dir} EXCLUDE )
|
|
|
# endif()
|
|
|
#endforeach()
|
|
|
|
|
|
#install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
|
|
|
# DESTINATION ${INCLUDE_INSTALL_DIR}/hardwarecontrol
|
|
|
# USE_SOURCE_PERMISSIONS
|
|
|
# FILES_MATCHING PATTERN PATTERN "*.h"
|
|
|
# PATTERN "CMakeFiles" EXCLUDE)
|