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

Backporting of #630 and #697 for 5.1 #696

Merged
merged 2 commits into from
Apr 25, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -445,6 +445,13 @@ endif()

include_directories("${CMAKE_BINARY_DIR}")

set(DART_INCLUDE_DIRS
"${CMAKE_INSTALL_PREFIX}/include"
"${EIGEN3_INCLUDE_DIRS}")
if(HAVE_BULLET_COLLISION)
list(APPEND DART_INCLUDE_DIRS "${BULLET_INCLUDE_DIRS}")
endif()

#===============================================================================
# Link directories
#===============================================================================
Expand Down
38 changes: 13 additions & 25 deletions cmake/DARTConfig.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -4,47 +4,35 @@
# This sets the following variables:
# DART_INCLUDE_DIRS - Directories containing the DART include files.
# DART_LIBRARIES - Libraries needed to use DART.
# DART_LIBRARY_DIRS - Directories that contain the DART libraries.
# DART_VERSION - DART version.

#===============================================================================
# DART_INCLUDE_DIRS
#===============================================================================
set(DART_INCLUDE_DIRS
"@CMAKE_INSTALL_PREFIX@/include"
"@EIGEN3_INCLUDE_DIRS@"
"@BULLET_INCLUDE_DIRS@")

#===============================================================================
# DART_LIBRARY_DIRS
#===============================================================================
set(DART_LIBRARY_DIRS "@CMAKE_INSTALL_PREFIX@/lib" "@Boost_LIBRARY_DIRS@")
set(DART_INCLUDE_DIRS "@DART_INCLUDE_DIRS@")

#===============================================================================
# DART_LIBRARIES
#===============================================================================
get_filename_component(CURRENT_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH)
include("${CURRENT_DIR}/DARTTargets.cmake")
# Return absolute path of the library instead of just library name as
# recommended in CMake documentation:
# http://www.cmake.org/cmake/help/v3.0/command/link_directories.html
find_library(dart_location NAMES "dart" PATHS "@CMAKE_INSTALL_PREFIX@/lib")
set(DART_LIBRARIES "${dart_location}")
if(NOT TARGET dart)
include("${CMAKE_CURRENT_LIST_DIR}/DARTTargets.cmake")
endif()
set(DART_LIBRARIES dart)

# Handle requested components in find_package(DART COMPONENTS [components]).
# The list of components is passed in DART_FIND_COMPONENTS.
if(DART_FIND_COMPONENTS)
foreach(comp ${DART_FIND_COMPONENTS})
find_library(dart_${comp}_location
NAMES "dart-${comp}"
PATHS "@CMAKE_INSTALL_PREFIX@/lib")
if(dart_${comp}_location)
list(APPEND DART_LIBRARIES "${dart_${comp}_location}")
else()
if(NOT TARGET "dart-${comp}")
set(DART_${comp}_FOUND 0)
if(DART_FIND_REQUIRED_${comp})
message(FATAL_ERROR "dart-${comp} not available")
endif(DART_FIND_REQUIRED_${comp})
endif(dart_${comp}_location)
endif()
else()
set(DART_${comp}_FOUND 1)
set(DART_${comp}_LIBRARY "dart-${comp}")
list(APPEND DART_LIBRARIES "${DART_${comp}_LIBRARY}")
endif()
endforeach(comp)
endif(DART_FIND_COMPONENTS)

Expand Down
24 changes: 5 additions & 19 deletions cmake/DARTCoreConfig.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -3,35 +3,21 @@
#
# This sets the following variables:
# DARTCore_INCLUDE_DIRS - Directories containing the DART include files.
# DARTCore_LIBRARIES - Libraries needed to use DART.
# DARTCore_LIBRARY_DIRS - Directories that contain the DART libraries.
# DARTCore_VERSION - DART version.

#===============================================================================
# DARTCore_INCLUDE_DIRS
#===============================================================================
set(DARTCore_INCLUDE_DIRS
"@CMAKE_INSTALL_PREFIX@/include"
"@EIGEN3_INCLUDE_DIRS@"
"@BULLET_INCLUDE_DIRS@")

#===============================================================================
# DARTCore_LIBRARY_DIRS
#===============================================================================
set(DARTCore_LIBRARY_DIRS "@CMAKE_INSTALL_PREFIX@/lib" "@Boost_LIBRARY_DIRS@")
set(DARTCore_INCLUDE_DIRS "@DART_INCLUDE_DIRS@")

#===============================================================================
# DARTCore_LIBRARIES
#===============================================================================
get_filename_component(CURRENT_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH)
include("${CURRENT_DIR}/DARTCoreTargets.cmake")
# Return absolute path of the library instead of just library name as
# recommended in CMake documentation:
# http://www.cmake.org/cmake/help/v3.0/command/link_directories.html
find_library(dart_core_location
NAMES "dart-core"
PATHS "@CMAKE_INSTALL_PREFIX@/lib")
set(DARTCore_LIBRARIES "${dart_core_location}")
if(NOT TARGET dart-core)
include("${CMAKE_CURRENT_LIST_DIR}/DARTCoreTargets.cmake")
endif()
set(DARTCore_LIBRARIES dart-core)

#===============================================================================
# DARTCore_VERSION
Expand Down