Skip to content

Commit

Permalink
Merge branch 'master' of github.com:BehaviorTree/BehaviorTree.CPP
Browse files Browse the repository at this point in the history
  • Loading branch information
facontidavide committed May 21, 2022
2 parents 0b295c7 + e11d3ef commit c14f25c
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 7 deletions.
35 changes: 28 additions & 7 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ endif()
# INSTALL

INSTALL(TARGETS ${BEHAVIOR_TREE_LIBRARY}
EXPORT BehaviorTreeV3Config
EXPORT ${PROJECT_NAME}Targets
ARCHIVE DESTINATION ${BEHAVIOR_TREE_LIB_DESTINATION}
LIBRARY DESTINATION ${BEHAVIOR_TREE_LIB_DESTINATION}
RUNTIME DESTINATION ${BEHAVIOR_TREE_BIN_DESTINATION}
Expand All @@ -289,16 +289,37 @@ INSTALL( DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/include/
DESTINATION ${BEHAVIOR_TREE_INC_DESTINATION}
FILES_MATCHING PATTERN "*.h*")

install(EXPORT BehaviorTreeV3Config
DESTINATION "${BEHAVIOR_TREE_LIB_DESTINATION}/BehaviorTreeV3/cmake"
NAMESPACE BT::)

export(TARGETS ${PROJECT_NAME}
install(EXPORT ${PROJECT_NAME}Targets
FILE "${PROJECT_NAME}Targets.cmake"
DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}"
NAMESPACE BT::
FILE "${CMAKE_CURRENT_BINARY_DIR}/BehaviorTreeV3Config.cmake")
)

export(PACKAGE ${PROJECT_NAME})

include(CMakePackageConfigHelpers)

configure_package_config_file(
"${CMAKE_CURRENT_SOURCE_DIR}/cmake/Config.cmake.in"
"${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Config.cmake"
INSTALL_DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}"
)

# This requires to declare to project version in the project() macro

#write_basic_package_version_file(
# "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake"
# VERSION ${PROJECT_VERSION}
# COMPATIBILITY AnyNewerVersion
#)

install(
FILES
"${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Config.cmake"
# "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake"
DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}"
)

######################################################
# EXAMPLES and TOOLS
if(BUILD_TOOLS)
Expand Down
7 changes: 7 additions & 0 deletions cmake/Config.cmake.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
@PACKAGE_INIT@

include("${CMAKE_CURRENT_LIST_DIR}/@[email protected]")

set(@PROJECT_NAME@_TARGETS "BT::@BEHAVIOR_TREE_LIBRARY@")

check_required_components(@PROJECT_NAME@)

0 comments on commit c14f25c

Please sign in to comment.