summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--CTestCustom.cmake.in2
-rw-r--r--Source/CMakeLists.txt2
-rw-r--r--Source/CMakeVersion.cmake2
-rw-r--r--Source/CTest/cmCTestUpdateHandler.cxx43
-rw-r--r--Source/cmCLocaleEnvironmentScope.cxx67
-rw-r--r--Source/cmCLocaleEnvironmentScope.h32
-rw-r--r--Source/cmDocumentation.cxx15
-rw-r--r--Source/cmDocumentation.h1
-rw-r--r--Source/cmDocumentationFormatter.h4
-rw-r--r--Source/cmMakefileTargetGenerator.cxx58
-rw-r--r--Source/cmMakefileTargetGenerator.h3
-rw-r--r--Source/cmake.cxx16
-rw-r--r--Source/cmake.h3
-rw-r--r--Source/kwsys/SystemTools.cxx17
-rw-r--r--Tests/BuildDepends/CMakeLists.txt65
-rw-r--r--Tests/BuildDepends/Project/CMakeLists.txt18
-rw-r--r--Tests/CMakeLists.txt15
-rw-r--r--Tests/CMakeTestBadCommandLines/RunCMake.cmake79
-rw-r--r--Tests/RunCMake/CMakeLists.txt8
-rw-r--r--Tests/RunCMake/CommandLine/C-no-arg-result.txt1
-rw-r--r--Tests/RunCMake/CommandLine/C-no-arg-stderr.txt2
-rw-r--r--Tests/RunCMake/CommandLine/C-no-file-result.txt1
-rw-r--r--Tests/RunCMake/CommandLine/C-no-file-stderr.txt3
-rw-r--r--Tests/RunCMake/CommandLine/D-no-arg-result.txt1
-rw-r--r--Tests/RunCMake/CommandLine/D-no-arg-stderr.txt2
-rw-r--r--Tests/RunCMake/CommandLine/E-no-arg-result.txt1
-rw-r--r--Tests/RunCMake/CommandLine/E-no-arg-stderr.txt3
-rw-r--r--Tests/RunCMake/CommandLine/E_create_symlink-no-arg-result.txt1
-rw-r--r--Tests/RunCMake/CommandLine/E_create_symlink-no-arg-stderr.txt3
-rw-r--r--Tests/RunCMake/CommandLine/E_rename-no-arg-result.txt1
-rw-r--r--Tests/RunCMake/CommandLine/E_rename-no-arg-stderr.txt3
-rw-r--r--Tests/RunCMake/CommandLine/E_touch_nocreate-no-arg-result.txt1
-rw-r--r--Tests/RunCMake/CommandLine/E_touch_nocreate-no-arg-stderr.txt3
-rw-r--r--Tests/RunCMake/CommandLine/G_bad-arg-result.txt1
-rw-r--r--Tests/RunCMake/CommandLine/G_bad-arg-stderr.txt3
-rw-r--r--Tests/RunCMake/CommandLine/G_no-arg-result.txt1
-rw-r--r--Tests/RunCMake/CommandLine/G_no-arg-stderr.txt3
-rw-r--r--Tests/RunCMake/CommandLine/NoArgs-stdout.txt10
-rw-r--r--Tests/RunCMake/CommandLine/P_no-arg-result.txt1
-rw-r--r--Tests/RunCMake/CommandLine/P_no-arg-stderr.txt1
-rw-r--r--Tests/RunCMake/CommandLine/P_no-file-result.txt1
-rw-r--r--Tests/RunCMake/CommandLine/P_no-file-stderr.txt1
-rw-r--r--Tests/RunCMake/CommandLine/RunCMakeTest.cmake40
-rw-r--r--Tests/RunCMake/CommandLine/U-no-arg-result.txt1
-rw-r--r--Tests/RunCMake/CommandLine/U-no-arg-stderr.txt2
-rw-r--r--Tests/RunCMake/CommandLine/Wdev-stderr.txt5
-rw-r--r--Tests/RunCMake/CommandLine/Wdev.cmake1
-rw-r--r--Tests/RunCMake/CommandLine/Wno-dev.cmake1
-rw-r--r--Tests/RunCMake/CommandLine/cache-no-file-result.txt1
-rw-r--r--Tests/RunCMake/CommandLine/cache-no-file-stderr.txt2
-rw-r--r--Tests/RunCMake/CommandLine/debug-output-stdout.txt1
-rw-r--r--Tests/RunCMake/CommandLine/debug-output.cmake0
-rw-r--r--Tests/RunCMake/CommandLine/debug-trycompile.cmake5
-rw-r--r--Tests/RunCMake/CommandLine/lists-no-file-result.txt1
-rw-r--r--Tests/RunCMake/CommandLine/lists-no-file-stderr.txt2
-rw-r--r--Tests/RunCMake/CommandLine/trace-stderr.txt2
-rw-r--r--Tests/RunCMake/CommandLine/trace.cmake0
57 files changed, 393 insertions, 169 deletions
diff --git a/CTestCustom.cmake.in b/CTestCustom.cmake.in
index d716498..8a345b0 100644
--- a/CTestCustom.cmake.in
+++ b/CTestCustom.cmake.in
@@ -53,6 +53,8 @@ set(CTEST_CUSTOM_WARNING_EXCEPTION
"CMakeSetupManifest.xml.*manifest authoring warning.*Unrecognized Element"
"cc-3968 CC: WARNING File.*" # "implicit" truncation by static_cast
"ld: warning: directory not found for option .-(F|L)"
+ "ld: warning .*/libgcc.a archive's cputype"
+ "ld: warning: ignoring file .*/libgcc.a, file was built for archive which is not the architecture being linked"
"ld: warning: in .*/libgcc.a, file is not of required architecture"
"warning.*This version of Mac OS X is unsupported"
"clang.*: warning: argument unused during compilation: .-g"
diff --git a/Source/CMakeLists.txt b/Source/CMakeLists.txt
index 868e8b9..58c4ba9 100644
--- a/Source/CMakeLists.txt
+++ b/Source/CMakeLists.txt
@@ -159,6 +159,8 @@ set(SRCS
cmCacheManager.cxx
cmCacheManager.h
"${CMAKE_CURRENT_BINARY_DIR}/cmCommands.cxx"
+ cmCLocaleEnvironmentScope.h
+ cmCLocaleEnvironmentScope.cxx
cmCommands.h
cmCommandArgumentLexer.cxx
cmCommandArgumentParser.cxx
diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake
index 6de0439..f91acbe 100644
--- a/Source/CMakeVersion.cmake
+++ b/Source/CMakeVersion.cmake
@@ -1,5 +1,5 @@
# CMake version number components.
set(CMake_VERSION_MAJOR 3)
set(CMake_VERSION_MINOR 2)
-set(CMake_VERSION_PATCH 20150411)
+set(CMake_VERSION_PATCH 20150413)
#set(CMake_VERSION_RC 1)
diff --git a/Source/CTest/cmCTestUpdateHandler.cxx b/Source/CTest/cmCTestUpdateHandler.cxx
index b9da8a0..10927e7 100644
--- a/Source/CTest/cmCTestUpdateHandler.cxx
+++ b/Source/CTest/cmCTestUpdateHandler.cxx
@@ -21,6 +21,7 @@
#include "cmGeneratedFileStream.h"
#include "cmXMLParser.h"
#include "cmXMLSafe.h"
+#include "cmCLocaleEnvironmentScope.h"
#include "cmCTestVC.h"
#include "cmCTestCVS.h"
@@ -66,46 +67,6 @@ static const char* cmCTestUpdateHandlerUpdateToString(int type)
return cmCTestUpdateHandlerUpdateStrings[type];
}
-class cmCTestUpdateHandlerLocale
-{
-public:
- cmCTestUpdateHandlerLocale();
- ~cmCTestUpdateHandlerLocale();
-private:
- std::string saveLCAll;
-};
-
-cmCTestUpdateHandlerLocale::cmCTestUpdateHandlerLocale()
-{
- const char* lcall = cmSystemTools::GetEnv("LC_ALL");
- if(lcall)
- {
- saveLCAll = lcall;
- }
- // if LC_ALL is not set to C, then
- // set it, so that svn/cvs info will be in english ascii
- if(! (lcall && strcmp(lcall, "C") == 0))
- {
- cmSystemTools::PutEnv("LC_ALL=C");
- }
-}
-
-cmCTestUpdateHandlerLocale::~cmCTestUpdateHandlerLocale()
-{
- // restore the value of LC_ALL after running the version control
- // commands
- if(!saveLCAll.empty())
- {
- std::string put = "LC_ALL=";
- put += saveLCAll;
- cmSystemTools::PutEnv(put);
- }
- else
- {
- cmSystemTools::UnsetEnv("LC_ALL");
- }
-}
-
//----------------------------------------------------------------------
cmCTestUpdateHandler::cmCTestUpdateHandler()
{
@@ -194,7 +155,7 @@ int cmCTestUpdateHandler::DetermineType(const char* cmd, const char* type)
int cmCTestUpdateHandler::ProcessHandler()
{
// Make sure VCS tool messages are in English so we can parse them.
- cmCTestUpdateHandlerLocale fixLocale;
+ cmCLocaleEnvironmentScope fixLocale;
static_cast<void>(fixLocale);
// Get source dir
diff --git a/Source/cmCLocaleEnvironmentScope.cxx b/Source/cmCLocaleEnvironmentScope.cxx
new file mode 100644
index 0000000..5792302
--- /dev/null
+++ b/Source/cmCLocaleEnvironmentScope.cxx
@@ -0,0 +1,67 @@
+/*============================================================================
+ CMake - Cross Platform Makefile Generator
+ Copyright 2015 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 "cmCLocaleEnvironmentScope.h"
+
+#include "cmSystemTools.h"
+
+#include <sstream>
+
+cmCLocaleEnvironmentScope::cmCLocaleEnvironmentScope()
+{
+ this->SetEnv("LANGUAGE", "");
+ this->SetEnv("LC_MESSAGES", "C");
+
+ std::string lcAll = this->GetEnv("LC_ALL");
+
+ if(!lcAll.empty())
+ {
+ this->SetEnv("LC_ALL", "");
+ this->SetEnv("LC_CTYPE", lcAll);
+ }
+}
+
+std::string cmCLocaleEnvironmentScope::GetEnv(std::string const& key)
+{
+ const char* value = cmSystemTools::GetEnv(key);
+ return value ? value : std::string();
+}
+
+void cmCLocaleEnvironmentScope::SetEnv(
+ std::string const& key, std::string const& value)
+{
+ std::string oldValue = this->GetEnv(key);
+
+ this->EnvironmentBackup.insert(std::make_pair(key, oldValue));
+
+ if(value.empty())
+ {
+ cmSystemTools::UnsetEnv(key.c_str());
+ }
+ else
+ {
+ std::stringstream tmp;
+ tmp << key << "=" << value;
+ cmSystemTools::PutEnv(tmp.str());
+ }
+}
+
+cmCLocaleEnvironmentScope::~cmCLocaleEnvironmentScope()
+{
+ for(backup_map_t::const_iterator i = this->EnvironmentBackup.begin();
+ i != this->EnvironmentBackup.end(); ++i)
+ {
+ std::stringstream tmp;
+ tmp << i->first << "=" << i->second;
+ cmSystemTools::PutEnv(tmp.str());
+ }
+}
diff --git a/Source/cmCLocaleEnvironmentScope.h b/Source/cmCLocaleEnvironmentScope.h
new file mode 100644
index 0000000..b011741
--- /dev/null
+++ b/Source/cmCLocaleEnvironmentScope.h
@@ -0,0 +1,32 @@
+/*============================================================================
+ CMake - Cross Platform Makefile Generator
+ Copyright 2015 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.
+============================================================================*/
+
+#ifndef cmCLocaleEnvironmentScope_h
+#define cmCLocaleEnvironmentScope_h
+
+#include "cmStandardIncludes.h"
+
+class cmCLocaleEnvironmentScope
+{
+public:
+ cmCLocaleEnvironmentScope();
+ ~cmCLocaleEnvironmentScope();
+
+private:
+ std::string GetEnv(std::string const& key);
+ void SetEnv(std::string const& key, std::string const& value);
+
+ typedef std::map<std::string, std::string> backup_map_t;
+ backup_map_t EnvironmentBackup;
+};
+
+#endif
diff --git a/Source/cmDocumentation.cxx b/Source/cmDocumentation.cxx
index 8c17536..4f34755 100644
--- a/Source/cmDocumentation.cxx
+++ b/Source/cmDocumentation.cxx
@@ -138,6 +138,8 @@ bool cmDocumentation::PrintDocumentation(Type ht, std::ostream& os)
return this->PrintHelpListVariables(os);
case cmDocumentation::ListPolicies:
return this->PrintHelpListPolicies(os);
+ case cmDocumentation::ListGenerators:
+ return this->PrintHelpListGenerators(os);
case cmDocumentation::Version:
return this->PrintVersion(os);
case cmDocumentation::OldCustomModules:
@@ -817,6 +819,19 @@ bool cmDocumentation::PrintHelpListPolicies(std::ostream& os)
}
//----------------------------------------------------------------------------
+bool cmDocumentation::PrintHelpListGenerators(std::ostream& os)
+{
+ std::map<std::string,cmDocumentationSection*>::iterator si;
+ si = this->AllSections.find("Generators");
+ if(si != this->AllSections.end())
+ {
+ this->Formatter.SetIndent(" ");
+ this->Formatter.PrintSection(os, *si->second);
+ }
+ return true;
+}
+
+//----------------------------------------------------------------------------
bool cmDocumentation::PrintHelpOneVariable(std::ostream& os)
{
std::string vname = cmSystemTools::HelpFileName(this->CurrentArgument);
diff --git a/Source/cmDocumentation.h b/Source/cmDocumentation.h
index b72b5fe..8854c36 100644
--- a/Source/cmDocumentation.h
+++ b/Source/cmDocumentation.h
@@ -117,6 +117,7 @@ private:
bool PrintHelpListProperties(std::ostream& os);
bool PrintHelpListVariables(std::ostream& os);
bool PrintHelpListPolicies(std::ostream& os);
+ bool PrintHelpListGenerators(std::ostream& os);
bool PrintOldCustomModules(std::ostream& os);
const char* GetNameString() const;
diff --git a/Source/cmDocumentationFormatter.h b/Source/cmDocumentationFormatter.h
index 59513cc..6e19b7d 100644
--- a/Source/cmDocumentationFormatter.h
+++ b/Source/cmDocumentationFormatter.h
@@ -26,8 +26,8 @@ public:
/** Types of help provided. */
enum Type
{
- None, Version, Usage, Help, Full, ListManuals,
- ListCommands, ListModules, ListProperties, ListVariables, ListPolicies,
+ None, Version, Usage, Help, Full, ListManuals, ListCommands,
+ ListModules, ListProperties, ListVariables, ListPolicies, ListGenerators,
OneManual, OneCommand, OneModule, OneProperty, OneVariable, OnePolicy,
OldCustomModules
};
diff --git a/Source/cmMakefileTargetGenerator.cxx b/Source/cmMakefileTargetGenerator.cxx
index 2cd2d3e..bd9c579 100644
--- a/Source/cmMakefileTargetGenerator.cxx
+++ b/Source/cmMakefileTargetGenerator.cxx
@@ -778,7 +778,7 @@ cmMakefileTargetGenerator
// Write the rule.
this->WriteMakeRule(*this->BuildFileStream, 0, outputs,
- depends, commands, false);
+ depends, commands);
bool do_preprocess_rules = lang_has_preprocessor &&
this->LocalGenerator->GetCreatePreprocessedSourceRules();
@@ -1000,18 +1000,30 @@ void cmMakefileTargetGenerator::WriteTargetCleanRules()
}
//----------------------------------------------------------------------------
-void cmMakefileTargetGenerator::WriteMakeRule(
+bool cmMakefileTargetGenerator::WriteMakeRule(
std::ostream& os,
const char* comment,
const std::vector<std::string>& outputs,
const std::vector<std::string>& depends,
const std::vector<std::string>& commands,
- bool symbolic,
bool in_help)
{
+ bool symbolic = false;
if (outputs.size() == 0)
{
- return;
+ return symbolic;
+ }
+
+ // Check whether we need to bother checking for a symbolic output.
+ bool need_symbolic = this->GlobalGenerator->GetNeedSymbolicMark();
+
+ // Check whether the first output is marked as symbolic.
+ if(need_symbolic)
+ {
+ if(cmSourceFile* sf = this->Makefile->GetSource(outputs[0]))
+ {
+ symbolic = sf->GetPropertyAsBool("SYMBOLIC");
+ }
}
// We always attach the actual commands to the first output.
@@ -1021,7 +1033,7 @@ void cmMakefileTargetGenerator::WriteMakeRule(
// For single outputs, we are done.
if (outputs.size() == 1)
{
- return;
+ return symbolic;
}
// For multiple outputs, make the extra ones depend on the first one.
@@ -1034,14 +1046,25 @@ void cmMakefileTargetGenerator::WriteMakeRule(
std::string const out = this->Convert(*o, cmLocalGenerator::HOME_OUTPUT,
cmLocalGenerator::SHELL);
std::vector<std::string> output_commands;
- if (!symbolic)
+
+ bool o_symbolic = false;
+ if(need_symbolic)
+ {
+ if(cmSourceFile* sf = this->Makefile->GetSource(*o))
+ {
+ o_symbolic = sf->GetPropertyAsBool("SYMBOLIC");
+ }
+ }
+ symbolic = symbolic && o_symbolic;
+
+ if (!o_symbolic)
{
output_commands.push_back("@$(CMAKE_COMMAND) -E touch_nocreate " + out);
}
this->LocalGenerator->WriteMakeRule(os, 0, *o, output_depends,
- output_commands, symbolic, in_help);
+ output_commands, o_symbolic, in_help);
- if (!symbolic)
+ if (!o_symbolic)
{
// At build time, remove the first output if this one does not exist
// so that "make" will rerun the real commands that create this one.
@@ -1049,6 +1072,7 @@ void cmMakefileTargetGenerator::WriteMakeRule(
this->MultipleOutputPairs.insert(p);
}
}
+ return symbolic;
}
//----------------------------------------------------------------------------
@@ -1269,30 +1293,16 @@ void cmMakefileTargetGenerator
std::vector<std::string> depends;
this->LocalGenerator->AppendCustomDepend(depends, ccg);
- // Check whether we need to bother checking for a symbolic output.
- bool need_symbolic = this->GlobalGenerator->GetNeedSymbolicMark();
-
// Write the rule.
const std::vector<std::string>& outputs = ccg.GetOutputs();
- std::vector<std::string>::const_iterator o = outputs.begin();
- {
- bool symbolic = false;
- if(need_symbolic)
- {
- if(cmSourceFile* sf = this->Makefile->GetSource(*o))
- {
- symbolic = sf->GetPropertyAsBool("SYMBOLIC");
- }
- }
- this->WriteMakeRule(*this->BuildFileStream, 0, outputs,
- depends, commands, symbolic);
+ bool symbolic = this->WriteMakeRule(*this->BuildFileStream, 0,
+ outputs, depends, commands);
// If the rule has changed make sure the output is rebuilt.
if(!symbolic)
{
this->GlobalGenerator->AddRuleHash(ccg.GetOutputs(), content.str());
}
- }
// Setup implicit dependency scanning.
for(cmCustomCommand::ImplicitDependsList::const_iterator
diff --git a/Source/cmMakefileTargetGenerator.h b/Source/cmMakefileTargetGenerator.h
index 98017be..58044e8 100644
--- a/Source/cmMakefileTargetGenerator.h
+++ b/Source/cmMakefileTargetGenerator.h
@@ -224,12 +224,11 @@ protected:
typedef std::map<std::string, std::string> MultipleOutputPairsType;
MultipleOutputPairsType MultipleOutputPairs;
- void WriteMakeRule(std::ostream& os,
+ bool WriteMakeRule(std::ostream& os,
const char* comment,
const std::vector<std::string>& outputs,
const std::vector<std::string>& depends,
const std::vector<std::string>& commands,
- bool symbolic,
bool in_help = false);
// Target name info.
diff --git a/Source/cmake.cxx b/Source/cmake.cxx
index 7ccd76a..ac0f5d0 100644
--- a/Source/cmake.cxx
+++ b/Source/cmake.cxx
@@ -816,6 +816,7 @@ void cmake::SetArgs(const std::vector<std::string>& args,
if(i >= args.size())
{
cmSystemTools::Error("No generator specified for -G");
+ this->PrintGeneratorList();
return;
}
value = args[i];
@@ -826,6 +827,7 @@ void cmake::SetArgs(const std::vector<std::string>& args,
{
cmSystemTools::Error("Could not create named generator ",
value.c_str());
+ this->PrintGeneratorList();
}
else
{
@@ -1993,6 +1995,18 @@ void cmake::GetGeneratorDocumentation(std::vector<cmDocumentationEntry>& v)
}
}
+void cmake::PrintGeneratorList()
+{
+#ifdef CMAKE_BUILD_WITH_CMAKE
+ cmDocumentation doc;
+ std::vector<cmDocumentationEntry> generators;
+ this->GetGeneratorDocumentation(generators);
+ doc.AppendSection("Generators",generators);
+ std::cerr << "\n";
+ doc.PrintDocumentation(cmDocumentation::ListGenerators, std::cerr);
+#endif
+}
+
void cmake::UpdateConversionPathTable()
{
// Update the path conversion table with any specified file:
@@ -2458,6 +2472,7 @@ int cmake::GetSystemInformation(std::vector<std::string>& args)
if(i >= args.size())
{
cmSystemTools::Error("No generator specified for -G");
+ this->PrintGeneratorList();
return -1;
}
value = args[i];
@@ -2468,6 +2483,7 @@ int cmake::GetSystemInformation(std::vector<std::string>& args)
{
cmSystemTools::Error("Could not create named generator ",
value.c_str());
+ this->PrintGeneratorList();
}
else
{
diff --git a/Source/cmake.h b/Source/cmake.h
index 87b771d..4c2ad29 100644
--- a/Source/cmake.h
+++ b/Source/cmake.h
@@ -450,6 +450,9 @@ private:
InstalledFilesMap InstalledFiles;
void UpdateConversionPathTable();
+
+ // Print a list of valid generators to stderr.
+ void PrintGeneratorList();
};
#define CMAKE_STANDARD_OPTIONS_TABLE \
diff --git a/Source/kwsys/SystemTools.cxx b/Source/kwsys/SystemTools.cxx
index 8a481d6..6c4a7a6 100644
--- a/Source/kwsys/SystemTools.cxx
+++ b/Source/kwsys/SystemTools.cxx
@@ -1260,15 +1260,22 @@ bool SystemTools::PathCygwinToWin32(const char *path, char *win32_path)
bool SystemTools::Touch(const kwsys_stl::string& filename, bool create)
{
- if(create && !SystemTools::FileExists(filename))
+ if (!SystemTools::FileExists(filename))
{
- FILE* file = Fopen(filename, "a+b");
- if(file)
+ if(create)
+ {
+ FILE* file = Fopen(filename, "a+b");
+ if(file)
+ {
+ fclose(file);
+ return true;
+ }
+ return false;
+ }
+ else
{
- fclose(file);
return true;
}
- return false;
}
#if defined(_WIN32) && !defined(__CYGWIN__)
HANDLE h = CreateFileW(
diff --git a/Tests/BuildDepends/CMakeLists.txt b/Tests/BuildDepends/CMakeLists.txt
index 78e9e17..2be59b6 100644
--- a/Tests/BuildDepends/CMakeLists.txt
+++ b/Tests/BuildDepends/CMakeLists.txt
@@ -42,6 +42,11 @@ list(APPEND _cmake_options "-DTEST_LINK_DEPENDS=${TEST_LINK_DEPENDS}")
list(APPEND _cmake_options "-DCMAKE_FORCE_DEPFILES=1")
+if(NOT CMAKE_GENERATOR MATCHES "Visual Studio ([^6789]|[6789][0-9])")
+ set(TEST_MULTI3 1)
+ list(APPEND _cmake_options "-DTEST_MULTI3=1")
+endif()
+
file(MAKE_DIRECTORY ${BuildDepends_BINARY_DIR}/Project)
message("Creating Project/foo.cxx")
write_file(${BuildDepends_BINARY_DIR}/Project/foo.cxx
@@ -66,6 +71,8 @@ set(link_depends_no_shared_check_txt ${BuildDepends_BINARY_DIR}/Project/link_dep
file(WRITE ${BuildDepends_BINARY_DIR}/Project/external.in "external original\n")
file(WRITE ${BuildDepends_BINARY_DIR}/Project/multi1-in.txt "multi1-in original\n")
+file(WRITE ${BuildDepends_BINARY_DIR}/Project/multi2-stamp.txt "multi2-stamp original\n")
+file(WRITE ${BuildDepends_BINARY_DIR}/Project/multi3-stamp.txt "multi3-stamp original\n")
help_xcode_depends()
@@ -191,6 +198,34 @@ else()
"multi1-out2-copy.txt is missing")
endif()
+if(EXISTS ${BuildDepends_BINARY_DIR}/Project/multi2-real.txt)
+ if(${BuildDepends_BINARY_DIR}/Project/multi2-real.txt
+ IS_NEWER_THAN ${BuildDepends_BINARY_DIR}/Project/multi2-stamp.txt)
+ message(STATUS "multi2-real.txt is newer than multi2-stamp.txt")
+ else()
+ message(SEND_ERROR "Project did not initially build properly: "
+ "multi2-real.txt is not newer than multi2-stamp.txt")
+ endif()
+else()
+ message(SEND_ERROR "Project did not initially build properly: "
+ "multi2-real.txt is missing")
+endif()
+
+if(TEST_MULTI3)
+ if(EXISTS ${BuildDepends_BINARY_DIR}/Project/multi3-real.txt)
+ if(${BuildDepends_BINARY_DIR}/Project/multi3-real.txt
+ IS_NEWER_THAN ${BuildDepends_BINARY_DIR}/Project/multi3-stamp.txt)
+ message(STATUS "multi3-real.txt is newer than multi3-stamp.txt")
+ else()
+ message(SEND_ERROR "Project did not initially build properly: "
+ "multi3-real.txt is not newer than multi3-stamp.txt")
+ endif()
+ else()
+ message(SEND_ERROR "Project did not initially build properly: "
+ "multi3-real.txt is missing")
+ endif()
+endif()
+
message("Waiting 3 seconds...")
execute_process(COMMAND ${CMAKE_COMMAND} -E sleep 3)
@@ -217,6 +252,8 @@ endif()
file(WRITE ${BuildDepends_BINARY_DIR}/Project/external.in "external changed\n")
file(WRITE ${BuildDepends_BINARY_DIR}/Project/multi1-in.txt "multi1-in changed\n")
+file(WRITE ${BuildDepends_BINARY_DIR}/Project/multi2-stamp.txt "multi2-stamp changed\n")
+file(WRITE ${BuildDepends_BINARY_DIR}/Project/multi3-stamp.txt "multi3-stamp changed\n")
help_xcode_depends()
@@ -347,3 +384,31 @@ else()
message(SEND_ERROR "Project did not rebuild properly: "
"multi1-out2-copy.txt is missing")
endif()
+
+if(EXISTS ${BuildDepends_BINARY_DIR}/Project/multi2-real.txt)
+ if(${BuildDepends_BINARY_DIR}/Project/multi2-real.txt
+ IS_NEWER_THAN ${BuildDepends_BINARY_DIR}/Project/multi2-stamp.txt)
+ message(STATUS "multi2-real.txt is newer than multi2-stamp.txt")
+ else()
+ message(SEND_ERROR "Project did not rebuild properly: "
+ "multi2-real.txt is not newer than multi2-stamp.txt")
+ endif()
+else()
+ message(SEND_ERROR "Project did not rebuild properly: "
+ "multi2-real.txt is missing")
+endif()
+
+if(TEST_MULTI3)
+ if(EXISTS ${BuildDepends_BINARY_DIR}/Project/multi3-real.txt)
+ if(${BuildDepends_BINARY_DIR}/Project/multi3-real.txt
+ IS_NEWER_THAN ${BuildDepends_BINARY_DIR}/Project/multi3-stamp.txt)
+ message(STATUS "multi3-real.txt is newer than multi3-stamp.txt")
+ else()
+ message(SEND_ERROR "Project did not rebuild properly: "
+ "multi3-real.txt is not newer than multi3-stamp.txt")
+ endif()
+ else()
+ message(SEND_ERROR "Project did not rebuild properly: "
+ "multi3-real.txt is missing")
+ endif()
+endif()
diff --git a/Tests/BuildDepends/Project/CMakeLists.txt b/Tests/BuildDepends/Project/CMakeLists.txt
index cb9fbf8..0db39c5 100644
--- a/Tests/BuildDepends/Project/CMakeLists.txt
+++ b/Tests/BuildDepends/Project/CMakeLists.txt
@@ -164,3 +164,21 @@ add_custom_command(
DEPENDS multi1-out2.txt
)
add_custom_target(multi1 ALL DEPENDS multi1-out2-copy.txt)
+
+# Test having the first output never created.
+add_custom_command(
+ OUTPUT multi2-dummy.txt multi2-real.txt
+ COMMAND ${CMAKE_COMMAND} -E touch multi2-real.txt
+ )
+set_property(SOURCE multi2-real.txt multi2-dummy.txt PROPERTY SYMBOLIC 1)
+add_custom_target(multi2 ALL DEPENDS multi2-real.txt)
+
+if(TEST_MULTI3)
+ # Test having the second output never created. Does not work with msbuild.
+ add_custom_command(
+ OUTPUT multi3-real.txt multi3-dummy.txt
+ COMMAND ${CMAKE_COMMAND} -E touch multi3-real.txt
+ )
+ set_property(SOURCE multi3-real.txt multi3-dummy.txt PROPERTY SYMBOLIC 1)
+ add_custom_target(multi3 ALL DEPENDS multi3-real.txt)
+endif()
diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt
index aa6a993..1e60abe 100644
--- a/Tests/CMakeLists.txt
+++ b/Tests/CMakeLists.txt
@@ -1095,21 +1095,6 @@ ${CMake_BINARY_DIR}/bin/cmake -DDIR=dev -P ${CMake_SOURCE_DIR}/Utilities/Release
"${CMake_BINARY_DIR}/Tests/CMakeTestAllGenerators")
endif()
- if(NOT DEFINED CTEST_RUN_CMakeTestBadCommandLines)
- set(CTEST_RUN_CMakeTestBadCommandLines ON)
- endif()
-
- if(CTEST_RUN_CMakeTestBadCommandLines)
- add_test(CMakeTestBadCommandLines ${CMAKE_CMAKE_COMMAND}
- -D dir=${CMake_BINARY_DIR}/Tests/CMakeTestBadCommandLines
- -D gen=${CMAKE_GENERATOR}
- -D CMake_SOURCE_DIR=${CMake_SOURCE_DIR}
- -P ${CMake_SOURCE_DIR}/Tests/CMakeTestBadCommandLines/RunCMake.cmake
- )
- list(APPEND TEST_BUILD_DIRS
- "${CMake_BINARY_DIR}/Tests/CMakeTestBadCommandLines")
- endif()
-
if(NOT DEFINED CTEST_RUN_CMakeTestMultipleConfigures)
set(CTEST_RUN_CMakeTestMultipleConfigures ON)
endif()
diff --git a/Tests/CMakeTestBadCommandLines/RunCMake.cmake b/Tests/CMakeTestBadCommandLines/RunCMake.cmake
deleted file mode 100644
index 08549cc..0000000
--- a/Tests/CMakeTestBadCommandLines/RunCMake.cmake
+++ /dev/null
@@ -1,79 +0,0 @@
-if(NOT DEFINED CMake_SOURCE_DIR)
- message(FATAL_ERROR "CMake_SOURCE_DIR not defined")
-endif()
-
-if(NOT DEFINED dir)
- message(FATAL_ERROR "dir not defined")
-endif()
-
-if(NOT DEFINED gen)
- message(FATAL_ERROR "gen not defined")
-endif()
-
-message(STATUS "CTEST_FULL_OUTPUT (Avoid ctest truncation of output)")
-
-# First setup a source tree to run CMake on.
-#
-execute_process(COMMAND ${CMAKE_COMMAND} -E copy_directory
- ${CMake_SOURCE_DIR}/Tests/CTestTest/SmallAndFast
- ${dir}/Source
-)
-
-execute_process(COMMAND ${CMAKE_COMMAND} -E make_directory
- ${dir}/Build
- )
-
-function(RunCMakeWithArgs)
- message(STATUS "info: running cmake with ARGN='${ARGN}'")
-
- execute_process(COMMAND ${CMAKE_COMMAND} ${ARGN}
- RESULT_VARIABLE result
- OUTPUT_VARIABLE stdout
- ERROR_VARIABLE stderr
- WORKING_DIRECTORY ${dir}/Build
- )
-
- message(STATUS "result='${result}'")
- message(STATUS "stdout='${stdout}'")
- message(STATUS "stderr='${stderr}'")
- message(STATUS "")
-endfunction()
-
-# Run cmake once with no errors to get a good build tree:
-#
-RunCMakeWithArgs(-G ${gen} ../Source)
-
-# Run cmake with args that produce some sort of problem to cover the error
-# cases in cmake.cxx...
-#
-# (These are not good examples of cmake command lines. Do not copy and
-# paste them elsewhere and expect them to work... See the cmake
-# documentation or other real examples of usage instead.)
-#
-RunCMakeWithArgs()
-RunCMakeWithArgs(-C)
-RunCMakeWithArgs(-C nosuchcachefile.txt)
-RunCMakeWithArgs(--check-stamp-file nostampfile)
-RunCMakeWithArgs(--check-stamp-list nostamplist)
-RunCMakeWithArgs(nosuchsubdir/CMakeCache.txt)
-RunCMakeWithArgs(nosuchsubdir/CMakeLists.txt)
-RunCMakeWithArgs(-D)
-RunCMakeWithArgs(--debug-output .)
-RunCMakeWithArgs(--debug-trycompile .)
-RunCMakeWithArgs(-E)
-RunCMakeWithArgs(-E create_symlink)
-RunCMakeWithArgs(-E echo_append)
-RunCMakeWithArgs(-E rename)
-RunCMakeWithArgs(-E touch_nocreate)
-RunCMakeWithArgs(-G)
-RunCMakeWithArgs(--graphviz= ../Source)
-RunCMakeWithArgs(--graphviz=g.dot .)
-RunCMakeWithArgs(-P)
-RunCMakeWithArgs(-P nosuchscriptfile.cmake)
-RunCMakeWithArgs(--trace .)
-RunCMakeWithArgs(-U)
-RunCMakeWithArgs(-U nosuchvariable .)
-RunCMakeWithArgs(-V)
-RunCMakeWithArgs(-V .)
-RunCMakeWithArgs(-Wno-dev .)
-RunCMakeWithArgs(-Wdev .)
diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt
index d7ac81d..d5f1d22 100644
--- a/Tests/RunCMake/CMakeLists.txt
+++ b/Tests/RunCMake/CMakeLists.txt
@@ -232,3 +232,11 @@ endif()
add_executable(pseudo_emulator pseudo_emulator.c)
add_RunCMake_test(CrosscompilingEmulator
-DPSEUDO_EMULATOR=$<TARGET_FILE:pseudo_emulator>)
+# Xcode 2.x forgets to create the output directory before linking
+# the individual architectures.
+if(CMAKE_OSX_ARCHITECTURES AND XCODE AND NOT "${XCODE_VERSION}" MATCHES "^[^12]")
+ add_custom_command(
+ TARGET pseudo_emulator
+ PRE_BUILD COMMAND ${CMAKE_COMMAND} -E make_directory "${CMAKE_CFG_INTDIR}"
+ )
+endif()
diff --git a/Tests/RunCMake/CommandLine/C-no-arg-result.txt b/Tests/RunCMake/CommandLine/C-no-arg-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/C-no-arg-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CommandLine/C-no-arg-stderr.txt b/Tests/RunCMake/CommandLine/C-no-arg-stderr.txt
new file mode 100644
index 0000000..0570d8f
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/C-no-arg-stderr.txt
@@ -0,0 +1,2 @@
+^CMake Error: -C must be followed by a file name.
+CMake Error: Problem processing arguments. Aborting.$
diff --git a/Tests/RunCMake/CommandLine/C-no-file-result.txt b/Tests/RunCMake/CommandLine/C-no-file-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/C-no-file-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CommandLine/C-no-file-stderr.txt b/Tests/RunCMake/CommandLine/C-no-file-stderr.txt
new file mode 100644
index 0000000..5315f59
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/C-no-file-stderr.txt
@@ -0,0 +1,3 @@
+^CMake Error: Error processing file: nosuchcachefile.txt
+CMake Error: The source directory ".*/Tests/RunCMake/CommandLine/C-no-file-build/nosuchcachefile.txt" does not exist.
+Specify --help for usage, or press the help button on the CMake GUI.$
diff --git a/Tests/RunCMake/CommandLine/D-no-arg-result.txt b/Tests/RunCMake/CommandLine/D-no-arg-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/D-no-arg-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CommandLine/D-no-arg-stderr.txt b/Tests/RunCMake/CommandLine/D-no-arg-stderr.txt
new file mode 100644
index 0000000..5e43bca
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/D-no-arg-stderr.txt
@@ -0,0 +1,2 @@
+^CMake Error: -D must be followed with VAR=VALUE.
+CMake Error: Problem processing arguments. Aborting.$
diff --git a/Tests/RunCMake/CommandLine/E-no-arg-result.txt b/Tests/RunCMake/CommandLine/E-no-arg-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/E-no-arg-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CommandLine/E-no-arg-stderr.txt b/Tests/RunCMake/CommandLine/E-no-arg-stderr.txt
new file mode 100644
index 0000000..056ce05
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/E-no-arg-stderr.txt
@@ -0,0 +1,3 @@
+^CMake Error: cmake version .*
+Usage: .* -E \[command\] \[arguments ...\]
+Available commands:
diff --git a/Tests/RunCMake/CommandLine/E_create_symlink-no-arg-result.txt b/Tests/RunCMake/CommandLine/E_create_symlink-no-arg-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/E_create_symlink-no-arg-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CommandLine/E_create_symlink-no-arg-stderr.txt b/Tests/RunCMake/CommandLine/E_create_symlink-no-arg-stderr.txt
new file mode 100644
index 0000000..056ce05
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/E_create_symlink-no-arg-stderr.txt
@@ -0,0 +1,3 @@
+^CMake Error: cmake version .*
+Usage: .* -E \[command\] \[arguments ...\]
+Available commands:
diff --git a/Tests/RunCMake/CommandLine/E_rename-no-arg-result.txt b/Tests/RunCMake/CommandLine/E_rename-no-arg-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/E_rename-no-arg-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CommandLine/E_rename-no-arg-stderr.txt b/Tests/RunCMake/CommandLine/E_rename-no-arg-stderr.txt
new file mode 100644
index 0000000..056ce05
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/E_rename-no-arg-stderr.txt
@@ -0,0 +1,3 @@
+^CMake Error: cmake version .*
+Usage: .* -E \[command\] \[arguments ...\]
+Available commands:
diff --git a/Tests/RunCMake/CommandLine/E_touch_nocreate-no-arg-result.txt b/Tests/RunCMake/CommandLine/E_touch_nocreate-no-arg-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/E_touch_nocreate-no-arg-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CommandLine/E_touch_nocreate-no-arg-stderr.txt b/Tests/RunCMake/CommandLine/E_touch_nocreate-no-arg-stderr.txt
new file mode 100644
index 0000000..056ce05
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/E_touch_nocreate-no-arg-stderr.txt
@@ -0,0 +1,3 @@
+^CMake Error: cmake version .*
+Usage: .* -E \[command\] \[arguments ...\]
+Available commands:
diff --git a/Tests/RunCMake/CommandLine/G_bad-arg-result.txt b/Tests/RunCMake/CommandLine/G_bad-arg-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/G_bad-arg-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CommandLine/G_bad-arg-stderr.txt b/Tests/RunCMake/CommandLine/G_bad-arg-stderr.txt
new file mode 100644
index 0000000..07f2b52
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/G_bad-arg-stderr.txt
@@ -0,0 +1,3 @@
+^CMake Error: Could not create named generator NoSuchGenerator
+
+Generators
diff --git a/Tests/RunCMake/CommandLine/G_no-arg-result.txt b/Tests/RunCMake/CommandLine/G_no-arg-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/G_no-arg-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CommandLine/G_no-arg-stderr.txt b/Tests/RunCMake/CommandLine/G_no-arg-stderr.txt
new file mode 100644
index 0000000..2f491a2
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/G_no-arg-stderr.txt
@@ -0,0 +1,3 @@
+^CMake Error: No generator specified for -G
+
+Generators
diff --git a/Tests/RunCMake/CommandLine/NoArgs-stdout.txt b/Tests/RunCMake/CommandLine/NoArgs-stdout.txt
new file mode 100644
index 0000000..1cd3469
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/NoArgs-stdout.txt
@@ -0,0 +1,10 @@
+^Usage
+
+ cmake \[options\] <path-to-source>
+ cmake \[options\] <path-to-existing-build>
+
+Specify a source directory to \(re-\)generate a build system for it in the
+current working directory. Specify an existing build directory to
+re-generate its build system.
+
+Run 'cmake --help' for more information.$
diff --git a/Tests/RunCMake/CommandLine/P_no-arg-result.txt b/Tests/RunCMake/CommandLine/P_no-arg-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/P_no-arg-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CommandLine/P_no-arg-stderr.txt b/Tests/RunCMake/CommandLine/P_no-arg-stderr.txt
new file mode 100644
index 0000000..8af3a53
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/P_no-arg-stderr.txt
@@ -0,0 +1 @@
+^CMake Error: No script specified for argument -P$
diff --git a/Tests/RunCMake/CommandLine/P_no-file-result.txt b/Tests/RunCMake/CommandLine/P_no-file-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/P_no-file-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CommandLine/P_no-file-stderr.txt b/Tests/RunCMake/CommandLine/P_no-file-stderr.txt
new file mode 100644
index 0000000..2e12399
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/P_no-file-stderr.txt
@@ -0,0 +1 @@
+^CMake Error: Error processing file: nosuchscriptfile.cmake$
diff --git a/Tests/RunCMake/CommandLine/RunCMakeTest.cmake b/Tests/RunCMake/CommandLine/RunCMakeTest.cmake
index f879ee6..f047baf 100644
--- a/Tests/RunCMake/CommandLine/RunCMakeTest.cmake
+++ b/Tests/RunCMake/CommandLine/RunCMakeTest.cmake
@@ -1,5 +1,22 @@
include(RunCMake)
+run_cmake_command(NoArgs ${CMAKE_COMMAND})
+run_cmake_command(C-no-arg ${CMAKE_COMMAND} -C)
+run_cmake_command(C-no-file ${CMAKE_COMMAND} -C nosuchcachefile.txt)
+run_cmake_command(cache-no-file ${CMAKE_COMMAND} nosuchsubdir/CMakeCache.txt)
+run_cmake_command(lists-no-file ${CMAKE_COMMAND} nosuchsubdir/CMakeLists.txt)
+run_cmake_command(D-no-arg ${CMAKE_COMMAND} -D)
+run_cmake_command(U-no-arg ${CMAKE_COMMAND} -U)
+run_cmake_command(E-no-arg ${CMAKE_COMMAND} -E)
+run_cmake_command(E_echo_append ${CMAKE_COMMAND} -E echo_append)
+run_cmake_command(E_rename-no-arg ${CMAKE_COMMAND} -E rename)
+run_cmake_command(E_touch_nocreate-no-arg ${CMAKE_COMMAND} -E touch_nocreate)
+
+run_cmake_command(G_no-arg ${CMAKE_COMMAND} -G)
+run_cmake_command(G_bad-arg ${CMAKE_COMMAND} -G NoSuchGenerator)
+run_cmake_command(P_no-arg ${CMAKE_COMMAND} -P)
+run_cmake_command(P_no-file ${CMAKE_COMMAND} -P nosuchscriptfile.cmake)
+
run_cmake_command(build-no-cache
${CMAKE_COMMAND} --build ${RunCMake_SOURCE_DIR})
run_cmake_command(build-no-generator
@@ -24,6 +41,9 @@ if(RunCMake_GENERATOR STREQUAL "Ninja")
endif()
if(UNIX)
+ run_cmake_command(E_create_symlink-no-arg
+ ${CMAKE_COMMAND} -E create_symlink
+ )
run_cmake_command(E_create_symlink-missing-dir
${CMAKE_COMMAND} -E create_symlink T missing-dir/L
)
@@ -70,6 +90,26 @@ set(RunCMake_TEST_OPTIONS
"-DFOO:STRING=-DBAR:BOOL=BAZ")
run_cmake(D_typed_nested_cache)
+set(RunCMake_TEST_OPTIONS -Wno-dev)
+run_cmake(Wno-dev)
+unset(RunCMake_TEST_OPTIONS)
+
+set(RunCMake_TEST_OPTIONS -Wno-dev -Wdev)
+run_cmake(Wdev)
+unset(RunCMake_TEST_OPTIONS)
+
+set(RunCMake_TEST_OPTIONS --debug-output)
+run_cmake(debug-output)
+unset(RunCMake_TEST_OPTIONS)
+
+set(RunCMake_TEST_OPTIONS --trace)
+run_cmake(trace)
+unset(RunCMake_TEST_OPTIONS)
+
+set(RunCMake_TEST_OPTIONS --debug-trycompile)
+run_cmake(debug-trycompile)
+unset(RunCMake_TEST_OPTIONS)
+
function(run_cmake_depends)
set(RunCMake_TEST_SOURCE_DIR "${RunCMake_SOURCE_DIR}/cmake_depends")
set(RunCMake_TEST_BINARY_DIR "${RunCMake_BINARY_DIR}/cmake_depends-build")
diff --git a/Tests/RunCMake/CommandLine/U-no-arg-result.txt b/Tests/RunCMake/CommandLine/U-no-arg-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/U-no-arg-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CommandLine/U-no-arg-stderr.txt b/Tests/RunCMake/CommandLine/U-no-arg-stderr.txt
new file mode 100644
index 0000000..c34ef94
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/U-no-arg-stderr.txt
@@ -0,0 +1,2 @@
+^CMake Error: -U must be followed with VAR.
+CMake Error: Problem processing arguments. Aborting.$
diff --git a/Tests/RunCMake/CommandLine/Wdev-stderr.txt b/Tests/RunCMake/CommandLine/Wdev-stderr.txt
new file mode 100644
index 0000000..f427303
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/Wdev-stderr.txt
@@ -0,0 +1,5 @@
+^CMake Warning \(dev\) at Wdev.cmake:1 \(message\):
+ Some Author Warning
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
+This warning is for project developers. Use -Wno-dev to suppress it.$
diff --git a/Tests/RunCMake/CommandLine/Wdev.cmake b/Tests/RunCMake/CommandLine/Wdev.cmake
new file mode 100644
index 0000000..0242086
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/Wdev.cmake
@@ -0,0 +1 @@
+message(AUTHOR_WARNING "Some Author Warning")
diff --git a/Tests/RunCMake/CommandLine/Wno-dev.cmake b/Tests/RunCMake/CommandLine/Wno-dev.cmake
new file mode 100644
index 0000000..0242086
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/Wno-dev.cmake
@@ -0,0 +1 @@
+message(AUTHOR_WARNING "Some Author Warning")
diff --git a/Tests/RunCMake/CommandLine/cache-no-file-result.txt b/Tests/RunCMake/CommandLine/cache-no-file-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/cache-no-file-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CommandLine/cache-no-file-stderr.txt b/Tests/RunCMake/CommandLine/cache-no-file-stderr.txt
new file mode 100644
index 0000000..da3a0c3
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/cache-no-file-stderr.txt
@@ -0,0 +1,2 @@
+^CMake Error: The source directory ".*/Tests/RunCMake/CommandLine/cache-no-file-build/nosuchsubdir" does not exist.
+Specify --help for usage, or press the help button on the CMake GUI.$
diff --git a/Tests/RunCMake/CommandLine/debug-output-stdout.txt b/Tests/RunCMake/CommandLine/debug-output-stdout.txt
new file mode 100644
index 0000000..96f2aae
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/debug-output-stdout.txt
@@ -0,0 +1 @@
+Running with debug output on.
diff --git a/Tests/RunCMake/CommandLine/debug-output.cmake b/Tests/RunCMake/CommandLine/debug-output.cmake
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/debug-output.cmake
diff --git a/Tests/RunCMake/CommandLine/debug-trycompile.cmake b/Tests/RunCMake/CommandLine/debug-trycompile.cmake
new file mode 100644
index 0000000..a3835a7
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/debug-trycompile.cmake
@@ -0,0 +1,5 @@
+enable_language(C)
+# Look for a source tree left by enable_language internal checks.
+if(NOT EXISTS ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/CMakeTmp/CMakeLists.txt)
+ message(FATAL_ERROR "--debug-trycompile should leave the source behind")
+endif()
diff --git a/Tests/RunCMake/CommandLine/lists-no-file-result.txt b/Tests/RunCMake/CommandLine/lists-no-file-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/lists-no-file-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CommandLine/lists-no-file-stderr.txt b/Tests/RunCMake/CommandLine/lists-no-file-stderr.txt
new file mode 100644
index 0000000..3465e89
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/lists-no-file-stderr.txt
@@ -0,0 +1,2 @@
+^CMake Error: The source directory ".*/Tests/RunCMake/CommandLine/lists-no-file-build/nosuchsubdir" does not exist.
+Specify --help for usage, or press the help button on the CMake GUI.$
diff --git a/Tests/RunCMake/CommandLine/trace-stderr.txt b/Tests/RunCMake/CommandLine/trace-stderr.txt
new file mode 100644
index 0000000..8e8ddfa
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/trace-stderr.txt
@@ -0,0 +1,2 @@
+^.*/Tests/RunCMake/CommandLine/CMakeLists.txt\(1\): cmake_minimum_required\(VERSION 3.0 \)
+.*/Tests/RunCMake/CommandLine/CMakeLists.txt\(2\): project\(\${RunCMake_TEST} NONE \)
diff --git a/Tests/RunCMake/CommandLine/trace.cmake b/Tests/RunCMake/CommandLine/trace.cmake
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/trace.cmake