-
Notifications
You must be signed in to change notification settings - Fork 624
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
Davide Faconti
committed
Dec 5, 2018
1 parent
b1667c9
commit e0041a7
Showing
1 changed file
with
59 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
#!/usr/bin/env python | ||
# -*- coding: utf-8 -*- | ||
|
||
"""Conan recipe package for BehaviorTree.CPP | ||
""" | ||
from conans import ConanFile, CMake, tools | ||
|
||
|
||
class BehaviorTreeConan(ConanFile): | ||
name = "BehaviorTree.CPP" | ||
license = "MIT" | ||
url = "https://github.com/BehaviorTree/BehaviorTree.CPP" | ||
author = "Davide Faconti <davide.faconti@gmail.com>" | ||
topics = ("conan", "behaviortree", "ai", "robotics", "games", "coordination") | ||
description = "This C++ library provides a framework to create BehaviorTrees. It was designed to be flexible, easy to use and fast." | ||
settings = "os", "compiler", "build_type", "arch" | ||
options = {"shared": [True, False]} | ||
default_options = {"shared": False} | ||
generators = "cmake" | ||
exports = "LICENSE" | ||
exports_sources = ("cmake/*", "include/*", "src/*", "3rdparty/*", "CMakeLists.txt") | ||
|
||
def requirements(self): | ||
|
||
self.requires("cppzmq/4.3.0@bincrafters/stable") | ||
|
||
def _configure_cmake(self): | ||
"""Create CMake instance and execute configure step | ||
""" | ||
cmake = CMake(self) | ||
cmake.definitions["BUILD_EXAMPLES"] = False | ||
cmake.definitions["BUILD_UNIT_TESTS"] = False | ||
cmake.configure() | ||
return cmake | ||
|
||
def build(self): | ||
"""Configure, build and install BehaviorTree using CMake. | ||
""" | ||
tools.replace_in_file("CMakeLists.txt", | ||
"project(behaviortree_cpp)", | ||
"""project(behaviortree_cpp) | ||
include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) | ||
conan_basic_setup()""") | ||
cmake = self._configure_cmake() | ||
cmake.build() | ||
|
||
def package(self): | ||
"""Copy BehaviorTree artifacts to package folder | ||
""" | ||
self.copy(pattern="LICENSE", dst="licenses") | ||
cmake = self._configure_cmake() | ||
cmake.install() | ||
|
||
def package_info(self): | ||
"""Collect built libraries names and solve pthread path. | ||
""" | ||
self.cpp_info.libs = tools.collect_libs(self) | ||
if self.settings.os == "Linux": | ||
self.cpp_info.libs.append("pthread") |