4 """Conan recipe package for BehaviorTree.CPP 6 from conans
import ConanFile, CMake, tools
7 from conans.model.version
import Version
8 from conans.errors
import ConanInvalidConfiguration
12 name =
"BehaviorTree.CPP" 14 url =
"https://github.com/BehaviorTree/BehaviorTree.CPP" 15 author =
"Davide Faconti <davide.faconti@gmail.com>" 16 topics = (
"conan",
"behaviortree",
"ai",
"robotics",
"games",
"coordination")
17 description =
"This C++ library provides a framework to create BehaviorTrees. It was designed to be flexible, easy to use and fast." 18 settings =
"os",
"compiler",
"build_type",
"arch" 19 options = {
"shared": [
True,
False]}
20 default_options = {
"shared":
False}
23 exports_sources = (
"cmake/*",
"include/*",
"src/*",
"3rdparty/*",
"CMakeLists.txt")
24 requires =
"cppzmq/4.3.0@bincrafters/stable" 27 if self.settings.os ==
"Linux" and \
28 self.settings.compiler ==
"gcc" and \
29 Version(self.settings.compiler.version.value) <
"5":
30 raise ConanInvalidConfiguration(
"BehaviorTree.CPP can not be built by GCC < 5")
31 if self.settings.os ==
"Windows":
32 raise ConanInvalidConfiguration(
"BehaviorTree.CPP is not prepared to be built on Windows yet")
35 """Create CMake instance and execute configure step 38 cmake.definitions[
"BUILD_EXAMPLES"] =
False 39 cmake.definitions[
"BUILD_UNIT_TESTS"] =
False 44 """Configure, build and install BehaviorTree using CMake. 46 tools.replace_in_file(
"CMakeLists.txt",
47 "project(behaviortree_cpp)",
48 """project(behaviortree_cpp) 49 include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) 50 conan_basic_setup()""")
52 tools.replace_in_file(
"CMakeLists.txt",
53 "BEHAVIOR_TREE_EXTERNAL_LIBRARIES zmq",
54 "BEHAVIOR_TREE_EXTERNAL_LIBRARIES ${CONAN_LIBS}")
59 """Copy BehaviorTree artifacts to package folder 61 self.copy(pattern=
"LICENSE", dst=
"licenses")
66 """Collect built libraries names and solve pthread path. 68 self.cpp_info.libs = tools.collect_libs(self)
69 if self.settings.os ==
"Linux":
70 self.cpp_info.libs.append(
"pthread")
def _configure_cmake(self)