forked from tomopy/tomopy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathConfig.cmake.in
32 lines (27 loc) · 1.2 KB
/
Config.cmake.in
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
@PACKAGE_INIT@
include("${CMAKE_CURRENT_LIST_DIR}/libtomoTargets.cmake")
set(libtomo_LIBRARIES) # clear variable
foreach(_TARG @libtomo_TARGETS@)
# there is a check in the build-tree that ensures this is a valid string manip
string(REPLACE "libtomo::tomo-" "" _TARG_BASIC "${_TARG}")
if(NOT TARGET ${_TARG})
# if the target doesn't exist add it to the libtomo_FIND_COMPONENTS
# and set that it is not found so check_required_components will fail
list(APPEND libtomo_FIND_COMPONENTS ${_TARG_BASIC})
set(libtomo_${_TARG_BASIC}_FOUND 0)
else()
set(libtomo_${_TARG_BASIC}_FOUND 1)
if(NOT libtomo_FIND_COMPONENTS)
# if COMPONENTS are not specified, always add to libtomo_LIBRARIES
list(APPEND libtomo_LIBRARIES ${_TARG})
elseif(${_TARG_BASIC} IN_LIST libtomo_FIND_COMPONENTS)
# if COMPONENTS was specified, add only if in COMPONENTS list
list(APPEND libtomo_LIBRARIES ${_TARG})
endif()
endif()
endforeach()
check_required_components(libtomo)
if(libtomo_FOUND)
add_library(libtomo::libtomo INTERFACE IMPORTED)
target_link_libraries(libtomo::libtomo INTERFACE ${libtomo_LIBRARIES})
endif()