summaryrefslogtreecommitdiff
path: root/PluginControlInterface/CMakeLists.txt
blob: d61bfddd59c1cd9406a79a1b2fff3e260439f072 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
cmake_minimum_required(VERSION 2.6)

PROJECT(PluginControlInterface)

set(LIBRARY_OUTPUT_PATH ${PLUGINS_OUTPUT_PATH}/control)
set(DOC_OUTPUT_PATH ${DOC_OUTPUT_PATH}/ControlPlugin)
set(INCLUDES_FOLDER "include")

FILE(READ "${AUDIO_INCLUDES_FOLDER}/control/ControlSendInterface.h" VERSION_BUFFER LIMIT 6000)
STRING(REGEX MATCH "ControlSendVersion*.[^0-9]*[0-9]" LIB_INTERFACE_VERSION_STRING ${VERSION_BUFFER})
STRING(REGEX REPLACE "[^0-9]" "" LIB_INTERFACE_VERSION ${LIB_INTERFACE_VERSION_STRING})
MESSAGE(STATUS "Building against control interface version ${LIB_INTERFACE_VERSION}")

INCLUDE_DIRECTORIES(
	${CMAKE_SOURCE_DIR} 
	${STD_INCLUDE_DIRS}
 	${CMAKE_CURRENT_BINARY_DIR}
 	${AUDIO_INCLUDES_FOLDER}
 	${INCLUDES_FOLDER}
)

# all source files go here
file(GLOB PLUGIN_CONTROL_SRCS_CXX "src/*.cpp")

add_library(PluginControlInterface SHARED ${PLUGIN_CONTROL_SRCS_CXX})

SET_TARGET_PROPERTIES(PluginControlInterface PROPERTIES 
                                            SOVERSION "${LIB_INTERFACE_VERSION}"
)

TARGET_LINK_LIBRARIES(PluginControlInterface 
    ${DLT_LIBRARIES})

IF(WITH_TESTS)
#	add_subdirectory (test)
ENDIF(WITH_TESTS)

IF(WITH_DOCUMENTATION)
	file(MAKE_DIRECTORY ${DOC_OUTPUT_PATH})
	configure_file(${DOXY_FILE}  ${DOC_OUTPUT_PATH}/Doxyfile  @ONLY IMMEDIATE)
  	add_custom_target (PluginControlInterfaceDBusDocs ALL 
  		COMMAND ${DOXYGEN_EXECUTABLE} ${DOC_OUTPUT_PATH}/Doxyfile WORKING_DIRECTORY ${DOC_OUTPUT_PATH}
  		SOURCES ${PROJECT_BINARY_DIR} ${DOC_OUTPUT_PATH}/Doxyfile
	)
ENDIF(WITH_DOCUMENTATION)

INSTALL(TARGETS PluginControlInterface 
        DESTINATION "lib/${LIB_INSTALL_SUFFIX}/control"
        PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ GROUP_EXECUTE GROUP_READ WORLD_EXECUTE WORLD_READ
        COMPONENT sampleplugins
)

SET(ADD_DEPEND "audiomanager-bin")
set_property(GLOBAL APPEND PROPERTY sampleplugins_prop "${ADD_DEPEND}")