summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--CMakeCPack.cmake15
-rw-r--r--CMakeLists.txt12
-rw-r--r--ChangeLog.manual1
-rw-r--r--Modules/DartConfiguration.tcl.in1
-rw-r--r--Modules/ExternalProject.cmake15
-rw-r--r--Modules/FindQt4.cmake28
-rw-r--r--Modules/FindThreads.cmake6
-rw-r--r--Modules/Platform/OSF1.cmake1
-rw-r--r--Modules/Platform/Windows-GNU-Fortran.cmake1
-rw-r--r--Modules/Platform/Windows-GNU.cmake2
-rw-r--r--Modules/Qt4ConfigDependentSettings.cmake7
-rw-r--r--Source/CMakeLists.txt1
-rw-r--r--Source/CTest/cmCTestCoverageHandler.cxx8
-rw-r--r--Source/CTest/cmCTestGIT.cxx98
-rw-r--r--Source/CTest/cmCTestGIT.h4
-rw-r--r--Source/CTest/cmCTestMultiProcessHandler.cxx15
-rw-r--r--Source/CTest/cmCTestMultiProcessHandler.h1
-rw-r--r--Source/CTest/cmCTestRunTest.cxx15
-rw-r--r--Source/CTest/cmCTestRunTest.h3
-rw-r--r--Source/CTest/cmCTestTestHandler.cxx4
-rw-r--r--Source/CTest/cmCTestUpdateCommand.cxx2
-rw-r--r--Source/cmDocumentVariables.cxx4
-rw-r--r--Source/cmLocalGenerator.cxx4
-rw-r--r--Source/cmLocalGenerator.h2
-rw-r--r--Source/cmMakefileTargetGenerator.cxx24
-rw-r--r--Source/cmSetPropertyCommand.h4
-rw-r--r--Source/cmSetSourceFilesPropertiesCommand.h36
-rw-r--r--Source/cmStandardIncludes.cxx16
-rw-r--r--Source/cmStandardIncludes.h3
-rw-r--r--Source/cmVisualStudio10TargetGenerator.cxx49
-rw-r--r--Source/cmVisualStudio10TargetGenerator.h4
-rw-r--r--Source/kwsys/kwsysDateStamp.cmake2
-rw-r--r--Tests/CMakeLists.txt33
-rw-r--r--Tests/CTestUpdateBZR.cmake.in4
-rw-r--r--Tests/CTestUpdateCVS.cmake.in4
-rw-r--r--Tests/CTestUpdateCommon.cmake18
-rw-r--r--Tests/CTestUpdateGIT.cmake.in59
-rwxr-xr-xTests/CTestUpdateGIT.sh.in2
-rw-r--r--Tests/CTestUpdateHG.cmake.in4
-rw-r--r--Tests/CTestUpdateSVN.cmake.in4
-rw-r--r--Tests/bootstrap.bat.in2
-rwxr-xr-xbootstrap1
42 files changed, 364 insertions, 155 deletions
diff --git a/CMakeCPack.cmake b/CMakeCPack.cmake
index ce88d2f..692befa 100644
--- a/CMakeCPack.cmake
+++ b/CMakeCPack.cmake
@@ -27,9 +27,7 @@ IF(EXISTS "${CMAKE_ROOT}/Modules/CPack.cmake")
SET(CPACK_PACKAGE_VENDOR "Kitware")
SET(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/Copyright.txt")
SET(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/Copyright.txt")
- SET(CPACK_PACKAGE_VERSION_MAJOR "${CMake_VERSION_MAJOR}")
- SET(CPACK_PACKAGE_VERSION_MINOR "${CMake_VERSION_MINOR}")
- SET(CPACK_PACKAGE_VERSION_PATCH "${CMake_VERSION_PATCH}")
+ SET(CPACK_PACKAGE_VERSION "${CMake_VERSION}")
SET(CPACK_PACKAGE_INSTALL_DIRECTORY "CMake ${CMake_VERSION_MAJOR}.${CMake_VERSION_MINOR}")
SET(CPACK_SOURCE_PACKAGE_FILE_NAME "cmake-${CMake_VERSION}")
IF(NOT DEFINED CPACK_SYSTEM_NAME)
@@ -68,17 +66,6 @@ IF(EXISTS "${CMAKE_ROOT}/Modules/CPack.cmake")
# cygwin specific packaging stuff
IF(CYGWIN)
- # if we are on cygwin and have cpack, then force the
- # doc, data and man dirs to conform to cygwin style directories
- SET(CMAKE_DOC_DIR "/share/doc/${CPACK_PACKAGE_FILE_NAME}")
- SET(CMAKE_DATA_DIR "/share/${CPACK_PACKAGE_FILE_NAME}")
- SET(CMAKE_MAN_DIR "/share/man")
- # let the user know we just forced these values
- MESSAGE(STATUS "Setup for Cygwin packaging")
- MESSAGE(STATUS "Override cache CMAKE_DOC_DIR = ${CMAKE_DOC_DIR}")
- MESSAGE(STATUS "Override cache CMAKE_DATA_DIR = ${CMAKE_DATA_DIR}")
- MESSAGE(STATUS "Override cache CMAKE_MAN_DIR = ${CMAKE_MAN_DIR}")
-
# setup the cygwin package name
SET(CPACK_PACKAGE_NAME cmake)
# setup the name of the package for cygwin cmake-2.4.3
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 69b45a4..bd90163 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -271,6 +271,7 @@ MACRO (CMAKE_BUILD_UTILITIES)
SET(HAVE_ZLIB_H 1)
SET(ZLIB_INCLUDE_DIR ${CMAKE_ZLIB_INCLUDES})
SET(ZLIB_LIBRARIES ${CMAKE_ZLIB_LIBRARIES})
+ SET(ZLIB_LIBRARY ${CMAKE_ZLIB_LIBRARIES})
SET(BUILD_ARCHIVE_WITHIN_CMAKE TRUE)
ADD_DEFINITIONS(-DLIBARCHIVE_STATIC)
ADD_SUBDIRECTORY(Utilities/cmlibarchive)
@@ -395,6 +396,17 @@ SET(CMAKE_DOC_DIR "/doc/cmake-${CMake_VERSION_MAJOR}.${CMake_VERSION_MINOR}" CAC
SET(CMAKE_MAN_DIR "/man" CACHE STRING
"Install location for man pages (relative to prefix).")
MARK_AS_ADVANCED(CMAKE_DATA_DIR CMAKE_DOC_DIR CMAKE_MAN_DIR)
+IF(CYGWIN AND EXISTS "${CMAKE_ROOT}/Modules/CPack.cmake")
+ # Force doc, data and man dirs to conform to cygwin layout.
+ SET(CMAKE_DOC_DIR "/share/doc/cmake-${CMake_VERSION}")
+ SET(CMAKE_DATA_DIR "/share/cmake-${CMake_VERSION}")
+ SET(CMAKE_MAN_DIR "/share/man")
+ # let the user know we just forced these values
+ MESSAGE(STATUS "Setup for Cygwin packaging")
+ MESSAGE(STATUS "Override cache CMAKE_DOC_DIR = ${CMAKE_DOC_DIR}")
+ MESSAGE(STATUS "Override cache CMAKE_DATA_DIR = ${CMAKE_DATA_DIR}")
+ MESSAGE(STATUS "Override cache CMAKE_MAN_DIR = ${CMAKE_MAN_DIR}")
+ENDIF()
STRING(REGEX REPLACE "^/" "" CMake_DATA_DEST "${CMAKE_DATA_DIR}")
STRING(REGEX REPLACE "^/" "" CMake_DOC_DEST "${CMAKE_DOC_DIR}")
diff --git a/ChangeLog.manual b/ChangeLog.manual
index 29162e9..b935860 100644
--- a/ChangeLog.manual
+++ b/ChangeLog.manual
@@ -15,6 +15,7 @@ Changes since CMake 2.8.1
- CTest: Report failure in Update.xml
- CTest: Submit author email in Update.xml
- CTest: Teach ctest_update about Git submodules
+- CTest: Teach ctest_update to handle Git upstream branch rewrites
- Cygwin: Export all symbols with ENABLE_EXPORTS (#10122)
- Do not list file names during 'cmake -E tar xz'
- Documentation: Comply with "XHTML 1.0 Strict"
diff --git a/Modules/DartConfiguration.tcl.in b/Modules/DartConfiguration.tcl.in
index 85b4138..51f514f 100644
--- a/Modules/DartConfiguration.tcl.in
+++ b/Modules/DartConfiguration.tcl.in
@@ -49,6 +49,7 @@ SVNUpdateOptions: @SVN_UPDATE_OPTIONS@
# Git options
GITCommand: @GITCOMMAND@
GITUpdateOptions: @GIT_UPDATE_OPTIONS@
+GITUpdateCustom: @CTEST_GIT_UPDATE_CUSTOM@
# Generic update command
UpdateCommand: @UPDATE_COMMAND@
diff --git a/Modules/ExternalProject.cmake b/Modules/ExternalProject.cmake
index 15749f2..d0845e6 100644
--- a/Modules/ExternalProject.cmake
+++ b/Modules/ExternalProject.cmake
@@ -738,6 +738,16 @@ function(_ep_get_git_version git_EXECUTABLE git_version_var)
endfunction()
+function(_ep_is_dir_empty dir empty_var)
+ file(GLOB gr "${dir}/*")
+ if("${gr}" STREQUAL "")
+ set(${empty_var} 1 PARENT_SCOPE)
+ else()
+ set(${empty_var} 0 PARENT_SCOPE)
+ endif()
+endfunction()
+
+
function(_ep_add_download_command name)
ExternalProject_Get_Property(${name} source_dir stamp_dir download_dir tmp_dir)
@@ -890,7 +900,10 @@ function(_ep_add_download_command name)
list(APPEND cmd ${CMAKE_COMMAND} -P ${stamp_dir}/extract-${name}.cmake)
endif()
else()
- message(SEND_ERROR "error: no download info for '${name}' -- please specify existing SOURCE_DIR or one of URL, CVS_REPOSITORY and CVS_MODULE, SVN_REPOSITORY or DOWNLOAD_COMMAND")
+ _ep_is_dir_empty("${source_dir}" empty)
+ if(${empty})
+ message(SEND_ERROR "error: no download info for '${name}' -- please specify existing/non-empty SOURCE_DIR or one of URL, CVS_REPOSITORY and CVS_MODULE, SVN_REPOSITORY, GIT_REPOSITORY or DOWNLOAD_COMMAND")
+ endif()
endif()
ExternalProject_Add_Step(${name} download
diff --git a/Modules/FindQt4.cmake b/Modules/FindQt4.cmake
index f2de4c9..654879e 100644
--- a/Modules/FindQt4.cmake
+++ b/Modules/FindQt4.cmake
@@ -360,34 +360,6 @@ SET( QT_DEFINITIONS "")
SET(QT4_INSTALLED_VERSION_TOO_OLD FALSE)
-# macro for asking qmake to process pro files
-MACRO(QT_QUERY_QMAKE outvar invar)
- IF(QT_QMAKE_EXECUTABLE)
- FILE(WRITE ${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmpQmake/tmp.pro
- "message(CMAKE_MESSAGE<$$${invar}>)")
-
- # Invoke qmake with the tmp.pro program to get the desired
- # information. Use the same variable for both stdout and stderr
- # to make sure we get the output on all platforms.
- EXECUTE_PROCESS(COMMAND ${QT_QMAKE_EXECUTABLE}
- WORKING_DIRECTORY
- ${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmpQmake
- OUTPUT_VARIABLE _qmake_query_output
- RESULT_VARIABLE _qmake_result
- ERROR_VARIABLE _qmake_query_output )
-
- FILE(REMOVE_RECURSE
- "${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmpQmake")
-
- IF(_qmake_result)
- MESSAGE(WARNING " querying qmake for ${invar}. qmake reported:\n${_qmake_query_output}")
- ELSE(_qmake_result)
- STRING(REGEX REPLACE ".*CMAKE_MESSAGE<([^>]*).*" "\\1" ${outvar} "${_qmake_query_output}")
- ENDIF(_qmake_result)
-
- ENDIF(QT_QMAKE_EXECUTABLE)
-ENDMACRO(QT_QUERY_QMAKE)
-
GET_FILENAME_COMPONENT(qt_install_version "[HKEY_CURRENT_USER\\Software\\trolltech\\Versions;DefaultQtVersion]" NAME)
# check for qmake
# Debian uses qmake-qt4
diff --git a/Modules/FindThreads.cmake b/Modules/FindThreads.cmake
index 459129b..2a74304 100644
--- a/Modules/FindThreads.cmake
+++ b/Modules/FindThreads.cmake
@@ -5,6 +5,8 @@
# CMAKE_USE_WIN32_THREADS_INIT - using WIN32 threads?
# CMAKE_USE_PTHREADS_INIT - are we using pthreads
# CMAKE_HP_PTHREADS_INIT - are we using hp pthreads
+# For systems with multiple thread libraries, caller can set
+# CMAKE_THREAD_PREFER_PTHREADS
#=============================================================================
# Copyright 2002-2009 Kitware, Inc.
@@ -24,11 +26,11 @@ INCLUDE (CheckLibraryExists)
SET(Threads_FOUND FALSE)
# Do we have sproc?
-IF(CMAKE_SYSTEM MATCHES IRIX)
+IF(CMAKE_SYSTEM MATCHES IRIX AND NOT CMAKE_THREAD_PREFER_PTHREAD)
CHECK_INCLUDE_FILES("sys/types.h;sys/prctl.h" CMAKE_HAVE_SPROC_H)
ENDIF()
-IF(CMAKE_HAVE_SPROC_H)
+IF(CMAKE_HAVE_SPROC_H AND NOT CMAKE_THREAD_PREFER_PTHREAD)
# We have sproc
SET(CMAKE_USE_SPROC_INIT 1)
ELSE()
diff --git a/Modules/Platform/OSF1.cmake b/Modules/Platform/OSF1.cmake
index 652bed4..076410a 100644
--- a/Modules/Platform/OSF1.cmake
+++ b/Modules/Platform/OSF1.cmake
@@ -25,6 +25,7 @@ IF(CMAKE_SYSTEM MATCHES "OSF1-V.*")
SET(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG_SEP ":")
ENDIF(CMAKE_SYSTEM MATCHES "OSF1-V.*")
+SET(CMAKE_MAKE_INCLUDE_FROM_ROOT 1) # include $(CMAKE_BINARY_DIR)/...
IF(CMAKE_COMPILER_IS_GNUCXX)
# include the gcc flags
diff --git a/Modules/Platform/Windows-GNU-Fortran.cmake b/Modules/Platform/Windows-GNU-Fortran.cmake
index c66feed..8273a19 100644
--- a/Modules/Platform/Windows-GNU-Fortran.cmake
+++ b/Modules/Platform/Windows-GNU-Fortran.cmake
@@ -1,2 +1,3 @@
include(Platform/Windows-GNU)
__windows_compiler_gnu(Fortran)
+set(CMAKE_Fortran_USE_RESPONSE_FILE_FOR_OBJECTS 0)
diff --git a/Modules/Platform/Windows-GNU.cmake b/Modules/Platform/Windows-GNU.cmake
index 6d84940..af03841 100644
--- a/Modules/Platform/Windows-GNU.cmake
+++ b/Modules/Platform/Windows-GNU.cmake
@@ -68,6 +68,8 @@ macro(__windows_compiler_gnu lang)
endif()
set(CMAKE_SHARED_LIBRARY_${lang}_FLAGS "") # No -fPIC on Windows
+ set(CMAKE_${lang}_USE_RESPONSE_FILE_FOR_OBJECTS 1)
+ set(CMAKE_${lang}_RESPONSE_FILE_LINK_FLAG "-Wl,@")
# Binary link rules.
set(CMAKE_${lang}_CREATE_SHARED_MODULE
diff --git a/Modules/Qt4ConfigDependentSettings.cmake b/Modules/Qt4ConfigDependentSettings.cmake
index ccbc828..1d77c7a 100644
--- a/Modules/Qt4ConfigDependentSettings.cmake
+++ b/Modules/Qt4ConfigDependentSettings.cmake
@@ -301,8 +301,11 @@ IF(Q_WS_X11)
# X11 libraries Qt always depends on
SET(QT_QTGUI_LIB_DEPENDENCIES ${QT_QTGUI_LIB_DEPENDENCIES} ${X11_Xext_LIB} ${X11_X11_LIB})
- QT_QUERY_QMAKE(QT_LIBS_THREAD "QMAKE_LIBS_THREAD")
- SET(QT_QTCORE_LIB_DEPENDENCIES ${QT_QTCORE_LIB_DEPENDENCIES} ${QT_LIBS_THREAD})
+ set(CMAKE_THREAD_PREFER_PTHREADS 1)
+ find_package(Threads)
+ if(CMAKE_USE_PTHREADS_INIT)
+ SET(QT_QTCORE_LIB_DEPENDENCIES ${QT_QTCORE_LIB_DEPENDENCIES} ${CMAKE_THREAD_LIBS_INIT})
+ endif(CMAKE_USE_PTHREADS_INIT)
SET (QT_QTCORE_LIB_DEPENDENCIES ${QT_QTCORE_LIB_DEPENDENCIES} ${CMAKE_DL_LIBS})
diff --git a/Source/CMakeLists.txt b/Source/CMakeLists.txt
index dc73cec..dbbb558 100644
--- a/Source/CMakeLists.txt
+++ b/Source/CMakeLists.txt
@@ -111,6 +111,7 @@ ENDIF(CMAKE_USE_ELF_PARSER)
# Sources for CMakeLib
#
SET(SRCS
+ cmStandardIncludes.cxx
cmBootstrapCommands.cxx
cmCacheManager.cxx
cmCacheManager.h
diff --git a/Source/CTest/cmCTestCoverageHandler.cxx b/Source/CTest/cmCTestCoverageHandler.cxx
index 3235bfd..55a5225 100644
--- a/Source/CTest/cmCTestCoverageHandler.cxx
+++ b/Source/CTest/cmCTestCoverageHandler.cxx
@@ -2038,8 +2038,12 @@ std::set<std::string> cmCTestCoverageHandler::FindUncoveredFiles(
for(std::vector<std::string>::iterator f = files.begin();
f != files.end(); ++f)
{
- extraMatches.insert(this->CTest->GetShortPathToFile(
- f->c_str()));
+ if(this->ShouldIDoCoverage(f->c_str(),
+ cont->SourceDir.c_str(), cont->BinaryDir.c_str()))
+ {
+ extraMatches.insert(this->CTest->GetShortPathToFile(
+ f->c_str()));
+ }
}
}
diff --git a/Source/CTest/cmCTestGIT.cxx b/Source/CTest/cmCTestGIT.cxx
index f5ba361..6c3631c 100644
--- a/Source/CTest/cmCTestGIT.cxx
+++ b/Source/CTest/cmCTestGIT.cxx
@@ -85,16 +85,14 @@ void cmCTestGIT::NoteNewRevision()
}
//----------------------------------------------------------------------------
-bool cmCTestGIT::UpdateImpl()
+bool cmCTestGIT::UpdateByFetchAndReset()
{
const char* git = this->CommandLineTool.c_str();
- // Use "git pull" to update the working tree.
- std::vector<char const*> git_pull;
- git_pull.push_back(git);
- git_pull.push_back("pull");
-
- // TODO: if(this->CTest->GetTestModel() == cmCTest::NIGHTLY)
+ // Use "git fetch" to get remote commits.
+ std::vector<char const*> git_fetch;
+ git_fetch.push_back(git);
+ git_fetch.push_back("fetch");
// Add user-specified update options.
std::string opts = this->CTest->GetCTestConfiguration("UpdateOptions");
@@ -106,22 +104,88 @@ bool cmCTestGIT::UpdateImpl()
for(std::vector<cmStdString>::const_iterator ai = args.begin();
ai != args.end(); ++ai)
{
- git_pull.push_back(ai->c_str());
+ git_fetch.push_back(ai->c_str());
}
// Sentinel argument.
- git_pull.push_back(0);
+ git_fetch.push_back(0);
+
+ // Fetch upstream refs.
+ OutputLogger fetch_out(this->Log, "fetch-out> ");
+ OutputLogger fetch_err(this->Log, "fetch-err> ");
+ if(!this->RunUpdateCommand(&git_fetch[0], &fetch_out, &fetch_err))
+ {
+ return false;
+ }
+
+ // Identify the merge head that would be used by "git pull".
+ std::string sha1;
+ {
+ std::string fetch_head = this->SourceDirectory + "/.git/FETCH_HEAD";
+ std::ifstream fin(fetch_head.c_str(), std::ios::in | std::ios::binary);
+ std::string line;
+ while(sha1.empty() && cmSystemTools::GetLineFromStream(fin, line))
+ {
+ if(line.find("\tnot-for-merge\t") == line.npos)
+ {
+ std::string::size_type pos = line.find('\t');
+ if(pos != line.npos)
+ {
+ sha1 = line.substr(0, pos);
+ }
+ }
+ }
+ }
- OutputLogger out(this->Log, "pull-out> ");
- OutputLogger err(this->Log, "pull-err> ");
- if(this->RunUpdateCommand(&git_pull[0], &out, &err))
+ // Reset the local branch to point at that tracked from upstream.
+ char const* git_reset[] = {git, "reset", "--hard", sha1.c_str(), 0};
+ OutputLogger reset_out(this->Log, "reset-out> ");
+ OutputLogger reset_err(this->Log, "reset-err> ");
+ return this->RunChild(&git_reset[0], &reset_out, &reset_err);
+}
+
+//----------------------------------------------------------------------------
+bool cmCTestGIT::UpdateByCustom(std::string const& custom)
+{
+ std::vector<std::string> git_custom_command;
+ cmSystemTools::ExpandListArgument(custom, git_custom_command, true);
+ std::vector<char const*> git_custom;
+ for(std::vector<std::string>::const_iterator
+ i = git_custom_command.begin(); i != git_custom_command.end(); ++i)
{
- char const* git_submodule[] = {git, "submodule", "update", 0};
- OutputLogger out2(this->Log, "submodule-out> ");
- OutputLogger err2(this->Log, "submodule-err> ");
- return this->RunChild(git_submodule, &out2, &err2);
+ git_custom.push_back(i->c_str());
}
- return false;
+ git_custom.push_back(0);
+
+ OutputLogger custom_out(this->Log, "custom-out> ");
+ OutputLogger custom_err(this->Log, "custom-err> ");
+ return this->RunUpdateCommand(&git_custom[0], &custom_out, &custom_err);
+}
+
+//----------------------------------------------------------------------------
+bool cmCTestGIT::UpdateInternal()
+{
+ std::string custom = this->CTest->GetCTestConfiguration("GITUpdateCustom");
+ if(!custom.empty())
+ {
+ return this->UpdateByCustom(custom);
+ }
+ return this->UpdateByFetchAndReset();
+}
+
+//----------------------------------------------------------------------------
+bool cmCTestGIT::UpdateImpl()
+{
+ if(!this->UpdateInternal())
+ {
+ return false;
+ }
+
+ const char* git = this->CommandLineTool.c_str();
+ char const* git_submodule[] = {git, "submodule", "update", 0};
+ OutputLogger submodule_out(this->Log, "submodule-out> ");
+ OutputLogger submodule_err(this->Log, "submodule-err> ");
+ return this->RunChild(git_submodule, &submodule_out, &submodule_err);
}
//----------------------------------------------------------------------------
diff --git a/Source/CTest/cmCTestGIT.h b/Source/CTest/cmCTestGIT.h
index 0b6ad2e..d8681fe 100644
--- a/Source/CTest/cmCTestGIT.h
+++ b/Source/CTest/cmCTestGIT.h
@@ -32,6 +32,10 @@ private:
virtual void NoteNewRevision();
virtual bool UpdateImpl();
+ bool UpdateByFetchAndReset();
+ bool UpdateByCustom(std::string const& custom);
+ bool UpdateInternal();
+
void LoadRevisions();
void LoadModifications();
diff --git a/Source/CTest/cmCTestMultiProcessHandler.cxx b/Source/CTest/cmCTestMultiProcessHandler.cxx
index 8a69780..9b8cef5 100644
--- a/Source/CTest/cmCTestMultiProcessHandler.cxx
+++ b/Source/CTest/cmCTestMultiProcessHandler.cxx
@@ -23,6 +23,7 @@ cmCTestMultiProcessHandler::cmCTestMultiProcessHandler()
this->ParallelLevel = 1;
this->Completed = 0;
this->RunningCount = 0;
+ this->StopTimePassed = false;
}
cmCTestMultiProcessHandler::~cmCTestMultiProcessHandler()
@@ -69,6 +70,10 @@ void cmCTestMultiProcessHandler::RunTests()
this->StartNextTests();
while(this->Tests.size() != 0)
{
+ if(this->StopTimePassed)
+ {
+ return;
+ }
this->CheckOutput();
this->StartNextTests();
}
@@ -102,6 +107,12 @@ void cmCTestMultiProcessHandler::StartTestProcess(int test)
{
this->RunningTests.insert(testRun);
}
+ else if(testRun->IsStopTimePassed())
+ {
+ this->StopTimePassed = true;
+ delete testRun;
+ return;
+ }
else
{
this->UnlockResources(test);
@@ -251,6 +262,10 @@ void cmCTestMultiProcessHandler::StartNextTests()
}
if(this->StartTest(*test))
{
+ if(this->StopTimePassed)
+ {
+ return;
+ }
numToStart -= processors;
this->RunningCount += processors;
}
diff --git a/Source/CTest/cmCTestMultiProcessHandler.h b/Source/CTest/cmCTestMultiProcessHandler.h
index d4f6c71..4f51b0b 100644
--- a/Source/CTest/cmCTestMultiProcessHandler.h
+++ b/Source/CTest/cmCTestMultiProcessHandler.h
@@ -94,6 +94,7 @@ protected:
//Number of tests that are complete
size_t Completed;
size_t RunningCount;
+ bool StopTimePassed;
//list of test properties (indices concurrent to the test map)
PropertiesMap Properties;
std::map<int, bool> TestRunningMap;
diff --git a/Source/CTest/cmCTestRunTest.cxx b/Source/CTest/cmCTestRunTest.cxx
index 4c9675b..9fb8827 100644
--- a/Source/CTest/cmCTestRunTest.cxx
+++ b/Source/CTest/cmCTestRunTest.cxx
@@ -32,6 +32,7 @@ cmCTestRunTest::cmCTestRunTest(cmCTestTestHandler* handler)
this->ProcessOutput = "";
this->CompressedOutput = "";
this->CompressionRatio = 2;
+ this->StopTimePassed = false;
}
cmCTestRunTest::~cmCTestRunTest()
@@ -436,8 +437,13 @@ bool cmCTestRunTest::StartTest(size_t total)
}
this->StartTime = this->CTest->CurrentTime();
- return this->ForkProcess(this->ResolveTimeout(),
- &this->TestProperties->Environment);
+ double timeout = this->ResolveTimeout();
+
+ if(this->StopTimePassed)
+ {
+ return false;
+ }
+ return this->ForkProcess(timeout, &this->TestProperties->Environment);
}
//----------------------------------------------------------------------
@@ -569,8 +575,9 @@ double cmCTestRunTest::ResolveTimeout()
if(stop_timeout <= 0 || stop_timeout > this->CTest->LastStopTimeout)
{
cmCTestLog(this->CTest, ERROR_MESSAGE, "The stop time has been passed. "
- "Exiting ctest." << std::endl);
- exit(-1);
+ "Stopping all tests." << std::endl);
+ this->StopTimePassed = true;
+ return 0;
}
return timeout == 0 ? stop_timeout :
(timeout < stop_timeout ? timeout : stop_timeout);
diff --git a/Source/CTest/cmCTestRunTest.h b/Source/CTest/cmCTestRunTest.h
index d7d3a2f..e0cb888 100644
--- a/Source/CTest/cmCTestRunTest.h
+++ b/Source/CTest/cmCTestRunTest.h
@@ -39,6 +39,8 @@ public:
std::string GetProcessOutput() { return this->ProcessOutput; }
+ bool IsStopTimePassed() { return this->StopTimePassed; }
+
cmCTestTestHandler::cmCTestTestResult GetTestResults()
{ return this->TestResult; }
@@ -90,6 +92,7 @@ private:
std::string TestCommand;
std::string ActualCommand;
std::vector<std::string> Arguments;
+ bool StopTimePassed;
};
inline int getNumWidth(size_t n)
diff --git a/Source/CTest/cmCTestTestHandler.cxx b/Source/CTest/cmCTestTestHandler.cxx
index b9cee6c..d2742ec 100644
--- a/Source/CTest/cmCTestTestHandler.cxx
+++ b/Source/CTest/cmCTestTestHandler.cxx
@@ -1036,9 +1036,9 @@ void cmCTestTestHandler::ProcessDirectory(std::vector<cmStdString> &passed,
bool randomSchedule = this->CTest->GetScheduleType() == "Random";
if(randomSchedule)
- {
+ {
srand((unsigned)time(0));
- }
+ }
for (ListOfTests::iterator it = this->TestList.begin();
it != this->TestList.end(); ++it)
diff --git a/Source/CTest/cmCTestUpdateCommand.cxx b/Source/CTest/cmCTestUpdateCommand.cxx
index 571745d..8414349 100644
--- a/Source/CTest/cmCTestUpdateCommand.cxx
+++ b/Source/CTest/cmCTestUpdateCommand.cxx
@@ -52,6 +52,8 @@ cmCTestGenericHandler* cmCTestUpdateCommand::InitializeHandler()
this->CTest->SetCTestConfigurationFromCMakeVariable(this->Makefile,
"GITUpdateOptions", "CTEST_GIT_UPDATE_OPTIONS");
this->CTest->SetCTestConfigurationFromCMakeVariable(this->Makefile,
+ "GITUpdateCustom", "CTEST_GIT_UPDATE_CUSTOM");
+ this->CTest->SetCTestConfigurationFromCMakeVariable(this->Makefile,
"HGCommand", "CTEST_HG_COMMAND");
this->CTest->SetCTestConfigurationFromCMakeVariable(this->Makefile,
"HGUpdateOptions", "CTEST_HG_UPDATE_OPTIONS");
diff --git a/Source/cmDocumentVariables.cxx b/Source/cmDocumentVariables.cxx
index e77119f..2ed959f 100644
--- a/Source/cmDocumentVariables.cxx
+++ b/Source/cmDocumentVariables.cxx
@@ -1324,6 +1324,8 @@ void cmDocumentVariables::DefineVariables(cmake* cm)
cmProperty::VARIABLE,0,0);
cm->DefineProperty("CMAKE_<LANG>_LINK_FLAGS",
cmProperty::VARIABLE,0,0);
+ cm->DefineProperty("CMAKE_<LANG>_RESPONSE_FILE_LINK_FLAG",
+ cmProperty::VARIABLE,0,0);
cm->DefineProperty("CMAKE_<LANG>_STANDARD_LIBRARIES",
cmProperty::VARIABLE,0,0);
cm->DefineProperty("CMAKE_<LANG>_STANDARD_LIBRARIES_INIT",
@@ -1398,4 +1400,6 @@ void cmDocumentVariables::DefineVariables(cmake* cm)
cmProperty::VARIABLE,0,0);
cm->DefineProperty("CMAKE_LINK_DEPENDENT_LIBRARY_DIRS",
cmProperty::VARIABLE,0,0);
+ cm->DefineProperty("CMAKE_MAKE_INCLUDE_FROM_ROOT",
+ cmProperty::VARIABLE,0,0);
}
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx
index fd3508e..13d875f 100644
--- a/Source/cmLocalGenerator.cxx
+++ b/Source/cmLocalGenerator.cxx
@@ -2249,6 +2249,10 @@ std::string cmLocalGenerator::ConvertToOutputFormat(const char* source,
}
result = this->EscapeForShell(result.c_str(), true, false);
}
+ else if(output == RESPONSE)
+ {
+ result = this->EscapeForShell(result.c_str(), false, false);
+ }
return result;
}
diff --git a/Source/cmLocalGenerator.h b/Source/cmLocalGenerator.h
index 4c2fc22..43bf1e7 100644
--- a/Source/cmLocalGenerator.h
+++ b/Source/cmLocalGenerator.h
@@ -102,7 +102,7 @@ public:
* path setting
*/
enum RelativeRoot { NONE, FULL, HOME, START, HOME_OUTPUT, START_OUTPUT };
- enum OutputFormat { UNCHANGED, MAKEFILE, SHELL };
+ enum OutputFormat { UNCHANGED, MAKEFILE, SHELL, RESPONSE };
std::string ConvertToOutputFormat(const char* source, OutputFormat output);
std::string Convert(const char* remote, RelativeRoot local,
OutputFormat output = UNCHANGED,
diff --git a/Source/cmMakefileTargetGenerator.cxx b/Source/cmMakefileTargetGenerator.cxx
index ac727ac..d5d6585 100644
--- a/Source/cmMakefileTargetGenerator.cxx
+++ b/Source/cmMakefileTargetGenerator.cxx
@@ -189,12 +189,15 @@ void cmMakefileTargetGenerator::WriteTargetBuildRules()
//----------------------------------------------------------------------------
void cmMakefileTargetGenerator::WriteCommonCodeRules()
{
+ const char* root = (this->Makefile->IsOn("CMAKE_MAKE_INCLUDE_FROM_ROOT")?
+ "$(CMAKE_BINARY_DIR)/" : "");
+
// Include the dependencies for the target.
std::string dependFileNameFull = this->TargetBuildDirectoryFull;
dependFileNameFull += "/depend.make";
*this->BuildFileStream
<< "# Include any dependencies generated for this target.\n"
- << this->LocalGenerator->IncludeDirective << " "
+ << this->LocalGenerator->IncludeDirective << " " << root
<< this->Convert(dependFileNameFull.c_str(),
cmLocalGenerator::HOME_OUTPUT,
cmLocalGenerator::MAKEFILE)
@@ -205,7 +208,7 @@ void cmMakefileTargetGenerator::WriteCommonCodeRules()
// Include the progress variables for the target.
*this->BuildFileStream
<< "# Include the progress variables for this target.\n"
- << this->LocalGenerator->IncludeDirective << " "
+ << this->LocalGenerator->IncludeDirective << " " << root
<< this->Convert(this->ProgressFileNameFull.c_str(),
cmLocalGenerator::HOME_OUTPUT,
cmLocalGenerator::MAKEFILE)
@@ -238,7 +241,7 @@ void cmMakefileTargetGenerator::WriteCommonCodeRules()
// Include the flags for the target.
*this->BuildFileStream
<< "# Include the compile flags for this target's objects.\n"
- << this->LocalGenerator->IncludeDirective << " "
+ << this->LocalGenerator->IncludeDirective << " " << root
<< this->Convert(this->FlagFileNameFull.c_str(),
cmLocalGenerator::HOME_OUTPUT,
cmLocalGenerator::MAKEFILE)
@@ -1327,7 +1330,7 @@ public:
this->NextObject =
this->LocalGenerator->Convert(obj.c_str(),
cmLocalGenerator::START_OUTPUT,
- cmLocalGenerator::SHELL);
+ cmLocalGenerator::RESPONSE);
// Roll over to next string if the limit will be exceeded.
if(this->LengthLimit != std::string::npos &&
@@ -1621,6 +1624,17 @@ cmMakefileTargetGenerator
std::vector<std::string> object_strings;
this->WriteObjectsStrings(object_strings, responseFileLimit);
+ // Lookup the response file reference flag.
+ std::string responseFlagVar = "CMAKE_";
+ responseFlagVar += this->Target->GetLinkerLanguage(this->ConfigName);
+ responseFlagVar += "_RESPONSE_FILE_LINK_FLAG";
+ const char* responseFlag =
+ this->Makefile->GetDefinition(responseFlagVar.c_str());
+ if(!responseFlag)
+ {
+ responseFlag = "@";
+ }
+
// Write a response file for each string.
const char* sep = "";
for(unsigned int i = 0; i < object_strings.size(); ++i)
@@ -1638,7 +1652,7 @@ cmMakefileTargetGenerator
sep = " ";
// Reference the response file.
- buildObjs += "@";
+ buildObjs += responseFlag;
buildObjs += this->Convert(objects_rsp.c_str(),
cmLocalGenerator::NONE,
cmLocalGenerator::SHELL);
diff --git a/Source/cmSetPropertyCommand.h b/Source/cmSetPropertyCommand.h
index 853e7ba..c477bb7 100644
--- a/Source/cmSetPropertyCommand.h
+++ b/Source/cmSetPropertyCommand.h
@@ -66,7 +66,9 @@ public:
"directory (already processed by CMake) may be named by full or "
"relative path.\n"
"TARGET scope may name zero or more existing targets.\n"
- "SOURCE scope may name zero or more source files.\n"
+ "SOURCE scope may name zero or more source files. "
+ "Note that source file properties are visible only to targets "
+ "added in the same directory (CMakeLists.txt).\n"
"TEST scope may name zero or more existing tests.\n"
"CACHE scope must name zero or more cache existing entries.\n"
"The required PROPERTY option is immediately followed by the name "
diff --git a/Source/cmSetSourceFilesPropertiesCommand.h b/Source/cmSetSourceFilesPropertiesCommand.h
index 7182152..392f168 100644
--- a/Source/cmSetSourceFilesPropertiesCommand.h
+++ b/Source/cmSetSourceFilesPropertiesCommand.h
@@ -48,35 +48,15 @@ public:
virtual const char* GetFullDocumentation()
{
return
- " set_source_files_properties(file1 file2 ...\n"
+ " set_source_files_properties([file1 [file2 [...]]]\n"
" PROPERTIES prop1 value1\n"
- " prop2 value2 ...)\n"
- "Set properties on a file. The syntax for the command is to list all "
- "the files you want "
- "to change, and then provide the values you want to set next. You "
- "can make up your own properties as well. "
- "The following are used by CMake. "
- "The ABSTRACT flag (boolean) is used by some class wrapping "
- "commands. "
- "If WRAP_EXCLUDE (boolean) is true then many wrapping commands "
- "will ignore this file. If GENERATED (boolean) is true then it "
- "is not an error if this source file does not exist when it is "
- "added to a target. Obviously, "
- "it must be created (presumably by a custom command) before the "
- "target is built. "
- "If the HEADER_FILE_ONLY (boolean) property is true then the "
- "file is not compiled. This is useful if you want to add extra "
- "non build files to an IDE. "
- "OBJECT_DEPENDS (string) adds dependencies to the object file. "
- "COMPILE_FLAGS (string) is passed to the compiler as additional "
- "command line arguments when the source file is compiled. "
- "LANGUAGE (string) CXX|C will change the default compiler used "
- "to compile the source file. The languages used need to be enabled "
- "in the PROJECT command. "
- "If SYMBOLIC (boolean) is set to true the build system will be "
- "informed that the source file is not actually created on disk but "
- "instead used as a symbolic name for a build rule.";
-
+ " [prop2 value2 [...]])\n"
+ "Set properties associated with source files using a key/value "
+ "paired list. "
+ "See properties documentation for those known to CMake. "
+ "Unrecognized properties are ignored. "
+ "Source file properties are visible only to targets "
+ "added in the same directory (CMakeLists.txt).";
}
cmTypeMacro(cmSetSourceFilesPropertiesCommand, cmCommand);
diff --git a/Source/cmStandardIncludes.cxx b/Source/cmStandardIncludes.cxx
new file mode 100644
index 0000000..a4bdb2e
--- /dev/null
+++ b/Source/cmStandardIncludes.cxx
@@ -0,0 +1,16 @@
+/*============================================================================
+ CMake - Cross Platform Makefile Generator
+ Copyright 2000-2010 Kitware, Inc., Insight Software Consortium
+
+ Distributed under the OSI-approved BSD License (the "License");
+ see accompanying file Copyright.txt for details.
+
+ This software is distributed WITHOUT ANY WARRANTY; without even the
+ implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ See the License for more information.
+============================================================================*/
+#include "cmStandardIncludes.h"
+#if !defined(CMAKE_NO_ANSI_STRING_STREAM)
+cmOStringStream::cmOStringStream() {}
+cmOStringStream::~cmOStringStream() {}
+#endif
diff --git a/Source/cmStandardIncludes.h b/Source/cmStandardIncludes.h
index 9b9cb3b..e8decbb 100644
--- a/Source/cmStandardIncludes.h
+++ b/Source/cmStandardIncludes.h
@@ -241,7 +241,8 @@ typedef cmsys::String cmStdString;
class cmOStringStream: public std::ostringstream
{
public:
- cmOStringStream() {}
+ cmOStringStream();
+ ~cmOStringStream();
private:
cmOStringStream(const cmOStringStream&);
void operator=(const cmOStringStream&);
diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx
index 53d6594..59e20d5 100644
--- a/Source/cmVisualStudio10TargetGenerator.cxx
+++ b/Source/cmVisualStudio10TargetGenerator.cxx
@@ -435,6 +435,9 @@ void cmVisualStudio10TargetGenerator::WriteGroups()
none.push_back(sf);
}
}
+
+ this->AddMissingSourceGroups(groupsUsed, sourceGroups);
+
// Write out group file
std::string path = this->Makefile->GetStartOutputDirectory();
path += "/";
@@ -492,6 +495,52 @@ void cmVisualStudio10TargetGenerator::WriteGroups()
}
}
+// Add to groupsUsed empty source groups that have non-empty children.
+void
+cmVisualStudio10TargetGenerator::AddMissingSourceGroups(
+ std::set<cmSourceGroup*>& groupsUsed,
+ const std::vector<cmSourceGroup>& allGroups
+ )
+{
+ for(std::vector<cmSourceGroup>::const_iterator current = allGroups.begin();
+ current != allGroups.end(); ++current)
+ {
+ std::vector<cmSourceGroup> const& children = current->GetGroupChildren();
+ if(children.empty())
+ {
+ continue; // the group is really empty
+ }
+
+ this->AddMissingSourceGroups(groupsUsed, children);
+
+ cmSourceGroup* current_ptr = const_cast<cmSourceGroup*>(&(*current));
+ if(groupsUsed.find(current_ptr) != groupsUsed.end())
+ {
+ continue; // group has already been added to set
+ }
+
+ // check if it least one of the group's descendants is not empty
+ // (at least one child must already have been added)
+ std::vector<cmSourceGroup>::const_iterator child_it = children.begin();
+ while(child_it != children.end())
+ {
+ cmSourceGroup* child_ptr = const_cast<cmSourceGroup*>(&(*child_it));
+ if(groupsUsed.find(child_ptr) != groupsUsed.end())
+ {
+ break; // found a child that was already added => add current group too
+ }
+ child_it++;
+ }
+
+ if(child_it == children.end())
+ {
+ continue; // no descendants have source files => ignore this group
+ }
+
+ groupsUsed.insert(current_ptr);
+ }
+}
+
void
cmVisualStudio10TargetGenerator::
WriteGroupSources(const char* name,
diff --git a/Source/cmVisualStudio10TargetGenerator.h b/Source/cmVisualStudio10TargetGenerator.h
index 989db71..64b2361 100644
--- a/Source/cmVisualStudio10TargetGenerator.h
+++ b/Source/cmVisualStudio10TargetGenerator.h
@@ -77,6 +77,10 @@ private:
void WriteGroupSources(const char* name,
std::vector<cmSourceFile*> const& sources,
std::vector<cmSourceGroup>& );
+ void AddMissingSourceGroups(std::set<cmSourceGroup*>& groupsUsed,
+ const std::vector<cmSourceGroup>& allGroups);
+
+
private:
typedef cmVisualStudioGeneratorOptions Options;
typedef std::map<cmStdString, Options*> OptionsMap;
diff --git a/Source/kwsys/kwsysDateStamp.cmake b/Source/kwsys/kwsysDateStamp.cmake
index 2ce7080..200b4f8 100644
--- a/Source/kwsys/kwsysDateStamp.cmake
+++ b/Source/kwsys/kwsysDateStamp.cmake
@@ -18,4 +18,4 @@ SET(KWSYS_DATE_STAMP_YEAR 2010)
SET(KWSYS_DATE_STAMP_MONTH 06)
# KWSys version date day component. Format is DD.
-SET(KWSYS_DATE_STAMP_DAY 15)
+SET(KWSYS_DATE_STAMP_DAY 22)
diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt
index 1b8f4f3..2c7056d 100644
--- a/Tests/CMakeLists.txt
+++ b/Tests/CMakeLists.txt
@@ -1076,7 +1076,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
# Make sure CTest can handle a test with no newline in output.
ADD_TEST(CTest.NoNewline
- ${CMAKE_COMMAND} -E echo_append "This line has no newline!")
+ ${CMAKE_CMAKE_COMMAND} -E echo_append "This line has no newline!")
# A simple test for ctest in script mode
CONFIGURE_FILE("${CMake_SOURCE_DIR}/Tests/CTestScriptMode/CTestTestScriptMode.cmake.in"
@@ -1470,13 +1470,6 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
--output-log "${CMake_BINARY_DIR}/Tests/CTestTest2/testOutput.log"
)
- CONFIGURE_FILE("${CMake_SOURCE_DIR}/Tests/CTestTest3/test.cmake.in"
- "${CMake_BINARY_DIR}/Tests/CTestTest3/test.cmake" @ONLY ESCAPE_QUOTES)
- ADD_TEST(CTestTest3 ${CMAKE_CTEST_COMMAND}
- -S "${CMake_BINARY_DIR}/Tests/CTestTest3/test.cmake" -V
- --output-log "${CMake_BINARY_DIR}/Tests/CTestTest3/testOutput.log"
- )
-
# these tests take a long time, make sure they have it
# if timeouts have not already been set
GET_TEST_PROPERTY(CTestTest TIMEOUT PREVIOUS_TIMEOUT)
@@ -1490,12 +1483,6 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
SET_TESTS_PROPERTIES ( CTestTest2
PROPERTIES TIMEOUT ${CMAKE_LONG_TEST_TIMEOUT})
ENDIF ("${PREVIOUS_TIMEOUT}" MATCHES NOTFOUND)
-
- GET_TEST_PROPERTY(CTestTest3 TIMEOUT PREVIOUS_TIMEOUT)
- IF ("${PREVIOUS_TIMEOUT}" MATCHES NOTFOUND)
- SET_TESTS_PROPERTIES ( CTestTest3
- PROPERTIES TIMEOUT ${CMAKE_LONG_TEST_TIMEOUT})
- ENDIF ("${PREVIOUS_TIMEOUT}" MATCHES NOTFOUND)
ENDIF (CTEST_TEST_CTEST AND CMAKE_RUN_LONG_TESTS AND CMAKE_TESTS_CDASH_SERVER)
IF(NOT DEFINED CTEST_RUN_CTestSubmitLargeOutput)
@@ -1572,16 +1559,24 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
# If there is CMakeLists.txt in the binary tree, assume in-source build
SET(CMAKE_SKIP_BOOTSTRAP_TEST 1)
ENDIF(EXISTS "${CMAKE_BINARY_DIR}/CMakeLists.txt")
- IF(UNIX AND CMAKE_RUN_LONG_TESTS AND NOT CMAKE_SKIP_BOOTSTRAP_TEST)
-
-
+ SET(bootstrap "")
+ IF(CMAKE_RUN_LONG_TESTS AND NOT CMAKE_SKIP_BOOTSTRAP_TEST)
+ IF(UNIX)
+ SET(bootstrap ${CMake_SOURCE_DIR}/bootstrap)
+ ELSEIF(MSYS)
+ CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/bootstrap.bat.in
+ ${CMAKE_CURRENT_BINARY_DIR}/bootstrap.bat @ONLY)
+ SET(bootstrap ${CMAKE_CURRENT_BINARY_DIR}/bootstrap.bat)
+ ENDIF()
+ ENDIF()
+ IF(bootstrap)
ADD_TEST(BootstrapTest ${CMAKE_CTEST_COMMAND}
--build-and-test
${CMake_SOURCE_DIR}
${CMake_BINARY_DIR}/Tests/BootstrapTest
--build-nocmake
--build-noclean
- --build-makeprogram ${CMake_SOURCE_DIR}/bootstrap
+ --build-makeprogram ${bootstrap}
--build-generator "${CMAKE_TEST_GENERATOR}"
--test-command
${CMake_BINARY_DIR}/Tests/BootstrapTest/Bootstrap.cmk/cmake)
@@ -1595,7 +1590,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
SET_TESTS_PROPERTIES ( BootstrapTest
PROPERTIES TIMEOUT 5400)
ENDIF ("${PREVIOUS_TIMEOUT}" MATCHES NOTFOUND)
- ENDIF(UNIX AND CMAKE_RUN_LONG_TESTS AND NOT CMAKE_SKIP_BOOTSTRAP_TEST)
+ ENDIF()
# fortran does not work for IDE builds because
# CMAKE_STANDARD_LIBRARIES needs to be per language
diff --git a/Tests/CTestUpdateBZR.cmake.in b/Tests/CTestUpdateBZR.cmake.in
index 7f90b50..c654f47 100644
--- a/Tests/CTestUpdateBZR.cmake.in
+++ b/Tests/CTestUpdateBZR.cmake.in
@@ -142,7 +142,7 @@ run_dashboard_command_line(user-binary)
# Test initial checkout and update with a dashboard script.
message("Running CTest Dashboard Script...")
-create_dashboard_script(dashboard.cmake
+create_dashboard_script(dash-binary
"# bzr command configuration
set(CTEST_BZR_COMMAND \"${BZR}\")
set(CTEST_CHECKOUT_COMMAND
@@ -150,4 +150,4 @@ set(CTEST_CHECKOUT_COMMAND
")
# Run the dashboard script with CTest.
-run_dashboard_script(dashboard.cmake)
+run_dashboard_script(dash-binary)
diff --git a/Tests/CTestUpdateCVS.cmake.in b/Tests/CTestUpdateCVS.cmake.in
index 6f31a2c..a04673e 100644
--- a/Tests/CTestUpdateCVS.cmake.in
+++ b/Tests/CTestUpdateCVS.cmake.in
@@ -147,7 +147,7 @@ run_dashboard_command_line(user-binary)
# Test initial checkout and update with a dashboard script.
message("Running CTest Dashboard Script...")
-create_dashboard_script(dashboard.cmake
+create_dashboard_script(dash-binary
"# CVS command configuration
set(CTEST_CVS_COMMAND \"${CVS}\")
set(CTEST_CVS_UPDATE_OPTIONS -dAP)
@@ -156,4 +156,4 @@ set(CTEST_CHECKOUT_COMMAND
")
# Run the dashboard script with CTest.
-run_dashboard_script(dashboard.cmake)
+run_dashboard_script(dash-binary)
diff --git a/Tests/CTestUpdateCommon.cmake b/Tests/CTestUpdateCommon.cmake
index 266f4b3..a52cb14 100644
--- a/Tests/CTestUpdateCommon.cmake
+++ b/Tests/CTestUpdateCommon.cmake
@@ -165,15 +165,15 @@ endfunction(create_build_tree)
#-----------------------------------------------------------------------------
# Function to write the dashboard test script.
-function(create_dashboard_script name custom_text)
+function(create_dashboard_script bin_dir custom_text)
# Write the dashboard script.
- file(WRITE ${TOP}/dashboard.cmake
+ file(WRITE ${TOP}/${bin_dir}.cmake
"# CTest Dashboard Script
set(CTEST_DASHBOARD_ROOT \"${TOP}\")
set(CTEST_SITE test.site)
set(CTEST_BUILD_NAME dash-test)
set(CTEST_SOURCE_DIRECTORY \${CTEST_DASHBOARD_ROOT}/dash-source)
-set(CTEST_BINARY_DIRECTORY \${CTEST_DASHBOARD_ROOT}/dash-binary)
+set(CTEST_BINARY_DIRECTORY \${CTEST_DASHBOARD_ROOT}/${bin_dir})
${custom_text}
# Start a dashboard and run the update step
ctest_start(Experimental)
@@ -191,27 +191,31 @@ function(run_dashboard_command_line bin_dir)
# Verify the updates reported by CTest.
list(APPEND UPDATE_MAYBE Updated{subdir})
+ set(_modified Modified{CTestConfig.cmake})
+ if(UPDATE_NO_MODIFIED)
+ set(_modified "")
+ endif()
check_updates(${bin_dir}
Updated{foo.txt}
Updated{bar.txt}
Updated{zot.txt}
Updated{subdir/foo.txt}
Updated{subdir/bar.txt}
- Modified{CTestConfig.cmake}
+ ${_modified}
)
endfunction(run_dashboard_command_line)
#-----------------------------------------------------------------------------
# Function to run the dashboard through a script
-function(run_dashboard_script name)
+function(run_dashboard_script bin_dir)
run_child(
WORKING_DIRECTORY ${TOP}
- COMMAND ${CMAKE_CTEST_COMMAND} -S ${name} -V
+ COMMAND ${CMAKE_CTEST_COMMAND} -S ${bin_dir}.cmake -V
)
# Verify the updates reported by CTest.
list(APPEND UPDATE_MAYBE Updated{subdir})
- check_updates(dash-binary
+ check_updates(${bin_dir}
Updated{foo.txt}
Updated{bar.txt}
Updated{zot.txt}
diff --git a/Tests/CTestUpdateGIT.cmake.in b/Tests/CTestUpdateGIT.cmake.in
index f0a5770..4ac1b31 100644
--- a/Tests/CTestUpdateGIT.cmake.in
+++ b/Tests/CTestUpdateGIT.cmake.in
@@ -192,15 +192,18 @@ run_child(
#-----------------------------------------------------------------------------
# Go back to before the changes so we can test updating.
-message("Backing up to revision 1...")
-run_child(
- WORKING_DIRECTORY ${TOP}/user-source
- COMMAND ${GIT} reset --hard master~2
- )
-run_child(
- WORKING_DIRECTORY ${TOP}/user-source
- COMMAND ${GIT} submodule update
- )
+macro(rewind_source src_dir)
+ message("Backing up to revision 1...")
+ run_child(
+ WORKING_DIRECTORY ${TOP}/${src_dir}
+ COMMAND ${GIT} reset --hard origin/master~2
+ )
+ run_child(
+ WORKING_DIRECTORY ${TOP}/${src_dir}
+ COMMAND ${GIT} submodule update
+ )
+endmacro(rewind_source)
+rewind_source(user-source)
# Make sure pull does not try to rebase (which does not work with
# modified files) even if ~/.gitconfig sets "branch.master.rebase".
@@ -224,13 +227,31 @@ UpdateCommand: ${GIT}
")
# Run the dashboard command line interface.
+set(UPDATE_NO_MODIFIED 1)
run_dashboard_command_line(user-binary)
+set(UPDATE_NO_MODIFIED 0)
+
+rewind_source(user-source)
+modify_content(user-source)
+
+message("Running CTest Dashboard Command Line (custom update)...")
+
+# Create the user build tree.
+create_build_tree(user-source user-binary-custom)
+file(APPEND ${TOP}/user-binary-custom/CTestConfiguration.ini
+ "# GIT command configuration
+UpdateCommand: ${GIT}
+GITUpdateCustom: ${GIT};pull;origin;master
+")
+
+# Run the dashboard command line interface.
+run_dashboard_command_line(user-binary-custom)
#-----------------------------------------------------------------------------
# Test initial checkout and update with a dashboard script.
message("Running CTest Dashboard Script...")
-create_dashboard_script(dashboard.cmake
+create_dashboard_script(dash-binary
"# git command configuration
set(CTEST_GIT_COMMAND \"${GIT}\")
set(CTEST_GIT_UPDATE_OPTIONS)
@@ -253,4 +274,20 @@ execute_process(
")
# Run the dashboard script with CTest.
-run_dashboard_script(dashboard.cmake)
+run_dashboard_script(dash-binary)
+
+rewind_source(dash-source)
+
+#-----------------------------------------------------------------------------
+# Test custom update with a dashboard script.
+message("Running CTest Dashboard Script (custom update)...")
+
+create_dashboard_script(dash-binary-custom
+ "# git command configuration
+set(CTEST_GIT_COMMAND \"${GIT}\")
+set(CTEST_GIT_UPDATE_OPTIONS)
+set(CTEST_GIT_UPDATE_CUSTOM \${CTEST_GIT_COMMAND} pull origin master)
+")
+
+# Run the dashboard script with CTest.
+run_dashboard_script(dash-binary-custom)
diff --git a/Tests/CTestUpdateGIT.sh.in b/Tests/CTestUpdateGIT.sh.in
index 4761d32..e7586d6 100755
--- a/Tests/CTestUpdateGIT.sh.in
+++ b/Tests/CTestUpdateGIT.sh.in
@@ -1,5 +1,5 @@
#!/bin/sh
-if test "x$1" = "xpull"; then
+if test "x$1" = "xpull" -o "x$1" = "xreset"; then
"@GIT@" "$@" && sleep 1 && touch foo.txt
else
exec "@GIT@" "$@"
diff --git a/Tests/CTestUpdateHG.cmake.in b/Tests/CTestUpdateHG.cmake.in
index f2e5f83..543ddd9 100644
--- a/Tests/CTestUpdateHG.cmake.in
+++ b/Tests/CTestUpdateHG.cmake.in
@@ -145,7 +145,7 @@ run_dashboard_command_line(user-binary)
# Test initial checkout and update with a dashboard script.
message("Running CTest Dashboard Script...")
-create_dashboard_script(dashboard.cmake
+create_dashboard_script(dash-binary
"# hg command configuration
set(CTEST_HG_COMMAND \"${HG}\")
set(CTEST_HG_UPDATE_OPTIONS)
@@ -160,4 +160,4 @@ execute_process(
")
# Run the dashboard script with CTest.
-run_dashboard_script(dashboard.cmake)
+run_dashboard_script(dash-binary)
diff --git a/Tests/CTestUpdateSVN.cmake.in b/Tests/CTestUpdateSVN.cmake.in
index 509597b..97b2a07 100644
--- a/Tests/CTestUpdateSVN.cmake.in
+++ b/Tests/CTestUpdateSVN.cmake.in
@@ -127,7 +127,7 @@ run_dashboard_command_line(user-binary)
# Test initial checkout and update with a dashboard script.
message("Running CTest Dashboard Script...")
-create_dashboard_script(dashboard.cmake
+create_dashboard_script(dash-binary
"# Subversion command configuration
set(CTEST_SVN_COMMAND \"${SVN}\")
set(CTEST_SVN_UPDATE_OPTIONS
@@ -137,4 +137,4 @@ set(CTEST_CHECKOUT_COMMAND
")
# Run the dashboard script with CTest.
-run_dashboard_script(dashboard.cmake)
+run_dashboard_script(dash-binary)
diff --git a/Tests/bootstrap.bat.in b/Tests/bootstrap.bat.in
new file mode 100644
index 0000000..aeb24b1
--- /dev/null
+++ b/Tests/bootstrap.bat.in
@@ -0,0 +1,2 @@
+@echo off
+sh "@CMake_SOURCE_DIR@/bootstrap" %*
diff --git a/bootstrap b/bootstrap
index c018b3c..1687776 100755
--- a/bootstrap
+++ b/bootstrap
@@ -166,6 +166,7 @@ CMAKE_UNUSED_SOURCES="\
"
CMAKE_CXX_SOURCES="\
+ cmStandardIncludes \
cmake \
cmakemain \
cmakewizard \