File tree Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -24,6 +24,7 @@ list(APPEND CMAKE_MODULE_PATH "${CMAKE_CONFIG_PATH}")
24
24
option (BUILD_EXAMPLES "Build tutorials and examples" ON )
25
25
option (BUILD_UNIT_TESTS "Build the unit tests" ON )
26
26
option (BUILD_TOOLS "Build commandline tools" ON )
27
+ option (BUILD_SHARED_LIBS "Build shared libraries" ON )
27
28
28
29
#############################################################
29
30
# Find packages
@@ -85,7 +86,7 @@ elseif( CATKIN_DEVEL_PREFIX OR CATKIN_BUILD_BINARY_PACKAGE)
85
86
list (APPEND BEHAVIOR_TREE_EXTERNAL_LIBRARIES ${catkin_LIBRARIES} )
86
87
set (BUILD_TOOL_INCLUDE_DIRS ${catkin_INCLUDE_DIRS} )
87
88
88
- else ( )
89
+ elseif ( BUILD_UNIT_TESTS )
89
90
find_package (GTest )
90
91
91
92
if (NOT GTEST_FOUND )
@@ -166,7 +167,11 @@ list(APPEND BT_SOURCE
166
167
167
168
if (UNIX )
168
169
list (APPEND BT_SOURCE src/shared_library_UNIX.cpp )
169
- add_library (${BEHAVIOR_TREE_LIBRARY} SHARED ${BT_SOURCE} )
170
+ if (BUILD_SHARED_LIBS )
171
+ add_library (${BEHAVIOR_TREE_LIBRARY} SHARED ${BT_SOURCE} )
172
+ else ()
173
+ add_library (${BEHAVIOR_TREE_LIBRARY} STATIC ${BT_SOURCE} )
174
+ endif ()
170
175
endif ()
171
176
172
177
if (WIN32 )
@@ -203,7 +208,9 @@ endif()
203
208
204
209
######################################################
205
210
# Test
206
- add_subdirectory (tests )
211
+ if (BUILD_UNIT_TESTS )
212
+ add_subdirectory (tests )
213
+ endif ()
207
214
208
215
######################################################
209
216
# INSTALL
You can’t perform that action at this time.
0 commit comments