-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathomplConfig.cmake.in
More file actions
104 lines (91 loc) · 3.95 KB
/
omplConfig.cmake.in
File metadata and controls
104 lines (91 loc) · 3.95 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
@PACKAGE_INIT@
# These must be set BEFORE any call to find_package because PACKAGE_PREFIX_DIR gets overwritten by Eigen3.
# See https://cmake.org/cmake/help/latest/module/CMakePackageConfigHelpers.html#command:configure_package_config_file.
## Deprecated Variables ##
set(OMPL_FOUND ${@PROJECT_NAME@_FOUND})
set(OMPL_VERSION @PROJECT_VERSION@)
set(OMPL_MAJOR_VERSION @PROJECT_VERSION_MAJOR@)
set(OMPL_MINOR_VERSION @PROJECT_VERSION_MINOR@)
set(OMPL_PATCH_VERSION @PROJECT_VERSION_PATCH@)
set_and_check(OMPL_INCLUDE_DIRS @PACKAGE_INCLUDE_INSTALL_DIR@)
include ("${CMAKE_CURRENT_LIST_DIR}/omplExport.cmake" )
include(CMakeFindDependencyMacro)
set(_@PROJECT_NAME@_boost_components serialization)
find_dependency(Boost REQUIRED COMPONENTS ${_@PROJECT_NAME@_boost_components})
if(Boost_FOUND)
foreach(_comp ${_@PROJECT_NAME@_boost_components})
get_target_property(_includes Boost::${_comp} INTERFACE_INCLUDE_DIRECTORIES)
list(APPEND OMPL_INCLUDE_DIRS ${_includes})
endforeach()
endif()
find_dependency(Eigen3 REQUIRED)
list(APPEND OMPL_INCLUDE_DIRS @EIGEN3_INCLUDE_DIRS@)
# Add OMPL's find modules to the search path so consumers can also find them.
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR})
if(@OMPL_HAVE_FLANN@) # if(OMPL_HAVE_FLANN)
find_dependency(flann REQUIRED)
endif()
# If flann is required at version 1.9.2 minimum, then the below logic is unneeded.
#if(flann_FOUND)
# if(NOT TARGET flann::flann and TARGET flann)
# add_library(flann::flann ALIAS flan)
# endif()
#endif()
if(@OMPL_EXTENSION_TRIANGLE@) # if(OMPL_EXTENSION_TRIANGLE)
# If OMPL was build with TRIANGLE support,
# then it's required to have TRIANGLE to consume OMPL.
find_dependency(Triangle REQUIRED)
endif()
if(@Threads_FOUND@) # if(Threads_FOUND)
find_dependency(Threads QUIET)
endif()
if(@OMPL_HAVE_SPOT@) # if(OMPL_HAVE_SPOT)
find_dependency(spot MODULE QUIET)
endif()
# Add optional dependent library includes based on their non-portable variable directories (best effort).
foreach(_dir @FLANN_INCLUDE_DIRS@;@SPOT_INCLUDE_DIRS@;@Triangle_INCLUDE_DIR@;@FCL_INCLUDE_DIRS@;@PQP_INCLUDE_DIR@;@ASSIMP_INCLUDE_DIRS@;@OPENGL_INCLUDE_DIR@)
if(_dir)
list(APPEND OMPL_INCLUDE_DIRS "${_dir}")
endif()
endforeach()
list(REMOVE_DUPLICATES OMPL_INCLUDE_DIRS)
set(OMPL_INCLUDE_DIRS "${OMPL_INCLUDE_DIRS}" CACHE STRING "Include path for OMPL and its dependencies - DEPRECATED")
# FIX: Set OMPL_LIBRARIES based on target and allow standard library search paths
# First, try to use the target approach which is most robust
if(TARGET ompl::ompl)
# Extract information from the target
set(OMPL_LIBRARIES ompl::ompl)
else()
# Try to find the library directly
find_library(OMPL_LIBRARY_PATH NAMES ompl
PATHS "${PACKAGE_PREFIX_DIR}/lib")
# If found, set OMPL_LIBRARIES
if(OMPL_LIBRARY_PATH)
set(OMPL_LIBRARIES "${OMPL_LIBRARY_PATH}")
else()
# Last resort: try system paths
find_library(OMPL_LIBRARY_PATH NAMES ompl)
if(OMPL_LIBRARY_PATH)
set(OMPL_LIBRARIES "${OMPL_LIBRARY_PATH}")
else()
message(FATAL_ERROR "Could not find OMPL library. Please check your installation.")
endif()
endif()
# Add dependent libraries
foreach(_lib @Boost_SERIALIZATION_LIBRARY@;@SPOT_LIBRARIES@)
if(_lib)
list(APPEND OMPL_LIBRARIES "${_lib}")
endif()
endforeach()
endif()
# Set OMPL_LIBRARY_DIRS for backward compatibility
set_and_check(OMPL_LIBRARY_DIRS "@PACKAGE_LIB_INSTALL_DIR@")
foreach(_dir @FLANN_LIBRARY_DIRS@;@SPOT_LIBRARY_DIRS@;@FCL_LIBRARY_DIRS@;@ASSIMP_LIBRARY_DIRS@)
if(_dir)
list(APPEND OMPL_LIBRARY_DIRS "${_dir}")
endif()
endforeach()
list(REMOVE_DUPLICATES OMPL_LIBRARY_DIRS)
set(OMPL_LIBRARY_DIRS "${OMPL_LIBRARY_DIRS}" CACHE STRING "Library path for OMPL and its dependencies - DEPRECATED")
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(ompl DEFAULT_MSG OMPL_INCLUDE_DIRS OMPL_LIBRARIES)