-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
72 lines (53 loc) · 1.64 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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
project(BagelMARS)
set(PROJECT_VERSION 1.0)
set(PROJECT_DESCRIPTION "test plugin to load and execute a behavior graph.")
include(FindPkgConfig)
find_package(lib_manager)
lib_defaults()
define_module_info()
cmake_minimum_required(VERSION 2.6)
pkg_check_modules(PKGCONFIG
lib_manager
data_broker
cpp_bagel_wrapper
c_bagel
mars_interfaces
mars_utils
main_gui
configmaps
REQUIRED
)
include_directories(${PKGCONFIG_INCLUDE_DIRS})
link_directories(${PKGCONFIG_LIBRARY_DIRS})
add_definitions(${PKGCONFIG_CFLAGS_OTHER}) #flags excluding the ones with -I
include_directories(
src
)
set(SOURCES
src/BagelMARS.cpp
)
set(HEADERS
src/BagelMARS.hpp
)
add_library(${PROJECT_NAME} SHARED ${SOURCES})
target_link_libraries(${PROJECT_NAME}
${PKGCONFIG_LIBRARIES}
)
if(WIN32)
set(LIB_INSTALL_DIR bin) # .dll are in PATH, like executables
else(WIN32)
set(LIB_INSTALL_DIR lib)
endif(WIN32)
set(_INSTALL_DESTINATIONS
RUNTIME DESTINATION bin
LIBRARY DESTINATION ${LIB_INSTALL_DIR}
ARCHIVE DESTINATION lib
)
# Install the library into the lib folder
install(TARGETS ${PROJECT_NAME} ${_INSTALL_DESTINATIONS})
# Install headers into mars include directory
install(FILES ${HEADERS} DESTINATION include/mars/plugins/${PROJECT_NAME})
# Prepare and install necessary files to support finding of the library
# using pkg-config
configure_file(${PROJECT_NAME}.pc.in ${CMAKE_BINARY_DIR}/${PROJECT_NAME}.pc @ONLY)
install(FILES ${CMAKE_BINARY_DIR}/${PROJECT_NAME}.pc DESTINATION lib/pkgconfig)