cmake: check for empty string by its value

the behavior of cmake 3.17 is a little bit different as it consider

NOT _library STREQUAL ""

as true, if ${_library} is "".

Signed-off-by: Kefu Chai <kchai@redhat.com>
This commit is contained in:
Kefu Chai 2021-04-26 22:38:35 +08:00
parent 5093c6f36e
commit d275875b0e

View File

@ -14,7 +14,7 @@ macro(try_std_filesystem_library _library _result _already_included)
${_std_filesystem_try_compile_arg})
unset(_std_filesystem_try_compile_arg)
if(_std_filesystem_compiles)
if(NOT _library STREQUAL "")
if(NOT ${_library} STREQUAL "")
set(${_result} ${_library})
else()
set(${_already_included} "included by standard library")