[Cmake-commits] CMake branch, next, updated. v2.8.1-1263-gac0cc63

cmake-commits at cmake.org cmake-commits at cmake.org
Mon May 31 14:32:05 EDT 2010


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  ac0cc6337e6d863fe38f667b982370bd97018c40 (commit)
       via  2deba1b9119e6a3dd40931606e08b70744735650 (commit)
      from  3a796f0dc10069e79dba0cb9dfa50fbc986b2b04 (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=ac0cc6337e6d863fe38f667b982370bd97018c40
commit ac0cc6337e6d863fe38f667b982370bd97018c40
Merge: 3a796f0 2deba1b
Author: David Cole <david.cole at kitware.com>
Date:   Mon May 31 14:31:48 2010 -0400

    Merge branch 'more-formats-in-ExternalProject' into next

diff --cc Modules/ExternalProject.cmake
index 3a15f0f,c926ef1..6f63745
--- a/Modules/ExternalProject.cmake
+++ b/Modules/ExternalProject.cmake
@@@ -255,59 -243,10 +255,55 @@@ message(STATUS \"downloading... done\"
  endfunction(_ep_write_downloadfile_script)
  
  
 -function(_ep_write_extractfile_script script_filename filename tmp directory)
 +function(_ep_write_verifyfile_script script_filename local md5)
 +  file(WRITE ${script_filename}
 +"message(STATUS \"verifying file...
 +     file='${local}'\")
 +
 +set(verified 0)
 +
 +# If an expected md5 checksum exists, compare against it:
 +#
 +if(NOT \"${md5}\" STREQUAL \"\")
 +  execute_process(COMMAND \${CMAKE_COMMAND} -E md5sum \"${local}\"
 +    OUTPUT_VARIABLE ov
 +    OUTPUT_STRIP_TRAILING_WHITESPACE
 +    RESULT_VARIABLE rv)
 +
 +  if(NOT rv EQUAL 0)
 +    message(FATAL_ERROR \"error: computing md5sum of '${local}' failed\")
 +  endif()
 +
 +  string(REGEX MATCH \"^([0-9A-Fa-f]+)\" md5_actual \"\${ov}\")
 +
 +  string(TOLOWER \"\${md5_actual}\" md5_actual)
 +  string(TOLOWER \"${md5}\" md5)
 +
 +  if(NOT \"\${md5}\" STREQUAL \"\${md5_actual}\")
 +    message(FATAL_ERROR \"error: md5sum of '${local}' does not match expected value
 +  md5_expected: \${md5}
 +    md5_actual: \${md5_actual}
 +\")
 +  endif()
 +
 +  set(verified 1)
 +endif()
 +
 +if(verified)
 +  message(STATUS \"verifying file... done\")
 +else()
 +  message(STATUS \"verifying file... warning: did not verify file - no URL_MD5 checksum argument? corrupt file?\")
 +endif()
 +"
 +)
 +
 +endfunction(_ep_write_verifyfile_script)
 +
 +
 +function(_ep_write_extractfile_script script_filename filename directory)
    set(args "")
  
-   if(filename MATCHES ".tar$")
-     set(args xf)
-   endif()
- 
-   if(filename MATCHES ".tgz$")
+   if(filename MATCHES "(\\.bz2|\\.tar\\.gz|\\.tgz|\\.zip)$")
      set(args xfz)
    endif()
  
@@@ -330,13 -270,17 +326,17 @@@ message(STATUS \"extracting..
       src='\${filename}'
       dst='\${directory}'\")
  
+ if(NOT EXISTS \"\${filename}\")
+   message(FATAL_ERROR \"error: file to extract does not exist: '\${filename}'\")
+ endif()
+ 
  # Prepare a space for extracting:
  #
 -set(i 1)
 -while(EXISTS \"\${tmp}/extract\${i}\")
 +set(i 1234)
 +while(EXISTS \"\${directory}/../ex\${i}\")
    math(EXPR i \"\${i} + 1\")
  endwhile()
 -set(ut_dir \"\${tmp}/extract\${i}\")
 +set(ut_dir \"\${directory}/../ex\${i}\")
  file(MAKE_DIRECTORY \"\${ut_dir}\")
  
  # Extract it:

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=2deba1b9119e6a3dd40931606e08b70744735650
commit 2deba1b9119e6a3dd40931606e08b70744735650
Author: David Cole <david.cole at kitware.com>
Date:   Mon May 31 14:22:24 2010 -0400

    Add .zip and .tar.bz2 extraction to ExternalProject.
    
    Add archives of these file types and add to the test
    cases covered in the ExternalProject test.
    
    Also add an "Example" directory in the Tests/ExternalProject
    directory containing the canonical simplest example of
    ExternalProject usage.

diff --git a/Modules/ExternalProject.cmake b/Modules/ExternalProject.cmake
index 0302d5c..c926ef1 100644
--- a/Modules/ExternalProject.cmake
+++ b/Modules/ExternalProject.cmake
@@ -246,20 +246,16 @@ endfunction(_ep_write_downloadfile_script)
 function(_ep_write_extractfile_script script_filename filename tmp directory)
   set(args "")
 
-  if(filename MATCHES ".tar$")
-    set(args xf)
-  endif()
-
-  if(filename MATCHES ".tgz$")
+  if(filename MATCHES "(\\.bz2|\\.tar\\.gz|\\.tgz|\\.zip)$")
     set(args xfz)
   endif()
 
-  if(filename MATCHES ".tar.gz$")
-    set(args xfz)
+  if(filename MATCHES "\\.tar$")
+    set(args xf)
   endif()
 
   if(args STREQUAL "")
-    message(SEND_ERROR "error: do not know how to extract '${filename}' -- known types are .tar, .tgz and .tar.gz")
+    message(SEND_ERROR "error: do not know how to extract '${filename}' -- known types are .bz2, .tar, .tar.gz, .tgz and .zip")
     return()
   endif()
 
@@ -274,6 +270,10 @@ message(STATUS \"extracting...
      src='\${filename}'
      dst='\${directory}'\")
 
+if(NOT EXISTS \"\${filename}\")
+  message(FATAL_ERROR \"error: file to extract does not exist: '\${filename}'\")
+endif()
+
 # Prepare a space for extracting:
 #
 set(i 1)
@@ -696,7 +696,7 @@ function(_ep_add_download_command name)
       if("${url}" MATCHES "^[a-z]+://")
         # TODO: Should download and extraction be different steps?
         string(REGEX MATCH "[^/]*$" fname "${url}")
-        if(NOT "${fname}" MATCHES "\\.(tar|tgz|tar\\.gz)$")
+        if(NOT "${fname}" MATCHES "\\.(bz2|tar|tgz|tar\\.gz|zip)$")
           message(FATAL_ERROR "Could not extract tarball filename from url:\n  ${url}")
         endif()
         set(file ${download_dir}/${fname})
diff --git a/Tests/ExternalProject/CMakeLists.txt b/Tests/ExternalProject/CMakeLists.txt
index f02f2f7..123dcb4 100644
--- a/Tests/ExternalProject/CMakeLists.txt
+++ b/Tests/ExternalProject/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 2.6)
+cmake_minimum_required(VERSION 2.8)
 project(ExternalProjectTest NONE)
 
 include(ExternalProject)
@@ -139,6 +139,56 @@ ExternalProject_Add(${proj}
 )
 
 
+# Local BZ2:
+#
+# (The bz2 tests are here just to verify that the bz2 decompression is executed
+#  during a test suite run... The configure and build commands are set to
+#  nothing to make the test quicker. To make this more complete, I should add
+#  a diff between this and the TGZ source tree since that one does build...)
+#
+set(proj TutorialStep1-LocalBZ2)
+ExternalProject_Add(${proj}
+  URL "${CMAKE_CURRENT_SOURCE_DIR}/Step1.tar.bz2"
+  CONFIGURE_COMMAND ""
+  BUILD_COMMAND ""
+  INSTALL_COMMAND ""
+)
+
+set(proj TutorialStep1-LocalNoDirBZ2)
+ExternalProject_Add(${proj}
+  URL "${CMAKE_CURRENT_SOURCE_DIR}/Step1NoDir.tar.bz2"
+  CONFIGURE_COMMAND ""
+  BUILD_COMMAND ""
+  INSTALL_COMMAND ""
+)
+
+
+# Local ZIP:
+#
+# (The zip tests are here just to verify that the zip decompression is executed
+#  during a test suite run... The configure and build commands are set to
+#  nothing to make the test quicker. To make this more complete, I should add
+#  a diff between this and the TGZ source tree since that one does build...)
+#
+set(proj TutorialStep1-LocalZIP)
+ExternalProject_Add(${proj}
+  URL "${CMAKE_CURRENT_SOURCE_DIR}/Step1.zip"
+  CONFIGURE_COMMAND ""
+  BUILD_COMMAND ""
+  INSTALL_COMMAND ""
+)
+
+set(proj TutorialStep1-LocalNoDirZIP)
+ExternalProject_Add(${proj}
+  URL "${CMAKE_CURRENT_SOURCE_DIR}/Step1NoDir.zip"
+  CONFIGURE_COMMAND ""
+  BUILD_COMMAND ""
+  INSTALL_COMMAND ""
+)
+
+
+# CVS-based tests:
+#
 set(do_cvs_tests 0)
 
 if(CVS_EXECUTABLE)
@@ -215,6 +265,8 @@ if(do_cvs_tests)
 endif()
 
 
+# SVN-based tests:
+#
 set(do_svn_tests 0)
 
 if(Subversion_SVN_EXECUTABLE)
diff --git a/Tests/ExternalProject/Example/CMakeLists.txt b/Tests/ExternalProject/Example/CMakeLists.txt
new file mode 100644
index 0000000..2cadd7d
--- /dev/null
+++ b/Tests/ExternalProject/Example/CMakeLists.txt
@@ -0,0 +1,11 @@
+# This is the canonical simplest ExternalProject example CMakeLists.txt file:
+cmake_minimum_required(VERSION 2.8)
+project(ExternalProjectExample NONE)
+include(ExternalProject)
+
+ExternalProject_Add(
+  cmake281
+  URL http://www.cmake.org/files/v2.8/cmake-2.8.1.tar.gz
+  CMAKE_ARGS -D CMAKE_INSTALL_PREFIX=<INSTALL_DIR>
+  BUILD_COMMAND ""
+)
diff --git a/Tests/ExternalProject/Step1.tar.bz2 b/Tests/ExternalProject/Step1.tar.bz2
new file mode 100644
index 0000000..49b5f23
Binary files /dev/null and b/Tests/ExternalProject/Step1.tar.bz2 differ
diff --git a/Tests/ExternalProject/Step1.zip b/Tests/ExternalProject/Step1.zip
new file mode 100644
index 0000000..49dac24
Binary files /dev/null and b/Tests/ExternalProject/Step1.zip differ
diff --git a/Tests/ExternalProject/Step1NoDir.tar.bz2 b/Tests/ExternalProject/Step1NoDir.tar.bz2
new file mode 100644
index 0000000..92eb480
Binary files /dev/null and b/Tests/ExternalProject/Step1NoDir.tar.bz2 differ
diff --git a/Tests/ExternalProject/Step1NoDir.zip b/Tests/ExternalProject/Step1NoDir.zip
new file mode 100644
index 0000000..b42d318
Binary files /dev/null and b/Tests/ExternalProject/Step1NoDir.zip differ

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

Summary of changes:
 Modules/ExternalProject.cmake                |   18 ++++----
 Tests/ExternalProject/CMakeLists.txt         |   54 +++++++++++++++++++++++++-
 Tests/ExternalProject/Example/CMakeLists.txt |   11 +++++
 Tests/ExternalProject/Step1.tar.bz2          |  Bin 0 -> 904 bytes
 Tests/ExternalProject/Step1.zip              |  Bin 0 -> 1074 bytes
 Tests/ExternalProject/Step1NoDir.tar.bz2     |  Bin 0 -> 852 bytes
 Tests/ExternalProject/Step1NoDir.zip         |  Bin 0 -> 1038 bytes
 7 files changed, 73 insertions(+), 10 deletions(-)
 create mode 100644 Tests/ExternalProject/Example/CMakeLists.txt
 create mode 100644 Tests/ExternalProject/Step1.tar.bz2
 create mode 100644 Tests/ExternalProject/Step1.zip
 create mode 100644 Tests/ExternalProject/Step1NoDir.tar.bz2
 create mode 100644 Tests/ExternalProject/Step1NoDir.zip


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list