| 1 |
@PACKAGE_INIT@ |
| 2 |
|
| 3 |
include(CMakeFindDependencyMacro) |
| 4 |
|
| 5 |
set(_@PROJECT_NAME@_supported_components @_selected_components@) |
| 6 |
|
| 7 |
set(Core_deps "@Core_DOWNSTREAM_DEPS@") |
| 8 |
set(Binarize_deps "@Binarize_DOWNSTREAM_DEPS@") |
| 9 |
set(Convert_deps "@Convert_DOWNSTREAM_DEPS@") |
| 10 |
set(Boost_comps "@Boost_DOWNSTREAM_COMPONENTS@") |
| 11 |
|
| 12 |
set(_comps ${@PROJECT_NAME@_FIND_COMPONENTS}) |
| 13 |
if (_comps) |
| 14 |
if ("Convert" IN_LIST _comps) |
| 15 |
list(PREPEND _comps Binarize) |
| 16 |
endif () |
| 17 |
list(PREPEND _comps Core) |
| 18 |
list(REMOVE_DUPLICATES _comps) |
| 19 |
else() # empty list of components, include all |
| 20 |
set(_comps ${_@PROJECT_NAME@_supported_components}) |
| 21 |
endif () |
| 22 |
|
| 23 |
foreach(_comp ${_comps}) |
| 24 |
if (NOT _comp IN_LIST _@PROJECT_NAME@_supported_components) |
| 25 |
set(@PROJECT_NAME@_FOUND False) |
| 26 |
set(@PROJECT_NAME@_NOT_FOUND_MESSAGE "Unsupported component: ${_comp}") |
| 27 |
endif() |
| 28 |
include("${CMAKE_CURRENT_LIST_DIR}/@PROJECT_NAME@${_comp}Targets.cmake") |
| 29 |
|
| 30 |
foreach (_pkg_ver ${${_comp}_deps}) |
| 31 |
# Use regular expression to extract package name and version |
| 32 |
string(REGEX MATCH "^(.*)_([0-9]+\\.[0-9]+\\.?[0-9]*)$" extracted_parts ${_pkg_ver}) |
| 33 |
|
| 34 |
# Access the extracted groups |
| 35 |
set(package_name ${CMAKE_MATCH_1}) |
| 36 |
set(package_version ${CMAKE_MATCH_2}) |
| 37 |
set(comps ${${package_name}_comps}) |
| 38 |
|
| 39 |
if (comps) |
| 40 |
find_dependency(${package_name} ${package_version} COMPONENTS ${comps}) |
| 41 |
else () |
| 42 |
find_dependency(${package_name} ${package_version}) |
| 43 |
endif () |
| 44 |
endforeach() |
| 45 |
|
| 46 |
endforeach() |
| 47 |
|
| 48 |
|
| 49 |
|