mirror of
https://github.com/Kitware/CMake.git
synced 2025-10-16 05:26:58 +08:00
FeatureSummary: Do not force OPTIONAL type in SET_PACKAGE_PROPERTIES
The OPTIONAL type is used anyway as default when the type is not set Since RUNTIME < OPTIONAL, forcing it here forces the user to set "RUNTIME" at the first SET_PACKAGE_PROPERTIES, otherwise it is impossible to set it later. Without this it is impossible, for example, to add package information (URL and DESCRIPTION) in the FindPackage file, but allow the package to be RUNTIME.
This commit is contained in:
@@ -439,10 +439,7 @@ function(SET_PACKAGE_PROPERTIES _name _props)
|
||||
endif()
|
||||
|
||||
# handle the TYPE
|
||||
if(NOT _SPP_TYPE)
|
||||
set(_SPP_TYPE OPTIONAL)
|
||||
endif()
|
||||
|
||||
if(DEFINED _SPP_TYPE)
|
||||
# List the supported types, according to their priority
|
||||
set(validTypes "RUNTIME" "OPTIONAL" "RECOMMENDED" "REQUIRED" )
|
||||
list(FIND validTypes ${_SPP_TYPE} _typeIndexInList)
|
||||
@@ -458,6 +455,7 @@ function(SET_PACKAGE_PROPERTIES _name _props)
|
||||
if("${_typeIndexInList}" GREATER "${_prevTypeIndexInList}")
|
||||
set_property(GLOBAL PROPERTY _CMAKE_${_name}_TYPE "${_SPP_TYPE}" )
|
||||
endif()
|
||||
endif()
|
||||
|
||||
endfunction()
|
||||
|
||||
|
Reference in New Issue
Block a user