-
Notifications
You must be signed in to change notification settings - Fork 5
/
CMakeLists.txt
44 lines (30 loc) · 1.63 KB
/
CMakeLists.txt
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
if(NOT YARP_idl_tools_FOUND AND (NOT DEFINED ENABLE_SpeechIDL OR ENABLE_SpeechIDL))
message(WARNING "YARP idl_tools component not found, disabling SpeechIDL library")
endif()
cmake_dependent_option(ENABLE_SpeechIDL "Enable/disable SpeechIDL library" ON
YARP_idl_tools_FOUND OFF)
if(ENABLE_SpeechIDL)
set(ALLOW_IDL_GENERATION ON CACHE BOOL "Detect changes and rebuild IDL files")
yarp_idl_to_dir(INPUT_FILES speech.thrift
OUTPUT_DIR ${CMAKE_CURRENT_BINARY_DIR}
SOURCES_VAR idl_sources
HEADERS_VAR idl_headers
INCLUDE_DIRS_VAR idl_include_dirs
PLACEMENT MERGED
THRIFT_NO_NAMESPACE_PREFIX)
add_library(SpeechIDL SHARED ${idl_sources} ${idl_headers})
set_target_properties(SpeechIDL PROPERTIES PUBLIC_HEADER "${idl_headers}")
target_link_libraries(SpeechIDL PUBLIC YARP::YARP_os)
target_include_directories(SpeechIDL PUBLIC $<BUILD_INTERFACE:${idl_include_dirs}>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>)
install(TARGETS SpeechIDL
EXPORT ROBOTICSLAB_SPEECH
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
set_property(GLOBAL APPEND PROPERTY _exported_targets SpeechIDL)
add_library(ROBOTICSLAB::SpeechIDL ALIAS SpeechIDL)
else()
set(ENABLE_SpeechIDL OFF CACHE BOOL "Enable/disable SpeechIDL library" FORCE)
endif()