summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake
diff options
context:
space:
mode:
authorCraig Scott <craig.scott@crascit.com>2021-03-26 11:17:01 (GMT)
committerCraig Scott <craig.scott@crascit.com>2021-03-26 11:17:57 (GMT)
commit635431a0c9696c8c8be5d94e6afdc044afd5384c (patch)
tree1924ebde8864118c3bfe4a8151c9ef04c838bc86 /Tests/RunCMake
parent4ceb0ca59ea13f1f3f76414a214fbbd9ecb57707 (diff)
downloadCMake-635431a0c9696c8c8be5d94e6afdc044afd5384c.zip
CMake-635431a0c9696c8c8be5d94e6afdc044afd5384c.tar.gz
CMake-635431a0c9696c8c8be5d94e6afdc044afd5384c.tar.bz2
Tests: Check host platform instead of target for running stat
Diffstat (limited to 'Tests/RunCMake')
-rw-r--r--Tests/RunCMake/File_Generate/UseSourcePermissionsVerify.cmake2
-rw-r--r--Tests/RunCMake/configure_file/SourcePermissions.cmake6
-rw-r--r--Tests/RunCMake/configure_file/UseSourcePermissions.cmake6
3 files changed, 7 insertions, 7 deletions
diff --git a/Tests/RunCMake/File_Generate/UseSourcePermissionsVerify.cmake b/Tests/RunCMake/File_Generate/UseSourcePermissionsVerify.cmake
index 8b30f96..31494d5 100644
--- a/Tests/RunCMake/File_Generate/UseSourcePermissionsVerify.cmake
+++ b/Tests/RunCMake/File_Generate/UseSourcePermissionsVerify.cmake
@@ -2,7 +2,7 @@ if(NOT EXISTS "${generatedFile}")
message(SEND_ERROR "Missing generated file:\n ${generatedFile}")
endif()
-if (UNIX)
+if (CMAKE_HOST_UNIX)
find_program(STAT_EXECUTABLE NAMES stat)
if(NOT STAT_EXECUTABLE)
return()
diff --git a/Tests/RunCMake/configure_file/SourcePermissions.cmake b/Tests/RunCMake/configure_file/SourcePermissions.cmake
index 50330fc..c4d3d61 100644
--- a/Tests/RunCMake/configure_file/SourcePermissions.cmake
+++ b/Tests/RunCMake/configure_file/SourcePermissions.cmake
@@ -6,17 +6,17 @@ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/sourcefile.txt
WORLD_READ
)
-if (UNIX)
+if (CMAKE_HOST_UNIX)
find_program(STAT_EXECUTABLE NAMES stat)
if(NOT STAT_EXECUTABLE)
return()
endif()
- if (CMAKE_SYSTEM_NAME MATCHES "FreeBSD")
+ if (CMAKE_HOST_SYSTEM_NAME MATCHES "FreeBSD")
execute_process(COMMAND "${STAT_EXECUTABLE}" -f %Lp "${CMAKE_CURRENT_BINARY_DIR}/sourcefile-source-permissions.txt"
OUTPUT_VARIABLE output
)
- elseif(CMAKE_SYSTEM_NAME MATCHES "Darwin")
+ elseif(CMAKE_HOST_SYSTEM_NAME MATCHES "Darwin")
execute_process(COMMAND "${STAT_EXECUTABLE}" -f %A "${CMAKE_CURRENT_BINARY_DIR}/sourcefile-source-permissions.txt"
OUTPUT_VARIABLE output
)
diff --git a/Tests/RunCMake/configure_file/UseSourcePermissions.cmake b/Tests/RunCMake/configure_file/UseSourcePermissions.cmake
index f7aedd1..65e5954 100644
--- a/Tests/RunCMake/configure_file/UseSourcePermissions.cmake
+++ b/Tests/RunCMake/configure_file/UseSourcePermissions.cmake
@@ -3,20 +3,20 @@ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/sourcefile.txt
USE_SOURCE_PERMISSIONS
)
-if (UNIX)
+if (CMAKE_HOST_UNIX)
find_program(STAT_EXECUTABLE NAMES stat)
if(NOT STAT_EXECUTABLE)
return()
endif()
- if (CMAKE_SYSTEM_NAME MATCHES "FreeBSD")
+ if (CMAKE_HOST_SYSTEM_NAME MATCHES "FreeBSD")
execute_process(COMMAND "${STAT_EXECUTABLE}" -f %Lp "${CMAKE_CURRENT_SOURCE_DIR}/sourcefile.txt"
OUTPUT_VARIABLE output1
)
execute_process(COMMAND "${STAT_EXECUTABLE}" -f %Lp "${CMAKE_CURRENT_BINARY_DIR}/sourcefile-use-source-permissions.txt"
OUTPUT_VARIABLE output2
)
- elseif (CMAKE_SYSTEM_NAME MATCHES "Darwin")
+ elseif (CMAKE_HOST_SYSTEM_NAME MATCHES "Darwin")
execute_process(COMMAND "${STAT_EXECUTABLE}" -f %A "${CMAKE_CURRENT_SOURCE_DIR}/sourcefile.txt"
OUTPUT_VARIABLE output1
)