Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CMake variable BTCPP_LIBRARY has not been set #558

Open
Hadi-Hajieghrary opened this issue May 9, 2023 · 1 comment
Open

CMake variable BTCPP_LIBRARY has not been set #558

Hadi-Hajieghrary opened this issue May 9, 2023 · 1 comment

Comments

@Hadi-Hajieghrary
Copy link

After installing the BehaviorTree.cpp with "make install", the following in the CMakeList.txt returns empty for ${BTCPP_LIBRARY}", and the code is not linking:

find_package(behaviortree_cpp REQUIRED)
message("BTCPP_LIBRARY is ${BTCPP_LIBRARY}")

Suggested Fix:

adding the following to the CMakeList.txt fixes the problem:

set(BTCPP_LIBRARY "/usr/local/lib/libbehaviortree_cpp.so")

Later, I am using the ${BTCPP_LIBRARY} in include_directories(${PROJECT_NAME} PUBLIC include ${BTCPP_LIBRARY}).

(Ubuntu 22 LTS)

@ipa-rar
Copy link

ipa-rar commented May 25, 2023

# CMakeLists.txt
cmake_minimum_required(VERSION 3.5)
project(bt_example)

set(CMAKE_CXX_STANDARD 17)

find_package(behaviortree_cpp REQUIRED)

add_executable(bt_example main.cpp)
target_link_libraries(bt_example /usr/local/lib/libbehaviortree_cpp.so)

This CMakeLists.txt would work for basic users

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants