2010-05-31 22:22:24 +04:00
|
|
|
cmake_minimum_required(VERSION 2.8)
|
2008-12-04 21:27:48 +03:00
|
|
|
project(ExternalProjectTest NONE)
|
|
|
|
|
2009-06-24 23:03:26 +04:00
|
|
|
include(ExternalProject)
|
2008-12-04 21:27:48 +03:00
|
|
|
|
2014-07-03 20:11:49 +04:00
|
|
|
# Test ExternalProject, especially with checkouts from VCS
|
|
|
|
|
2009-06-26 17:55:35 +04:00
|
|
|
find_package(CVS)
|
|
|
|
find_package(Subversion)
|
2010-06-04 01:30:07 +04:00
|
|
|
find_package(Git)
|
2012-08-15 18:09:43 +04:00
|
|
|
find_package(Hg)
|
2009-06-26 17:55:35 +04:00
|
|
|
|
2010-10-02 01:23:53 +04:00
|
|
|
option(ExternalProjectTest_USE_FOLDERS "Enable folder grouping in IDEs." ON)
|
|
|
|
if(ExternalProjectTest_USE_FOLDERS)
|
|
|
|
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
|
|
|
|
else()
|
|
|
|
set_property(GLOBAL PROPERTY USE_FOLDERS OFF)
|
|
|
|
endif()
|
|
|
|
|
2010-09-03 21:53:22 +04:00
|
|
|
set_property(GLOBAL PROPERTY PREDEFINED_TARGETS_FOLDER
|
|
|
|
"CMakePredefinedTargets-in-ExternalProjectTest")
|
|
|
|
|
2009-06-24 23:03:26 +04:00
|
|
|
set(base "${CMAKE_BINARY_DIR}/CMakeExternals")
|
|
|
|
set(binary_base "${base}/Build")
|
|
|
|
set_property(DIRECTORY PROPERTY EP_BASE ${base})
|
2010-08-24 01:50:58 +04:00
|
|
|
set_property(DIRECTORY PROPERTY EP_STEP_TARGETS configure build test)
|
2008-12-04 21:27:48 +03:00
|
|
|
|
2013-01-16 18:10:48 +04:00
|
|
|
add_custom_target(NonExternalProjectTarget
|
|
|
|
COMMAND ${CMAKE_COMMAND} -E echo NonExternalProjectTarget)
|
2008-12-04 23:30:37 +03:00
|
|
|
|
2009-09-08 23:37:15 +04:00
|
|
|
# Empty projects that test all the known ExternalProject_Add argument key words:
|
2008-12-05 23:18:32 +03:00
|
|
|
#
|
2010-09-03 21:53:22 +04:00
|
|
|
set(proj AAA-TestAlphabetization)
|
|
|
|
ExternalProject_Add(${proj}
|
|
|
|
BUILD_COMMAND ""
|
|
|
|
CONFIGURE_COMMAND ""
|
|
|
|
DOWNLOAD_COMMAND ""
|
|
|
|
INSTALL_COMMAND ""
|
|
|
|
)
|
|
|
|
|
|
|
|
set(proj ZZZ-TestAlphabetization)
|
|
|
|
ExternalProject_Add(${proj}
|
|
|
|
BUILD_COMMAND ""
|
|
|
|
CONFIGURE_COMMAND ""
|
|
|
|
DOWNLOAD_COMMAND ""
|
|
|
|
INSTALL_COMMAND ""
|
|
|
|
)
|
|
|
|
|
2010-10-02 01:23:53 +04:00
|
|
|
set(proj TargetNameSameAsFolder)
|
|
|
|
ExternalProject_Add(${proj}
|
|
|
|
BUILD_COMMAND ""
|
|
|
|
CONFIGURE_COMMAND ""
|
|
|
|
DOWNLOAD_COMMAND ""
|
|
|
|
INSTALL_COMMAND ""
|
|
|
|
)
|
|
|
|
set_property(TARGET ${proj} PROPERTY FOLDER "${proj}")
|
|
|
|
|
2008-12-05 23:18:32 +03:00
|
|
|
set(proj MinimalNoOpProject)
|
2009-09-08 23:37:15 +04:00
|
|
|
ExternalProject_Add(${proj}
|
2008-12-05 23:18:32 +03:00
|
|
|
BUILD_COMMAND ""
|
|
|
|
CONFIGURE_COMMAND ""
|
|
|
|
DOWNLOAD_COMMAND ""
|
|
|
|
INSTALL_COMMAND ""
|
|
|
|
)
|
|
|
|
|
|
|
|
set(proj EmptyNoOpProject)
|
2009-09-08 23:37:15 +04:00
|
|
|
ExternalProject_Add(${proj}
|
2008-12-05 23:18:32 +03:00
|
|
|
BUILD_COMMAND ""
|
2009-03-18 18:00:30 +03:00
|
|
|
CMAKE_ARGS ""
|
2008-12-05 23:18:32 +03:00
|
|
|
CONFIGURE_COMMAND ""
|
|
|
|
CVS_REPOSITORY ""
|
|
|
|
CVS_MODULE ""
|
|
|
|
CVS_TAG ""
|
2013-01-16 18:10:48 +04:00
|
|
|
DEPENDS "MinimalNoOpProject" NonExternalProjectTarget
|
2008-12-05 23:18:32 +03:00
|
|
|
DOWNLOAD_COMMAND ""
|
2014-03-17 19:24:20 +04:00
|
|
|
DOWNLOAD_NO_PROGRESS 1
|
2008-12-05 23:18:32 +03:00
|
|
|
INSTALL_COMMAND ""
|
2009-03-18 18:01:02 +03:00
|
|
|
PATCH_COMMAND ""
|
2010-08-24 01:50:58 +04:00
|
|
|
STEP_TARGETS install update
|
2008-12-05 23:18:32 +03:00
|
|
|
SVN_REPOSITORY ""
|
2009-09-03 20:11:14 +04:00
|
|
|
SVN_REVISION ""
|
2011-04-12 00:34:58 +04:00
|
|
|
SVN_USERNAME ""
|
|
|
|
SVN_PASSWORD ""
|
|
|
|
SVN_TRUST_CERT 1
|
2009-09-03 20:11:14 +04:00
|
|
|
TEST_COMMAND ""
|
2010-05-27 20:21:56 +04:00
|
|
|
TIMEOUT ""
|
2009-06-24 23:03:26 +04:00
|
|
|
URL ""
|
2010-05-27 20:21:56 +04:00
|
|
|
URL_MD5 ""
|
2008-12-24 18:10:40 +03:00
|
|
|
UPDATE_COMMAND ""
|
2008-12-05 23:18:32 +03:00
|
|
|
)
|
2010-09-03 21:53:22 +04:00
|
|
|
set_property(TARGET ${proj} PROPERTY FOLDER "")
|
2008-12-05 23:18:32 +03:00
|
|
|
|
|
|
|
|
2010-05-31 22:22:24 +04:00
|
|
|
# CVS-based tests:
|
|
|
|
#
|
2009-06-29 18:46:45 +04:00
|
|
|
set(do_cvs_tests 0)
|
|
|
|
|
2009-06-26 17:55:35 +04:00
|
|
|
if(CVS_EXECUTABLE)
|
2009-06-29 18:46:45 +04:00
|
|
|
set(do_cvs_tests 1)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if(do_cvs_tests AND NOT UNIX)
|
|
|
|
if("${CVS_EXECUTABLE}" MATCHES "cygwin")
|
|
|
|
message(STATUS "No ExternalProject cvs tests with cygwin cvs.exe outside cygwin!")
|
|
|
|
set(do_cvs_tests 0)
|
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if(do_cvs_tests)
|
2009-06-26 19:32:04 +04:00
|
|
|
# Unzip/untar the CVS repository in our source folder so that other
|
2009-09-08 23:37:15 +04:00
|
|
|
# projects below may use it to test CVS args of ExternalProject_Add
|
2009-06-26 19:32:04 +04:00
|
|
|
#
|
|
|
|
set(proj SetupLocalCVSRepository)
|
|
|
|
set(local_cvs_repo "${CMAKE_CURRENT_BINARY_DIR}/LocalRepositories/CVS")
|
2009-09-08 23:37:15 +04:00
|
|
|
ExternalProject_Add(${proj}
|
2009-06-26 19:32:04 +04:00
|
|
|
SOURCE_DIR ${local_cvs_repo}
|
|
|
|
URL ${CMAKE_CURRENT_SOURCE_DIR}/cvsrepo.tgz
|
2010-05-27 20:21:56 +04:00
|
|
|
URL_MD5 55fc85825ffdd9ed2597123c68b79f7e
|
2009-06-26 19:32:04 +04:00
|
|
|
BUILD_COMMAND ""
|
2010-06-03 02:05:41 +04:00
|
|
|
CONFIGURE_COMMAND "${CVS_EXECUTABLE}" --version
|
2009-06-26 19:32:04 +04:00
|
|
|
INSTALL_COMMAND ""
|
|
|
|
)
|
2010-09-03 21:53:22 +04:00
|
|
|
set_property(TARGET ${proj}
|
|
|
|
PROPERTY FOLDER "SetupRepos/Local/Deeply/Nested/For/Testing")
|
2009-06-26 19:32:04 +04:00
|
|
|
|
2012-03-02 23:20:58 +04:00
|
|
|
# The MSYS cvs tool interprets "c:/" as a "machine:" name for SSH.
|
|
|
|
# Detect the MSYS cvs and convert the repo path to an MSYS path.
|
|
|
|
if(WIN32)
|
|
|
|
if(EXISTS "${CVS_EXECUTABLE}")
|
|
|
|
file(STRINGS "${CVS_EXECUTABLE}" cvs_is_msys LIMIT_COUNT 1 REGEX "[Mm][Ss][Yy][Ss]")
|
|
|
|
if(cvs_is_msys)
|
|
|
|
message(STATUS "'${CVS_EXECUTABLE}' is from MSYS (contains '${cvs_is_msys}')")
|
|
|
|
string(REGEX REPLACE "^([A-Za-z]):" "/\\1" local_cvs_repo "${local_cvs_repo}")
|
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
|
2008-12-04 21:27:48 +03:00
|
|
|
# CVS by date stamp:
|
|
|
|
#
|
2009-06-26 21:00:39 +04:00
|
|
|
set(proj TutorialStep1-CVS-20090626)
|
2009-09-08 23:37:15 +04:00
|
|
|
ExternalProject_Add(${proj}
|
2009-06-26 17:55:35 +04:00
|
|
|
CVS_REPOSITORY "${local_cvs_repo}"
|
|
|
|
CVS_MODULE "TutorialStep1"
|
2009-06-26 21:00:39 +04:00
|
|
|
CVS_TAG "-D2009-06-26 16:50:00 UTC"
|
|
|
|
UPDATE_COMMAND ""
|
2009-03-04 19:45:42 +03:00
|
|
|
CMAKE_GENERATOR "${CMAKE_GENERATOR}"
|
2009-06-24 23:03:26 +04:00
|
|
|
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR>
|
2008-12-05 23:18:32 +03:00
|
|
|
INSTALL_COMMAND ""
|
2009-06-26 17:55:35 +04:00
|
|
|
DEPENDS "SetupLocalCVSRepository"
|
2008-12-04 21:27:48 +03:00
|
|
|
)
|
2010-09-03 21:53:22 +04:00
|
|
|
set_property(TARGET ${proj} PROPERTY FOLDER "CVS")
|
2008-12-04 21:27:48 +03:00
|
|
|
|
|
|
|
# CVS by tag:
|
|
|
|
#
|
2009-06-26 17:55:35 +04:00
|
|
|
set(proj TutorialStep1-CVS-testtag1)
|
2009-09-08 23:37:15 +04:00
|
|
|
ExternalProject_Add(${proj}
|
2009-06-26 17:55:35 +04:00
|
|
|
CVS_REPOSITORY "${local_cvs_repo}"
|
|
|
|
CVS_MODULE "TutorialStep1"
|
|
|
|
CVS_TAG -rtesttag1
|
2009-06-26 21:00:39 +04:00
|
|
|
UPDATE_COMMAND ""
|
2009-03-04 19:45:42 +03:00
|
|
|
CMAKE_GENERATOR "${CMAKE_GENERATOR}"
|
2009-06-24 23:03:26 +04:00
|
|
|
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR>
|
2008-12-04 21:27:48 +03:00
|
|
|
INSTALL_COMMAND ""
|
2009-06-26 17:55:35 +04:00
|
|
|
DEPENDS "SetupLocalCVSRepository"
|
2008-12-04 21:27:48 +03:00
|
|
|
)
|
2010-09-03 21:53:22 +04:00
|
|
|
set_property(TARGET ${proj} PROPERTY FOLDER "CVS")
|
2008-12-04 21:27:48 +03:00
|
|
|
|
2009-06-26 17:55:35 +04:00
|
|
|
# Live CVS / HEAD (no CVS_TAG):
|
|
|
|
#
|
|
|
|
set(proj TutorialStep1-CVS-HEAD)
|
2009-09-08 23:37:15 +04:00
|
|
|
ExternalProject_Add(${proj}
|
2009-06-26 17:55:35 +04:00
|
|
|
CVS_REPOSITORY "${local_cvs_repo}"
|
|
|
|
CVS_MODULE "TutorialStep1"
|
|
|
|
CMAKE_GENERATOR "${CMAKE_GENERATOR}"
|
|
|
|
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR>
|
|
|
|
INSTALL_COMMAND ""
|
|
|
|
DEPENDS "SetupLocalCVSRepository"
|
|
|
|
DEPENDS "EmptyNoOpProject"
|
2009-06-26 21:00:39 +04:00
|
|
|
DEPENDS "TutorialStep1-CVS-20090626"
|
2009-06-26 17:55:35 +04:00
|
|
|
DEPENDS "TutorialStep1-CVS-testtag1"
|
|
|
|
)
|
2010-09-03 21:53:22 +04:00
|
|
|
set_property(TARGET ${proj} PROPERTY FOLDER "CVS")
|
2008-12-04 21:27:48 +03:00
|
|
|
endif()
|
|
|
|
|
|
|
|
|
2010-05-31 22:22:24 +04:00
|
|
|
# SVN-based tests:
|
|
|
|
#
|
2009-06-29 18:46:45 +04:00
|
|
|
set(do_svn_tests 0)
|
|
|
|
|
2009-06-26 17:55:35 +04:00
|
|
|
if(Subversion_SVN_EXECUTABLE)
|
2009-06-29 18:46:45 +04:00
|
|
|
set(do_svn_tests 1)
|
|
|
|
endif()
|
|
|
|
|
2009-07-01 21:48:38 +04:00
|
|
|
# Only do svn tests with svn >= version 1.2
|
|
|
|
#
|
|
|
|
if(do_svn_tests)
|
|
|
|
if(Subversion_VERSION_SVN VERSION_LESS 1.2)
|
|
|
|
message(STATUS "No ExternalProject svn tests with svn client less than version 1.2")
|
|
|
|
set(do_svn_tests 0)
|
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
|
|
|
|
# Only do svn tests in cygwin/cygwin or not-cygwin/not-cygwin arrangements:
|
|
|
|
#
|
|
|
|
if(do_svn_tests)
|
|
|
|
if(CMAKE_CURRENT_BINARY_DIR MATCHES "cygdrive/" AND
|
|
|
|
NOT "${Subversion_SVN_EXECUTABLE}" MATCHES "cygwin")
|
|
|
|
message(STATUS "No ExternalProject svn tests with non-cygwin svn client in a /cygdrive based build")
|
|
|
|
set(do_svn_tests 0)
|
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
|
2009-06-29 18:46:45 +04:00
|
|
|
if(do_svn_tests)
|
2009-06-26 19:32:04 +04:00
|
|
|
# Unzip/untar the SVN repository in our source folder so that other
|
2009-09-08 23:37:15 +04:00
|
|
|
# projects below may use it to test SVN args of ExternalProject_Add
|
2009-06-26 19:32:04 +04:00
|
|
|
#
|
|
|
|
set(proj SetupLocalSVNRepository)
|
|
|
|
set(local_svn_repo "${CMAKE_CURRENT_BINARY_DIR}/LocalRepositories/SVN")
|
|
|
|
set(local_svn_repo_url "file:///${local_svn_repo}/TutorialStep1")
|
2009-09-08 23:37:15 +04:00
|
|
|
ExternalProject_Add(${proj}
|
2009-06-26 19:32:04 +04:00
|
|
|
SOURCE_DIR ${local_svn_repo}
|
|
|
|
URL ${CMAKE_CURRENT_SOURCE_DIR}/svnrepo.tgz
|
2010-05-27 20:21:56 +04:00
|
|
|
URL_MD5 2f468be4ed1fa96377fca0cc830819c4
|
2009-06-26 19:32:04 +04:00
|
|
|
BUILD_COMMAND ""
|
2010-06-03 02:05:41 +04:00
|
|
|
CONFIGURE_COMMAND "${Subversion_SVN_EXECUTABLE}" --version
|
2009-06-26 19:32:04 +04:00
|
|
|
INSTALL_COMMAND ""
|
|
|
|
)
|
2010-09-03 21:53:22 +04:00
|
|
|
set_property(TARGET ${proj}
|
|
|
|
PROPERTY FOLDER "SetupRepos/Local/Deeply/Nested/For/Testing")
|
2009-06-26 19:32:04 +04:00
|
|
|
|
2008-12-04 21:27:48 +03:00
|
|
|
# SVN by date stamp:
|
|
|
|
#
|
2009-06-26 21:00:39 +04:00
|
|
|
set(proj TutorialStep1-SVN-20090626)
|
2009-09-08 23:37:15 +04:00
|
|
|
ExternalProject_Add(${proj}
|
2009-06-26 17:55:35 +04:00
|
|
|
SVN_REPOSITORY "${local_svn_repo_url}"
|
2009-09-03 20:11:14 +04:00
|
|
|
SVN_REVISION "-r{2009-06-26 16:50:00 +0000}"
|
2009-06-26 21:00:39 +04:00
|
|
|
UPDATE_COMMAND ""
|
2009-03-04 19:45:42 +03:00
|
|
|
CMAKE_GENERATOR "${CMAKE_GENERATOR}"
|
2009-06-24 23:03:26 +04:00
|
|
|
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR>
|
2009-06-26 17:55:35 +04:00
|
|
|
INSTALL_COMMAND ""
|
|
|
|
DEPENDS "SetupLocalSVNRepository"
|
2008-12-04 21:27:48 +03:00
|
|
|
)
|
2010-09-03 21:53:22 +04:00
|
|
|
set_property(TARGET ${proj} PROPERTY FOLDER "SVN")
|
2008-12-04 21:27:48 +03:00
|
|
|
|
|
|
|
# SVN by revision number:
|
|
|
|
#
|
2009-06-26 17:55:35 +04:00
|
|
|
set(proj TutorialStep1-SVN-r2)
|
2009-09-08 23:37:15 +04:00
|
|
|
ExternalProject_Add(${proj}
|
2009-06-26 17:55:35 +04:00
|
|
|
SVN_REPOSITORY "${local_svn_repo_url}"
|
2009-09-03 20:11:14 +04:00
|
|
|
SVN_REVISION "-r2"
|
2009-06-26 21:00:39 +04:00
|
|
|
UPDATE_COMMAND ""
|
2009-03-04 19:45:42 +03:00
|
|
|
CMAKE_GENERATOR "${CMAKE_GENERATOR}"
|
2009-06-24 23:03:26 +04:00
|
|
|
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR>
|
2008-12-04 21:27:48 +03:00
|
|
|
INSTALL_COMMAND ""
|
2009-06-26 17:55:35 +04:00
|
|
|
DEPENDS "SetupLocalSVNRepository"
|
2008-12-04 21:27:48 +03:00
|
|
|
)
|
2010-09-03 21:53:22 +04:00
|
|
|
set_property(TARGET ${proj} PROPERTY FOLDER "SVN")
|
2008-12-04 21:27:48 +03:00
|
|
|
|
2009-09-03 20:11:14 +04:00
|
|
|
# Live SVN / trunk (no SVN_REVISION):
|
2008-12-04 21:27:48 +03:00
|
|
|
#
|
2009-06-26 17:55:35 +04:00
|
|
|
set(proj TutorialStep1-SVN-trunk)
|
2009-09-08 23:37:15 +04:00
|
|
|
ExternalProject_Add(${proj}
|
2009-06-26 17:55:35 +04:00
|
|
|
SVN_REPOSITORY "${local_svn_repo_url}"
|
2009-03-04 19:45:42 +03:00
|
|
|
CMAKE_GENERATOR "${CMAKE_GENERATOR}"
|
2009-06-24 23:03:26 +04:00
|
|
|
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR>
|
2008-12-04 21:27:48 +03:00
|
|
|
INSTALL_COMMAND ""
|
2009-06-26 17:55:35 +04:00
|
|
|
DEPENDS "SetupLocalSVNRepository"
|
2010-06-21 21:00:41 +04:00
|
|
|
LOG_DOWNLOAD 1
|
2008-12-04 21:27:48 +03:00
|
|
|
)
|
2010-09-03 21:53:22 +04:00
|
|
|
set_property(TARGET ${proj} PROPERTY FOLDER "SVN")
|
2008-12-04 21:27:48 +03:00
|
|
|
endif()
|
|
|
|
|
|
|
|
|
2010-06-02 02:18:33 +04:00
|
|
|
set(do_git_tests 0)
|
|
|
|
|
2010-06-04 01:30:07 +04:00
|
|
|
if(GIT_EXECUTABLE)
|
2010-06-02 02:18:33 +04:00
|
|
|
set(do_git_tests 1)
|
2010-06-03 02:05:41 +04:00
|
|
|
|
|
|
|
execute_process(
|
2010-06-04 01:30:07 +04:00
|
|
|
COMMAND "${GIT_EXECUTABLE}" --version
|
2010-06-03 02:05:41 +04:00
|
|
|
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()
|
2010-06-02 02:18:33 +04:00
|
|
|
endif()
|
|
|
|
|
|
|
|
|
|
|
|
if(do_git_tests)
|
2010-06-03 23:59:36 +04:00
|
|
|
set(local_git_repo "../../LocalRepositories/GIT")
|
2010-06-02 02:18:33 +04:00
|
|
|
|
|
|
|
# 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}
|
2010-06-04 01:30:07 +04:00
|
|
|
SOURCE_DIR ${CMAKE_CURRENT_BINARY_DIR}/LocalRepositories/GIT
|
2010-06-02 02:18:33 +04:00
|
|
|
URL ${CMAKE_CURRENT_SOURCE_DIR}/gitrepo.tgz
|
|
|
|
BUILD_COMMAND ""
|
2010-06-04 01:30:07 +04:00
|
|
|
CONFIGURE_COMMAND "${GIT_EXECUTABLE}" --version
|
2010-06-02 02:18:33 +04:00
|
|
|
INSTALL_COMMAND ""
|
|
|
|
)
|
2010-09-03 21:53:22 +04:00
|
|
|
set_property(TARGET ${proj}
|
|
|
|
PROPERTY FOLDER "SetupRepos/Local/Deeply/Nested/For/Testing")
|
2010-06-02 02:18:33 +04:00
|
|
|
|
|
|
|
# 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"
|
|
|
|
)
|
2010-09-03 21:53:22 +04:00
|
|
|
set_property(TARGET ${proj} PROPERTY FOLDER "GIT")
|
2010-06-02 02:18:33 +04:00
|
|
|
|
|
|
|
# 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"
|
|
|
|
)
|
2010-09-03 21:53:22 +04:00
|
|
|
set_property(TARGET ${proj} PROPERTY FOLDER "GIT")
|
2010-06-02 02:18:33 +04:00
|
|
|
|
|
|
|
# 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"
|
2010-06-21 21:00:41 +04:00
|
|
|
LOG_UPDATE 1
|
2010-06-02 02:18:33 +04:00
|
|
|
)
|
2010-09-03 21:53:22 +04:00
|
|
|
set_property(TARGET ${proj} PROPERTY FOLDER "GIT")
|
2014-01-09 18:07:10 +04:00
|
|
|
|
|
|
|
# git by explicit branch/tag with empty submodule list
|
|
|
|
#
|
|
|
|
set(proj TutorialStep1-GIT-bytag-withsubmodules)
|
|
|
|
ExternalProject_Add(${proj}
|
|
|
|
GIT_REPOSITORY "${local_git_repo}"
|
|
|
|
GIT_TAG "origin/master"
|
|
|
|
GIT_SUBMODULES ""
|
|
|
|
UPDATE_COMMAND ""
|
|
|
|
CMAKE_GENERATOR "${CMAKE_GENERATOR}"
|
|
|
|
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR>
|
|
|
|
INSTALL_COMMAND ""
|
|
|
|
DEPENDS "SetupLocalGITRepository"
|
|
|
|
)
|
|
|
|
set_property(TARGET ${proj} PROPERTY FOLDER "GIT")
|
|
|
|
|
2010-06-02 02:18:33 +04:00
|
|
|
endif()
|
|
|
|
|
2012-08-15 18:09:43 +04:00
|
|
|
set(do_hg_tests 0)
|
|
|
|
|
|
|
|
if(HG_EXECUTABLE)
|
|
|
|
set(do_hg_tests 1)
|
|
|
|
endif()
|
|
|
|
|
2014-10-21 23:16:41 +04:00
|
|
|
if(do_hg_tests AND NOT UNIX)
|
|
|
|
if("${HG_EXECUTABLE}" MATCHES "cygwin")
|
|
|
|
message(STATUS "No ExternalProject hg tests with cygwin hg outside cygwin!")
|
|
|
|
set(do_hg_tests 0)
|
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
|
2012-08-15 18:09:43 +04:00
|
|
|
if(do_hg_tests)
|
|
|
|
set(local_hg_repo "../../LocalRepositories/HG")
|
|
|
|
|
|
|
|
# Unzip/untar the hg repository in our source folder so that other
|
|
|
|
# projects below may use it to test hg args of ExternalProject_Add
|
|
|
|
#
|
|
|
|
set(proj SetupLocalHGRepository)
|
|
|
|
ExternalProject_Add(${proj}
|
|
|
|
SOURCE_DIR ${CMAKE_CURRENT_BINARY_DIR}/LocalRepositories/HG
|
|
|
|
URL ${CMAKE_CURRENT_SOURCE_DIR}/hgrepo.tgz
|
|
|
|
BUILD_COMMAND ""
|
|
|
|
CONFIGURE_COMMAND "${HG_EXECUTABLE}" --version
|
|
|
|
INSTALL_COMMAND ""
|
|
|
|
)
|
|
|
|
set_property(TARGET ${proj}
|
|
|
|
PROPERTY FOLDER "SetupRepos/Local/Deeply/Nested/For/Testing")
|
|
|
|
|
|
|
|
|
|
|
|
# hg by commit id:
|
|
|
|
#
|
|
|
|
set(proj TutorialStep1-HG-byhash)
|
|
|
|
ExternalProject_Add(${proj}
|
|
|
|
HG_REPOSITORY "${local_hg_repo}"
|
|
|
|
HG_TAG dd2ce38a6b8a
|
|
|
|
UPDATE_COMMAND ""
|
|
|
|
CMAKE_GENERATOR "${CMAKE_GENERATOR}"
|
|
|
|
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR>
|
|
|
|
INSTALL_COMMAND ""
|
|
|
|
DEPENDS "SetupLocalHGRepository"
|
|
|
|
)
|
|
|
|
set_property(TARGET ${proj} PROPERTY FOLDER "HG")
|
|
|
|
|
|
|
|
# hg by explicit branch/tag name:
|
|
|
|
#
|
|
|
|
set(proj TutorialStep1-HG-bytag)
|
|
|
|
ExternalProject_Add(${proj}
|
|
|
|
HG_REPOSITORY "${local_hg_repo}"
|
|
|
|
HG_TAG "default"
|
|
|
|
UPDATE_COMMAND ""
|
|
|
|
CMAKE_GENERATOR "${CMAKE_GENERATOR}"
|
|
|
|
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR>
|
|
|
|
INSTALL_COMMAND ""
|
|
|
|
DEPENDS "SetupLocalHGRepository"
|
|
|
|
)
|
|
|
|
set_property(TARGET ${proj} PROPERTY FOLDER "HG")
|
|
|
|
|
|
|
|
# Live hg / tip (no HG_TAG):
|
|
|
|
#
|
|
|
|
# Mercurial 2.1 does not distinguish an empty pull from a failed pull,
|
|
|
|
# so do not run the test with that version.
|
|
|
|
if(NOT "${HG_VERSION_STRING}" STREQUAL "2.1")
|
|
|
|
set(proj TutorialStep1-HG-tip)
|
|
|
|
ExternalProject_Add(${proj}
|
|
|
|
HG_REPOSITORY "${local_hg_repo}"
|
|
|
|
CMAKE_GENERATOR "${CMAKE_GENERATOR}"
|
|
|
|
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR>
|
|
|
|
INSTALL_COMMAND ""
|
|
|
|
DEPENDS "SetupLocalHGRepository"
|
|
|
|
LOG_UPDATE 1
|
|
|
|
)
|
|
|
|
set_property(TARGET ${proj} PROPERTY FOLDER "HG")
|
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
|
2010-06-02 02:18:33 +04:00
|
|
|
|
2008-12-04 21:27:48 +03:00
|
|
|
# Test the testable built/installed products:
|
|
|
|
#
|
|
|
|
enable_testing()
|
|
|
|
|
|
|
|
|
|
|
|
# Do at least a smoke test of a built executable from each
|
|
|
|
# project's build directory...
|
|
|
|
#
|
|
|
|
# BuildTree tests:
|
|
|
|
#
|
2009-06-29 18:46:45 +04:00
|
|
|
if(do_cvs_tests)
|
2009-06-26 21:00:39 +04:00
|
|
|
add_test(TutorialStep1-CVS-20090626-BuildTreeTest
|
|
|
|
"${binary_base}/TutorialStep1-CVS-20090626/Tutorial" 4)
|
2008-12-04 21:27:48 +03:00
|
|
|
|
2009-06-26 17:55:35 +04:00
|
|
|
add_test(TutorialStep1-CVS-testtag1-BuildTreeTest
|
|
|
|
"${binary_base}/TutorialStep1-CVS-testtag1/Tutorial" 64)
|
2008-12-04 21:27:48 +03:00
|
|
|
|
2009-06-26 17:55:35 +04:00
|
|
|
add_test(TutorialStep1-CVS-HEAD-BuildTreeTest
|
|
|
|
"${binary_base}/TutorialStep1-CVS-HEAD/Tutorial" 81)
|
2008-12-04 21:27:48 +03:00
|
|
|
endif()
|
|
|
|
|
2009-06-29 18:46:45 +04:00
|
|
|
if(do_svn_tests)
|
2009-06-26 21:00:39 +04:00
|
|
|
add_test(TutorialStep1-SVN-20090626-BuildTreeTest
|
|
|
|
"${binary_base}/TutorialStep1-SVN-20090626/Tutorial" 100)
|
2008-12-04 21:27:48 +03:00
|
|
|
|
2009-06-26 17:55:35 +04:00
|
|
|
add_test(TutorialStep1-SVN-r2-BuildTreeTest
|
|
|
|
"${binary_base}/TutorialStep1-SVN-r2/Tutorial" 99)
|
2008-12-04 21:27:48 +03:00
|
|
|
|
2009-06-26 17:55:35 +04:00
|
|
|
add_test(TutorialStep1-SVN-trunk-BuildTreeTest
|
|
|
|
"${binary_base}/TutorialStep1-SVN-trunk/Tutorial" 98)
|
2008-12-04 21:27:48 +03:00
|
|
|
endif()
|
|
|
|
|
2012-07-26 22:24:41 +04:00
|
|
|
if(do_git_tests)
|
|
|
|
add_test(TutorialStep1-GIT-byhash
|
|
|
|
"${binary_base}/TutorialStep1-GIT-byhash/Tutorial" 100)
|
|
|
|
|
|
|
|
add_test(TutorialStep1-GIT-bytag
|
|
|
|
"${binary_base}/TutorialStep1-GIT-bytag/Tutorial" 99)
|
|
|
|
|
|
|
|
add_test(TutorialStep1-GIT-master
|
|
|
|
"${binary_base}/TutorialStep1-GIT-master/Tutorial" 98)
|
|
|
|
endif()
|
|
|
|
|
2008-12-04 21:27:48 +03:00
|
|
|
|
2010-06-02 02:18:33 +04:00
|
|
|
message(STATUS "do_cvs_tests='${do_cvs_tests}'")
|
|
|
|
message(STATUS "do_svn_tests='${do_svn_tests}'")
|
2012-08-15 18:09:43 +04:00
|
|
|
message(STATUS "do_git_tests='${do_git_tests}' GIT_EXECUTABLE='${GIT_EXECUTABLE}'")
|
|
|
|
message(STATUS "do_hg_tests='${do_hg_tests}' HG_EXECUTABLE='${HG_EXECUTABLE}'")
|
2015-05-20 16:14:17 +03:00
|
|
|
|
|
|
|
|
|
|
|
# Test if log works when the first arguments of *_COMMAND is "COMMAND".
|
|
|
|
set(proj ExternalProject-no-log)
|
|
|
|
set(download_cmd "")
|
|
|
|
set(patch_cmd "")
|
|
|
|
set(update_cmd "")
|
|
|
|
set(configure_cmd "")
|
|
|
|
set(build_cmd "")
|
|
|
|
set(install_cmd "")
|
|
|
|
|
|
|
|
ExternalProject_Add(${proj}
|
|
|
|
DOWNLOAD_COMMAND "${download_cmd}" COMMAND "${CMAKE_COMMAND}" -E echo "download"
|
|
|
|
PATCH_COMMAND "${patch_cmd}" COMMAND "${CMAKE_COMMAND}" -E echo "patch"
|
|
|
|
UPDATE_COMMAND "${update_cmd}" COMMAND "${CMAKE_COMMAND}" -E echo "update"
|
|
|
|
CONFIGURE_COMMAND "${configure_cmd}" COMMAND "${CMAKE_COMMAND}" -E echo "configure"
|
|
|
|
BUILD_COMMAND "${build_cmd}" COMMAND "${CMAKE_COMMAND}" -E echo "build"
|
|
|
|
INSTALL_COMMAND "${install_cmd}" COMMAND "${CMAKE_COMMAND}" -E echo "install"
|
|
|
|
)
|
|
|
|
|
|
|
|
set(proj ExternalProject-log)
|
|
|
|
ExternalProject_Add(${proj}
|
|
|
|
DOWNLOAD_COMMAND "${download_cmd}" COMMAND "${CMAKE_COMMAND}" -E echo "download"
|
|
|
|
PATCH_COMMAND "${patch_cmd}" COMMAND "${CMAKE_COMMAND}" -E echo "patch"
|
|
|
|
UPDATE_COMMAND "${update_cmd}" COMMAND "${CMAKE_COMMAND}" -E echo "update"
|
|
|
|
CONFIGURE_COMMAND "${configure_cmd}" COMMAND "${CMAKE_COMMAND}" -E echo "configure"
|
|
|
|
BUILD_COMMAND "${build_cmd}" COMMAND "${CMAKE_COMMAND}" -E echo "build"
|
|
|
|
INSTALL_COMMAND "${install_cmd}" COMMAND "${CMAKE_COMMAND}" -E echo "install"
|
|
|
|
LOG_DOWNLOAD 1
|
|
|
|
LOG_PATCH 1
|
|
|
|
LOG_UPDATE 1
|
|
|
|
LOG_CONFIGURE 1
|
|
|
|
LOG_BUILD 1
|
|
|
|
LOG_INSTALL 1
|
|
|
|
)
|