Skip to content

Commit 53c3387

Browse files
committed
config/cmake: handle components when finding Conduit
1 parent f57b4b3 commit 53c3387

File tree

1 file changed

+24
-1
lines changed

1 file changed

+24
-1
lines changed

src/config/ConduitConfig.cmake.in

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,31 @@ if(NOT CONDUIT_FOUND)
5959
# finally setup our final imported targets
6060
include(${CONDUIT_CMAKE_CONFIG_DIR}/conduit_setup_targets.cmake)
6161

62-
set(CONDUIT_FOUND TRUE)
6362
set(Conduit_FOUND TRUE)
6463

64+
set(_conduit_known_components)
65+
foreach(_conduit_component IN LISTS Conduit_FIND_COMPONENTS)
66+
if (NOT _conduit_component IN_LIST _conduit_known_components)
67+
set("Conduit_${_conduit_component}_FOUND" 0)
68+
set("Conduit_${_conduit_component}_NOT_FOUND_MESSAGE"
69+
"Unknown component ${_conduit_component}")
70+
71+
if(Conduit_FIND_REQUIRED_${_conduit_component})
72+
set(Conduit_FOUND 0)
73+
list(APPEND Conduit_NOT_FOUND_MESSAGE
74+
"Unknown component ${_conduit_component}")
75+
endif()
76+
else()
77+
if(NOT Conduit_${_conduit_component}_FOUND AND
78+
Conduit_FIND_REQUIRED_${_conduit_component})
79+
set(Conduit_FOUND 0)
80+
list(APPEND Conduit_NOT_FOUND_MESSAGE
81+
"Component ${_conduit_component} was not found: ${Conduit_${_conduit_component}_NOT_FOUND_MESSAGE}")
82+
endif()
83+
endif()
84+
endforeach()
85+
86+
set(CONDUIT_FOUND "${Conduit_FOUND}")
87+
6588
endif()
6689

0 commit comments

Comments
 (0)