diff options
author | Zack Galbreath <zack.galbreath@kitware.com> | 2017-02-03 20:44:51 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2017-02-04 13:16:24 (GMT) |
commit | 8a5cb84b0e5ef3deac4e241d0d4f3e9932daadaa (patch) | |
tree | 5ba23334f8cda3268c322759dec2ae1939a5ea6c /Modules/AndroidTestUtilities.cmake | |
parent | 9d34e51cdb7ccc74eaf851f1784433616bc9c31a (diff) | |
download | CMake-8a5cb84b0e5ef3deac4e241d0d4f3e9932daadaa.zip CMake-8a5cb84b0e5ef3deac4e241d0d4f3e9932daadaa.tar.gz CMake-8a5cb84b0e5ef3deac4e241d0d4f3e9932daadaa.tar.bz2 |
AndroidTestUtilities: do not require ExternalData unconditionally
Attempting to use AndroidTestUtilities to simply install some local
files on device can result in the following error:
Neither ExternalData_URL_TEMPLATES nor ExternalData_OBJECT_STORES is set
We no longer require these ExternalData-specific variables to be set if
no such remote data files are requested.
Fixes: #16529
Diffstat (limited to 'Modules/AndroidTestUtilities.cmake')
-rw-r--r-- | Modules/AndroidTestUtilities.cmake | 17 |
1 files changed, 12 insertions, 5 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}) |