[Cmake-commits] CMake branch, next, updated. v2.8.12.1-5125-ga6e35e3

Brad King brad.king at kitware.com
Wed Nov 13 10:05:28 EST 2013


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".

The branch, next has been updated
       via  a6e35e3b1280bad8f88b164942c4826d5d9fc78e (commit)
       via  8eb20eeabeb2b0196723a3e6dcfbe0501dceb5e7 (commit)
      from  edc079e54e9fb0a2a9598bf8ff903d0dd4f4d97b (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=a6e35e3b1280bad8f88b164942c4826d5d9fc78e
commit a6e35e3b1280bad8f88b164942c4826d5d9fc78e
Merge: edc079e 8eb20ee
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Wed Nov 13 10:05:26 2013 -0500
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Wed Nov 13 10:05:26 2013 -0500

    Merge topic 'ExternalData-allow-no-urls' into next
    
    8eb20ee ExternalData: Allow local stores without any URL templates


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=8eb20eeabeb2b0196723a3e6dcfbe0501dceb5e7
commit 8eb20eeabeb2b0196723a3e6dcfbe0501dceb5e7
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Wed Nov 13 10:03:36 2013 -0500
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Wed Nov 13 10:03:36 2013 -0500

    ExternalData: Allow local stores without any URL templates
    
    Allow ExternalData_URL_TEMPLATES to be empty if a value for
    ExternalData_OBJECT_STORES is provided.  Assume in this use case that
    the object stores will already contain all needed objects.  Extend the
    Module.ExternalData test to cover this case (all objects in stores).
    Extend the RunCMake.ExternalData test to cover the non-failure message
    case when stores are provided without URL templates.

diff --git a/Modules/ExternalData.cmake b/Modules/ExternalData.cmake
index 1e1d32f..1e2698c 100644
--- a/Modules/ExternalData.cmake
+++ b/Modules/ExternalData.cmake
@@ -58,7 +58,7 @@
 #
 # It creates custom commands in the target as necessary to make data
 # files available for each ``DATA{}`` reference previously evaluated by
-# other functions provided by this module.  A list of URL templates must
+# other functions provided by this module.  A list of URL templates may
 # be provided in the variable ``ExternalData_URL_TEMPLATES`` using the
 # placeholders ``%(algo)`` and ``%(hash)`` in each template.  Data fetch
 # rules try each URL template in order by substituting the hash
@@ -202,8 +202,9 @@ function(ExternalData_add_test target)
 endfunction()
 
 function(ExternalData_add_target target)
-  if(NOT ExternalData_URL_TEMPLATES)
-    message(FATAL_ERROR "ExternalData_URL_TEMPLATES is not set!")
+  if(NOT ExternalData_URL_TEMPLATES AND NOT ExternalData_OBJECT_STORES)
+    message(FATAL_ERROR
+      "Neither ExternalData_URL_TEMPLATES nor ExternalData_OBJECT_STORES is set!")
   endif()
   if(NOT ExternalData_OBJECT_STORES)
     set(ExternalData_OBJECT_STORES ${CMAKE_BINARY_DIR}/ExternalData/Objects)
@@ -625,8 +626,9 @@ endif()
 if(ExternalData_CONFIG)
   include(${ExternalData_CONFIG})
 endif()
-if(NOT ExternalData_URL_TEMPLATES)
-  message(FATAL_ERROR "No ExternalData_URL_TEMPLATES set!")
+if(NOT ExternalData_URL_TEMPLATES AND NOT ExternalData_OBJECT_STORES)
+  message(FATAL_ERROR
+    "Neither ExternalData_URL_TEMPLATES nor ExternalData_OBJECT_STORES is set!")
 endif()
 
 function(_ExternalData_link_or_copy src dst)
@@ -754,6 +756,9 @@ function(_ExternalData_download_object name hash algo var_obj)
     set(obj "${staged}")
     message(STATUS "Staged object: \"${obj}\"")
   else()
+    if(NOT tried)
+      set(tried "\n  (No ExternalData_URL_TEMPLATES given)")
+    endif()
     message(FATAL_ERROR "Object ${algo}=${hash} not found at:${tried}")
   endif()
 
diff --git a/Tests/Module/ExternalData/CMakeLists.txt b/Tests/Module/ExternalData/CMakeLists.txt
index 8312dca..5a6f3d5 100644
--- a/Tests/Module/ExternalData/CMakeLists.txt
+++ b/Tests/Module/ExternalData/CMakeLists.txt
@@ -42,3 +42,4 @@ ExternalData_Add_Target(Data1)
 
 add_subdirectory(Data2)
 add_subdirectory(Data3)
+add_subdirectory(Data4)
diff --git a/Tests/Module/ExternalData/Data4/CMakeLists.txt b/Tests/Module/ExternalData/Data4/CMakeLists.txt
new file mode 100644
index 0000000..ac977fb
--- /dev/null
+++ b/Tests/Module/ExternalData/Data4/CMakeLists.txt
@@ -0,0 +1,15 @@
+set(Store0 ${CMAKE_BINARY_DIR}/ExternalData/Other)
+set(Store1 ${CMAKE_BINARY_DIR}/ExternalData/Objects)
+set(ExternalData_OBJECT_STORES ${Store0} ${Store1})
+unset(ExternalData_URL_TEMPLATES) # All objects already in stores!
+ExternalData_Add_Test(Data4
+  NAME Data4Check
+  COMMAND ${CMAKE_COMMAND}
+    -D Data=DATA{Data.dat}
+    -D Other=DATA{Other.dat}
+    -D Store0=${Store0}
+    -D Store1=${Store1}
+    -P ${CMAKE_CURRENT_SOURCE_DIR}/Data4Check.cmake
+  )
+ExternalData_Add_Target(Data4)
+add_dependencies(Data4 Data3)
diff --git a/Tests/Module/ExternalData/Data4/Data.dat.md5 b/Tests/Module/ExternalData/Data4/Data.dat.md5
new file mode 100644
index 0000000..70e39bd
--- /dev/null
+++ b/Tests/Module/ExternalData/Data4/Data.dat.md5
@@ -0,0 +1 @@
+8c018830e3efa5caf3c7415028335a57
diff --git a/Tests/Module/ExternalData/Data4/Data4Check.cmake b/Tests/Module/ExternalData/Data4/Data4Check.cmake
new file mode 100644
index 0000000..e614cc4
--- /dev/null
+++ b/Tests/Module/ExternalData/Data4/Data4Check.cmake
@@ -0,0 +1,26 @@
+if(NOT EXISTS "${Data}")
+  message(SEND_ERROR "Input file:\n  ${Data}\ndoes not exist!")
+endif()
+if(NOT EXISTS "${Other}")
+  message(SEND_ERROR "Input file:\n  ${Other}\ndoes not exist!")
+endif()
+# Verify that the 'Data' object was found in the second store location left
+# from Data1 target downloads and that the 'Other' object was found in the
+# first store location left from Data3 target downloads.  Neither object
+# should exist in the opposite store.
+foreach(should_exist
+    "${Store0}/MD5/aaad162b85f60d1eb57ca71a23e8efd7"
+    "${Store1}/MD5/8c018830e3efa5caf3c7415028335a57"
+    )
+  if(NOT EXISTS ${should_exist})
+    message(SEND_ERROR "Store file:\n  ${should_exist}\nshould exist!")
+  endif()
+endforeach()
+foreach(should_not_exist
+    "${Store0}/MD5/8c018830e3efa5caf3c7415028335a57"
+    "${Store1}/MD5/aaad162b85f60d1eb57ca71a23e8efd7"
+    )
+  if(EXISTS ${should_not_exist})
+    message(SEND_ERROR "Store file:\n  ${should_not_exist}\nshould not exist!")
+  endif()
+endforeach()
diff --git a/Tests/Module/ExternalData/Data4/Other.dat.md5 b/Tests/Module/ExternalData/Data4/Other.dat.md5
new file mode 100644
index 0000000..5312faa
--- /dev/null
+++ b/Tests/Module/ExternalData/Data4/Other.dat.md5
@@ -0,0 +1 @@
+aaad162b85f60d1eb57ca71a23e8efd7
diff --git a/Tests/RunCMake/ExternalData/NoURLTemplates-stderr.txt b/Tests/RunCMake/ExternalData/NoURLTemplates-stderr.txt
index ad059d4..ccbaf5a 100644
--- a/Tests/RunCMake/ExternalData/NoURLTemplates-stderr.txt
+++ b/Tests/RunCMake/ExternalData/NoURLTemplates-stderr.txt
@@ -1,5 +1,5 @@
 CMake Error at .*/Modules/ExternalData.cmake:[0-9]+ \(message\):
-  ExternalData_URL_TEMPLATES is not set!
+  Neither ExternalData_URL_TEMPLATES nor ExternalData_OBJECT_STORES is set!
 Call Stack \(most recent call first\):
   NoURLTemplates.cmake:2 \(ExternalData_Add_Target\)
   CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/ExternalData/ObjectStoreOnly.cmake b/Tests/RunCMake/ExternalData/ObjectStoreOnly.cmake
new file mode 100644
index 0000000..5e66101
--- /dev/null
+++ b/Tests/RunCMake/ExternalData/ObjectStoreOnly.cmake
@@ -0,0 +1,3 @@
+include(ExternalData)
+set(ExternalData_OBJECT_STORES "${CMAKE_CURRENT_BINARY_DIR}")
+ExternalData_Add_Target(Data)
diff --git a/Tests/RunCMake/ExternalData/RunCMakeTest.cmake b/Tests/RunCMake/ExternalData/RunCMakeTest.cmake
index 8fba82c..93ff08f 100644
--- a/Tests/RunCMake/ExternalData/RunCMakeTest.cmake
+++ b/Tests/RunCMake/ExternalData/RunCMakeTest.cmake
@@ -22,6 +22,7 @@ run_cmake(NormalData2)
 run_cmake(NormalData3)
 run_cmake(NormalDataSub1)
 run_cmake(NotUnderRoot)
+run_cmake(ObjectStoreOnly)
 run_cmake(Semicolon1)
 run_cmake(Semicolon2)
 run_cmake(Semicolon3)

-----------------------------------------------------------------------

Summary of changes:
 Modules/ExternalData.cmake                         |   15 ++++++++++-----
 Tests/Module/ExternalData/CMakeLists.txt           |    1 +
 .../ExternalData/{Data3 => Data4}/CMakeLists.txt   |   11 ++++++-----
 Tests/Module/ExternalData/{ => Data4}/Data.dat.md5 |    0
 .../Data3Check.cmake => Data4/Data4Check.cmake}    |    5 +++--
 .../ExternalData/{Data3 => Data4}/Other.dat.md5    |    0
 .../ExternalData/NoURLTemplates-stderr.txt         |    2 +-
 Tests/RunCMake/ExternalData/ObjectStoreOnly.cmake  |    3 +++
 Tests/RunCMake/ExternalData/RunCMakeTest.cmake     |    1 +
 9 files changed, 25 insertions(+), 13 deletions(-)
 copy Tests/Module/ExternalData/{Data3 => Data4}/CMakeLists.txt (56%)
 copy Tests/Module/ExternalData/{ => Data4}/Data.dat.md5 (100%)
 copy Tests/Module/ExternalData/{Data3/Data3Check.cmake => Data4/Data4Check.cmake} (81%)
 copy Tests/Module/ExternalData/{Data3 => Data4}/Other.dat.md5 (100%)
 create mode 100644 Tests/RunCMake/ExternalData/ObjectStoreOnly.cmake


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list