diff options
Diffstat (limited to 'Tests/RunCMake/find_file/VALIDATOR.cmake')
-rw-r--r-- | Tests/RunCMake/find_file/VALIDATOR.cmake | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/Tests/RunCMake/find_file/VALIDATOR.cmake b/Tests/RunCMake/find_file/VALIDATOR.cmake new file mode 100644 index 0000000..72dd8f9 --- /dev/null +++ b/Tests/RunCMake/find_file/VALIDATOR.cmake @@ -0,0 +1,39 @@ + +function(CHECK_DEFAULT result filename) + message("CHECK='${filename}'") +endfunction() + +function(CHECK_OK result filename) + message("CHECK='${filename}'") + set(${result} TRUE PARENT_SCOPE) +endfunction() + +function(CHECK_KO result filename) + message("CHECK='${filename}'") + set(${result} FALSE PARENT_SCOPE) +endfunction() + + +find_file(FILE + NAMES PrefixInPATH.h + HINTS ${CMAKE_CURRENT_SOURCE_DIR}/include + VALIDATOR check_default + ) +message(STATUS "FILE='${FILE}'") +unset(FILE CACHE) + +find_file(FILE + NAMES PrefixInPATH.h + HINTS ${CMAKE_CURRENT_SOURCE_DIR}/include + VALIDATOR check_ok + ) +message(STATUS "FILE='${FILE}'") +unset(FILE CACHE) + +find_file(FILE + NAMES PrefixInPATH.h + HINTS ${CMAKE_CURRENT_SOURCE_DIR}/include + VALIDATOR check_ko + ) +message(STATUS "FILE='${FILE}'") +unset(FILE CACHE) |