diff options
author | Marc Chevrier <marc.chevrier@gmail.com> | 2021-05-03 12:16:07 (GMT) |
---|---|---|
committer | Marc Chevrier <marc.chevrier@gmail.com> | 2021-05-12 09:11:56 (GMT) |
commit | 08db1341a60035b303a20eb3f23126a661323c27 (patch) | |
tree | 630f9ef295e76567a59ac567d7466eec432aa5e9 /Tests/RunCMake/CMP0125/CMP0125-find_path-Common.cmake | |
parent | f5fa6d53b07d5c6224de2a491856a36fe3516218 (diff) | |
download | CMake-08db1341a60035b303a20eb3f23126a661323c27.zip CMake-08db1341a60035b303a20eb3f23126a661323c27.tar.gz CMake-08db1341a60035b303a20eb3f23126a661323c27.tar.bz2 |
find_*: ensure consistent behavior for cache variables
Fixes: #22121
Diffstat (limited to 'Tests/RunCMake/CMP0125/CMP0125-find_path-Common.cmake')
-rw-r--r-- | Tests/RunCMake/CMP0125/CMP0125-find_path-Common.cmake | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/Tests/RunCMake/CMP0125/CMP0125-find_path-Common.cmake b/Tests/RunCMake/CMP0125/CMP0125-find_path-Common.cmake new file mode 100644 index 0000000..37680c2 --- /dev/null +++ b/Tests/RunCMake/CMP0125/CMP0125-find_path-Common.cmake @@ -0,0 +1,51 @@ + +find_path(RELATIVE_PATH NAMES ${SEARCH_NAME} PATHS ${SEARCH_PATH}) +find_path(RELATIVE_PATH_WITH_TYPE NAMES ${SEARCH_NAME} PATHS ${SEARCH_PATH}) + +find_path(ABSOLUTE_PATH NAMES ${SEARCH_NAME} PATHS ${SEARCH_PATH}) +find_path(ABSOLUTE_PATH_WITH_TYPE NAMES ${SEARCH_NAME} PATHS ${SEARCH_PATH}) + +find_path(NOTFOUND_PATH NAMES ${SEARCH_NAME} PATHS ${SEARCH_PATH}) +find_path(NOTFOUND_PATH_WITH_TYPE NAMES ${SEARCH_NAME} PATHS ${SEARCH_PATH}) + +file(WRITE "${CMAKE_BINARY_DIR}/${FILE_NAME}" "") +find_path(FILE_NAME NAMES ${SEARCH_NAME} PATHS ${SEARCH_PATH}) +find_path(FILE_NAME_WITH_TYPE NAMES ${SEARCH_NAME} PATHS ${SEARCH_PATH}) + +message("RELATIVE_PATH=${RELATIVE_PATH}") +message("RELATIVE_PATH_WITH_TYPE=${RELATIVE_PATH_WITH_TYPE}") + +message("ABSOLUTE_PATH=${ABSOLUTE_PATH}") +message("ABSOLUTE_PATH_WITH_TYPE=${ABSOLUTE_PATH_WITH_TYPE}") + +message("NOTFOUND_PATH=${NOTFOUND_PATH}") +message("NOTFOUND_PATH_WITH_TYPE=${NOTFOUND_PATH_WITH_TYPE}") + +message("FILE_NAME=${FILE_NAME}") +message("FILE_NAME_WITH_TYPE=${FILE_NAME_WITH_TYPE}") + + +set(RELATIVE_PATH_AND_LOCAL relative_local) +set(RELATIVE_PATH_WITH_TYPE_AND_LOCAL relative_local) +set(ABSOLUTE_PATH_AND_LOCAL /absolute_local) +set(ABSOLUTE_PATH_WITH_TYPE_AND_LOCAL /absolute_local) +set(NOTFOUND_AND_LOCAL "${FILE_NAME}") +set(NOTFOUND_WITH_TYPE_AND_LOCAL "${FILE_NAME}") + +find_path(RELATIVE_PATH_AND_LOCAL NAMES ${SEARCH_NAME} PATHS ${SEARCH_PATH}) +find_path(RELATIVE_PATH_WITH_TYPE_AND_LOCAL NAMES ${SEARCH_NAME} PATHS ${SEARCH_PATH}) + +find_path(ABSOLUTE_PATH_AND_LOCAL NAMES ${SEARCH_NAME} PATHS ${SEARCH_PATH}) +find_path(ABSOLUTE_PATH_WITH_TYPE_AND_LOCAL NAMES ${SEARCH_NAME} PATHS ${SEARCH_PATH}) + +find_path(NOTFOUND_PATH_AND_LOCAL NAMES ${SEARCH_NAME} PATHS ${SEARCH_PATH}) +find_path(NOTFOUND_PATH_WITH_TYPE_AND_LOCAL NAMES ${SEARCH_NAME} PATHS ${SEARCH_PATH}) + +message("RELATIVE_PATH_AND_LOCAL=${RELATIVE_PATH_AND_LOCAL}") +message("RELATIVE_PATH_WITH_TYPE_AND_LOCAL=${RELATIVE_PATH_WITH_TYPE_AND_LOCAL}") + +message("ABSOLUTE_PATH_AND_LOCAL=${ABSOLUTE_PATH_AND_LOCAL}") +message("ABSOLUTE_PATH_WITH_TYPE_AND_LOCAL=${ABSOLUTE_PATH_WITH_TYPE_AND_LOCAL}") + +message("NOTFOUND_PATH_AND_LOCAL=${NOTFOUND_PATH_AND_LOCAL}") +message("NOTFOUND_PATH_WITH_TYPE_AND_LOCAL=${NOTFOUND_PATH_WITH_TYPE_AND_LOCAL}") |