Skip to content

Commit

Permalink
Add optional components when finding packages in Lookup
Browse files Browse the repository at this point in the history
  • Loading branch information
Mayeul d'Avezac committed Feb 22, 2017
1 parent f97c1e1 commit 5a53971
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion scripts/PackageLookup.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ macro(lookup_package package)
cmake_parse_arguments(${package}
"DOWNLOAD_BY_DEFAULT;REQUIRED;QUIET;KEEP;NOFIND;CHECK_EXTERNAL"
""
"ARGUMENTS;COMPONENTS"
"ARGUMENTS;COMPONENTS;OPTIONAL_COMPONENTS"
${ARGN}
)
# Set explicitly to TRUE or FALSE to simplify setting
Expand Down Expand Up @@ -254,6 +254,10 @@ macro(lookup_package package)
list(APPEND ${package}_UNPARSED_ARGUMENTS COMPONENTS)
list(APPEND ${package}_UNPARSED_ARGUMENTS ${${package}_COMPONENTS})
endif()
if(${package}_OPTIONAL_COMPONENTS)
list(APPEND ${package}_UNPARSED_ARGUMENTS OPTIONAL_COMPONENTS)
list(APPEND ${package}_UNPARSED_ARGUMENTS ${${package}_OPTIONAL_COMPONENTS})
endif()
# First try and locate package
_find_package_for_lookup(${package}
${${package}_REQUIRED} ${${package}_QUIET}
Expand Down

0 comments on commit 5a53971

Please sign in to comment.