Skip to content

Commit b4d3c1b

Browse files
committed
Check for required components in install interface
1 parent 6af1ca2 commit b4d3c1b

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

cmake-init/templates/common/cmake/install-config.cmake

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
11
{% if pm %}set({= name =}_FOUND YES)
22

3-
include(CMakeFindDependencyMacro)
3+
{% end %}foreach(comp IN LISTS {= name =}_FIND_COMPONENTS)
4+
if(DEFINED "{= name =}_FIND_REQUIRED_${comp}" AND "${{= name =}_FIND_REQUIRED_${comp}}")
5+
set({= name =}_FOUND NO)
6+
set({= name =}_NOT_FOUND_MESSAGE "This package has no components")
7+
return()
8+
endif()
9+
endforeach()
10+
11+
{% if pm %}include(CMakeFindDependencyMacro)
412
find_dependency({% if c %}json-c{% else %}fmt{% end %})
513

614
if({= name =}_FOUND)

0 commit comments

Comments
 (0)