summaryrefslogtreecommitdiffstats
path: root/Tests/ExternalProject
diff options
context:
space:
mode:
Diffstat (limited to 'Tests/ExternalProject')
-rw-r--r--Tests/ExternalProject/CMakeLists.txt142
-rw-r--r--Tests/ExternalProject/Example/CMakeLists.txt11
-rw-r--r--Tests/ExternalProject/Step1.tar.bz2bin0 -> 904 bytes
-rw-r--r--Tests/ExternalProject/Step1.zipbin0 -> 1074 bytes
-rw-r--r--Tests/ExternalProject/Step1NoDir.tar.bz2bin0 -> 852 bytes
-rw-r--r--Tests/ExternalProject/Step1NoDir.zipbin0 -> 1038 bytes
-rw-r--r--Tests/ExternalProject/gitrepo.tgzbin0 -> 1934 bytes
7 files changed, 148 insertions, 5 deletions
diff --git a/Tests/ExternalProject/CMakeLists.txt b/Tests/ExternalProject/CMakeLists.txt
index 4ae04d3..99da9c4 100644
--- a/Tests/ExternalProject/CMakeLists.txt
+++ b/Tests/ExternalProject/CMakeLists.txt
@@ -1,10 +1,11 @@
-cmake_minimum_required(VERSION 2.6)
+cmake_minimum_required(VERSION 2.8)
project(ExternalProjectTest NONE)
include(ExternalProject)
find_package(CVS)
find_package(Subversion)
+find_package(Git)
set(base "${CMAKE_BINARY_DIR}/CMakeExternals")
set(binary_base "${base}/Build")
@@ -37,8 +38,6 @@ if(NOT DEFINED can_build_tutorial_step5)
endif()
endif()
-message(STATUS "can_build_tutorial_step5='${can_build_tutorial_step5}'")
-
# Empty projects that test all the known ExternalProject_Add argument key words:
#
@@ -145,6 +144,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)
@@ -169,7 +218,7 @@ if(do_cvs_tests)
URL ${CMAKE_CURRENT_SOURCE_DIR}/cvsrepo.tgz
URL_MD5 55fc85825ffdd9ed2597123c68b79f7e
BUILD_COMMAND ""
- CONFIGURE_COMMAND ${CVS_EXECUTABLE} --version
+ CONFIGURE_COMMAND "${CVS_EXECUTABLE}" --version
INSTALL_COMMAND ""
)
@@ -222,6 +271,8 @@ if(do_cvs_tests)
endif()
+# SVN-based tests:
+#
set(do_svn_tests 0)
if(Subversion_SVN_EXECUTABLE)
@@ -266,7 +317,7 @@ if(do_svn_tests)
URL ${CMAKE_CURRENT_SOURCE_DIR}/svnrepo.tgz
URL_MD5 2f468be4ed1fa96377fca0cc830819c4
BUILD_COMMAND ""
- CONFIGURE_COMMAND ${Subversion_SVN_EXECUTABLE} --version
+ CONFIGURE_COMMAND "${Subversion_SVN_EXECUTABLE}" --version
INSTALL_COMMAND ""
)
@@ -309,6 +360,80 @@ if(do_svn_tests)
endif()
+set(do_git_tests 0)
+
+if(GIT_EXECUTABLE)
+ set(do_git_tests 1)
+
+ execute_process(
+ COMMAND "${GIT_EXECUTABLE}" --version
+ OUTPUT_VARIABLE ov
+ OUTPUT_STRIP_TRAILING_WHITESPACE
+ )
+ string(REGEX REPLACE "^git version (.+)$" "\\1" git_version "${ov}")
+ message(STATUS "git_version='${git_version}'")
+
+ if(git_version VERSION_LESS 1.6.5)
+ message(STATUS "No ExternalProject git tests with git client less than version 1.6.5")
+ set(do_git_tests 0)
+ endif()
+endif()
+
+
+if(do_git_tests)
+ set(local_git_repo "../../LocalRepositories/GIT")
+
+ # Unzip/untar the git repository in our source folder so that other
+ # projects below may use it to test git args of ExternalProject_Add
+ #
+ set(proj SetupLocalGITRepository)
+ ExternalProject_Add(${proj}
+ SOURCE_DIR ${CMAKE_CURRENT_BINARY_DIR}/LocalRepositories/GIT
+ URL ${CMAKE_CURRENT_SOURCE_DIR}/gitrepo.tgz
+ BUILD_COMMAND ""
+ CONFIGURE_COMMAND "${GIT_EXECUTABLE}" --version
+ INSTALL_COMMAND ""
+ )
+
+ # git by commit id:
+ #
+ set(proj TutorialStep1-GIT-byhash)
+ ExternalProject_Add(${proj}
+ GIT_REPOSITORY "${local_git_repo}"
+ GIT_TAG d1970730310fe8bc07e73f15dc570071f9f9654a
+ UPDATE_COMMAND ""
+ CMAKE_GENERATOR "${CMAKE_GENERATOR}"
+ CMAKE_ARGS -DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR>
+ INSTALL_COMMAND ""
+ DEPENDS "SetupLocalGITRepository"
+ )
+
+ # git by explicit branch/tag name:
+ #
+ set(proj TutorialStep1-GIT-bytag)
+ ExternalProject_Add(${proj}
+ GIT_REPOSITORY "${local_git_repo}"
+ GIT_TAG "origin/master"
+ UPDATE_COMMAND ""
+ CMAKE_GENERATOR "${CMAKE_GENERATOR}"
+ CMAKE_ARGS -DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR>
+ INSTALL_COMMAND ""
+ DEPENDS "SetupLocalGITRepository"
+ )
+
+ # Live git / master (no GIT_TAG):
+ #
+ set(proj TutorialStep1-GIT-master)
+ ExternalProject_Add(${proj}
+ GIT_REPOSITORY "${local_git_repo}"
+ CMAKE_GENERATOR "${CMAKE_GENERATOR}"
+ CMAKE_ARGS -DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR>
+ INSTALL_COMMAND ""
+ DEPENDS "SetupLocalGITRepository"
+ )
+endif()
+
+
# Test the testable built/installed products:
#
enable_testing()
@@ -373,3 +498,10 @@ if(can_build_tutorial_step5)
set_property(TEST TutorialStep5-InstallTreeTest
APPEND PROPERTY LABELS Step5 InstallTree)
endif()
+
+
+message(STATUS "can_build_tutorial_step5='${can_build_tutorial_step5}'")
+message(STATUS "do_cvs_tests='${do_cvs_tests}'")
+message(STATUS "do_svn_tests='${do_svn_tests}'")
+message(STATUS "do_git_tests='${do_git_tests}'")
+message(STATUS "GIT_EXECUTABLE='${GIT_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
--- /dev/null
+++ b/Tests/ExternalProject/Step1.tar.bz2
Binary files differ
diff --git a/Tests/ExternalProject/Step1.zip b/Tests/ExternalProject/Step1.zip
new file mode 100644
index 0000000..49dac24
--- /dev/null
+++ b/Tests/ExternalProject/Step1.zip
Binary files differ
diff --git a/Tests/ExternalProject/Step1NoDir.tar.bz2 b/Tests/ExternalProject/Step1NoDir.tar.bz2
new file mode 100644
index 0000000..92eb480
--- /dev/null
+++ b/Tests/ExternalProject/Step1NoDir.tar.bz2
Binary files differ
diff --git a/Tests/ExternalProject/Step1NoDir.zip b/Tests/ExternalProject/Step1NoDir.zip
new file mode 100644
index 0000000..b42d318
--- /dev/null
+++ b/Tests/ExternalProject/Step1NoDir.zip
Binary files differ
diff --git a/Tests/ExternalProject/gitrepo.tgz b/Tests/ExternalProject/gitrepo.tgz
new file mode 100644
index 0000000..0a84bda
--- /dev/null
+++ b/Tests/ExternalProject/gitrepo.tgz
Binary files differ