[CMake] Fix incorrect handling of get_target_property failure

Summary:
add_unittest was checking that the result of get_target_property was not
"NOTFOUND", but despite what the documentation says, get_target_property
returns <the var>-NOTFOUND on failure.

Reviewers: efriedma, thakis, serge-sans-paille, chandlerc

Reviewed By: serge-sans-paille

Subscribers: mgorny, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D81762
This commit is contained in:
Christopher Tetreault
2020-06-29 14:21:39 -07:00
parent 4d1b7e9820
commit 657ac8e717

View File

@@ -1428,7 +1428,7 @@ function(add_unittest test_suite test_name)
add_dependencies(${test_suite} ${test_name})
get_target_property(test_suite_folder ${test_suite} FOLDER)
if (NOT ${test_suite_folder} STREQUAL "NOTFOUND")
if (test_suite_folder)
set_property(TARGET ${test_name} PROPERTY FOLDER "${test_suite_folder}")
endif ()
endfunction()