mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-10 07:40:03 -06:00
SelectLibraryConfigurations: Do not cache the _LIBRARY variable
SelectLibraryConfigurations module currently cache and mark as advanced
the variable ${basename}_LIBRARY.
${basename}_LIBRARY_RELEASE and ${basename}_LIBRARY_DEBUG are usually
cached, because they often come from find_library().
${basename}_LIBRARY on the other hand is always of type
"optimized;${${basename}_LIBRARY_RELEASE};debug;${${basename}_LIBRARY_DEBUG}"
or just "${basename}_LIBRARY_RELEASE" or "${basename}_LIBRARY_DEBUG" if
only one version of the library is not found, if both have the same
value, or if configuration types are not supported.
Caching and marking as advanced just ${basename}_LIBRARY_RELEASE and
${basename}_LIBRARY_DEBUG is enough, just by modifying these two
variables, the user has enough control on finding the library, and
having 3 variables is redundant and confusing.
This commit is contained in:
@@ -73,15 +73,11 @@ macro( select_library_configurations basename )
|
|||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
set( ${basename}_LIBRARY ${${basename}_LIBRARY} CACHE FILEPATH
|
|
||||||
"The ${basename} library" )
|
|
||||||
|
|
||||||
if( ${basename}_LIBRARY )
|
if( ${basename}_LIBRARY )
|
||||||
set( ${basename}_FOUND TRUE )
|
set( ${basename}_FOUND TRUE )
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
mark_as_advanced( ${basename}_LIBRARY
|
mark_as_advanced( ${basename}_LIBRARY_RELEASE
|
||||||
${basename}_LIBRARY_RELEASE
|
|
||||||
${basename}_LIBRARY_DEBUG
|
${basename}_LIBRARY_DEBUG
|
||||||
)
|
)
|
||||||
endmacro()
|
endmacro()
|
||||||
|
|||||||
Reference in New Issue
Block a user