summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2017-02-06 15:29:40 (GMT)
committerCMake Topic Stage <kwrobot@kitware.com>2017-02-06 15:29:40 (GMT)
commita4c8ad5ed81b08e042646e132f999bebaf97a83b (patch)
tree638d99e7bed8202945c751889f51995c358c6723 /Modules
parent59c50a1d3ceb0cec1690f454bb57dc63de4d621b (diff)
parent8a5cb84b0e5ef3deac4e241d0d4f3e9932daadaa (diff)
downloadCMake-a4c8ad5ed81b08e042646e132f999bebaf97a83b.zip
CMake-a4c8ad5ed81b08e042646e132f999bebaf97a83b.tar.gz
CMake-a4c8ad5ed81b08e042646e132f999bebaf97a83b.tar.bz2
Merge topic 'androidtestutilities_cleanup'
8a5cb84b AndroidTestUtilities: do not require ExternalData unconditionally 9d34e51c AndroidTestUtilities: ignore exit status of ls
Diffstat (limited to 'Modules')
-rw-r--r--Modules/AndroidTestUtilities.cmake17
-rw-r--r--Modules/AndroidTestUtilities/PushToAndroidDevice.cmake4
2 files changed, 15 insertions, 6 deletions
diff --git a/Modules/AndroidTestUtilities.cmake b/Modules/AndroidTestUtilities.cmake
index a0a74fa..62d04f3 100644
--- a/Modules/AndroidTestUtilities.cmake
+++ b/Modules/AndroidTestUtilities.cmake
@@ -110,11 +110,18 @@ function(android_add_test_data test_name)
endforeach()
set(DATA_TARGET_NAME "${test_name}")
- ExternalData_Expand_Arguments(
- ${DATA_TARGET_NAME}
- extern_data_output
- ${AST_FILES})
- ExternalData_Add_Target(${DATA_TARGET_NAME})
+ string(FIND "${AST_FILES}" "DATA{" data_files_found)
+ if(${data_files_found} GREATER "-1")
+ # Use ExternalData if any DATA{} files were found.
+ ExternalData_Expand_Arguments(
+ ${DATA_TARGET_NAME}
+ extern_data_output
+ ${AST_FILES})
+ ExternalData_Add_Target(${DATA_TARGET_NAME})
+ else()
+ add_custom_target(${DATA_TARGET_NAME} ALL)
+ set(extern_data_output ${AST_FILES})
+ endif()
# For regular files on Linux, just copy them directly.
foreach(path ${AST_FILES})
diff --git a/Modules/AndroidTestUtilities/PushToAndroidDevice.cmake b/Modules/AndroidTestUtilities/PushToAndroidDevice.cmake
index d8ca730..04529b1 100644
--- a/Modules/AndroidTestUtilities/PushToAndroidDevice.cmake
+++ b/Modules/AndroidTestUtilities/PushToAndroidDevice.cmake
@@ -39,7 +39,9 @@ function(android_push_test_files_to_device)
# if(file_exists) will return true.
macro(check_device_file_exists device_file file_exists)
set(${file_exists} "")
- execute_adb_command(shell ls ${device_file})
+ execute_process(
+ COMMAND ${adb_executable} shell ls ${device_file}
+ OUTPUT_VARIABLE out_var ERROR_VARIABLE out_var)
if(NOT out_var) # when a directory exists but is empty the output is empty
set(${file_exists} "YES")
else()