summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
Diffstat (limited to 'Source')
-rw-r--r--Source/CPack/cmCPackGenerator.cxx2
-rw-r--r--Source/CPack/cmCPackGenerator.h7
-rw-r--r--Source/CPack/cmCPackNSISGenerator.cxx7
-rw-r--r--Source/CTest/cmCTestGenericHandler.cxx2
-rw-r--r--Source/CTest/cmCTestGenericHandler.h7
-rw-r--r--Source/CTest/cmCTestTestHandler.cxx3
-rw-r--r--Source/cmComputeLinkInformation.cxx12
-rw-r--r--Source/cmDocumentVariables.cxx2
-rw-r--r--Source/cmExtraCodeBlocksGenerator.cxx7
-rw-r--r--Source/cmFindPackageCommand.cxx16
-rw-r--r--Source/cmGlobalGenerator.cxx6
-rw-r--r--Source/cmGlobalGenerator.h5
-rw-r--r--Source/cmLocalVisualStudio7Generator.cxx26
-rw-r--r--Source/cmLocalVisualStudio7Generator.h2
-rw-r--r--Source/cmSetTargetPropertiesCommand.h4
-rw-r--r--Source/cmSiteNameCommand.cxx2
-rw-r--r--Source/cmSystemTools.cxx236
-rw-r--r--Source/cmSystemTools.h95
-rw-r--r--Source/cmTarget.cxx8
-rw-r--r--Source/cmTryRunCommand.cxx2
-rw-r--r--Source/cmVisualStudio10TargetGenerator.cxx19
-rw-r--r--Source/cmake.cxx9
-rw-r--r--Source/cmake.h3
-rw-r--r--Source/cmakemain.cxx8
-rw-r--r--Source/kwsys/kwsysDateStamp.cmake4
25 files changed, 302 insertions, 192 deletions
diff --git a/Source/CPack/cmCPackGenerator.cxx b/Source/CPack/cmCPackGenerator.cxx
index 7e5b26d..0e4acd5 100644
--- a/Source/CPack/cmCPackGenerator.cxx
+++ b/Source/CPack/cmCPackGenerator.cxx
@@ -33,7 +33,7 @@
//----------------------------------------------------------------------
cmCPackGenerator::cmCPackGenerator()
{
- this->GeneratorVerbose = false;
+ this->GeneratorVerbose = cmSystemTools::OUTPUT_NONE;
this->MakefileMap = 0;
this->Logger = 0;
this->componentPackageMethod = ONE_PACKAGE_PER_GROUP;
diff --git a/Source/CPack/cmCPackGenerator.h b/Source/CPack/cmCPackGenerator.h
index 05d95b8..52def9d 100644
--- a/Source/CPack/cmCPackGenerator.h
+++ b/Source/CPack/cmCPackGenerator.h
@@ -14,6 +14,7 @@
#define cmCPackGenerator_h
#include "cmObject.h"
+#include "cmSystemTools.h"
#include <map>
#include <vector>
@@ -57,7 +58,9 @@ public:
/**
* If verbose then more information is printed out
*/
- void SetVerbose(bool val) { this->GeneratorVerbose = val; }
+ void SetVerbose(bool val)
+ { this->GeneratorVerbose = val ?
+ cmSystemTools::OUTPUT_MERGE : cmSystemTools::OUTPUT_NONE; }
/**
* Do the actual whole package processing.
@@ -194,7 +197,7 @@ protected:
virtual cmCPackComponentGroup* GetComponentGroup(const char *projectName,
const char* name);
- bool GeneratorVerbose;
+ cmSystemTools::OutputOption GeneratorVerbose;
std::string Name;
std::string InstallPath;
diff --git a/Source/CPack/cmCPackNSISGenerator.cxx b/Source/CPack/cmCPackNSISGenerator.cxx
index e5fe575..2b94067 100644
--- a/Source/CPack/cmCPackNSISGenerator.cxx
+++ b/Source/CPack/cmCPackNSISGenerator.cxx
@@ -672,9 +672,6 @@ CreateComponentDescription(cmCPackComponent *component,
}
componentCode += " SetOutPath \"$INSTDIR\"\n";
- componentCode += " IntCmp $" + component->Name
- + "_was_installed ${SF_SELECTED} noinstall_" + component->Name + "\n";
-
// Create the actual installation commands
if (component->IsDownloaded)
{
@@ -786,7 +783,8 @@ CreateComponentDescription(cmCPackComponent *component,
std::string output;
int retVal = -1;
int res = cmSystemTools::RunSingleCommand(cmd.c_str(), &output, &retVal,
- dirName.c_str(), false, 0);
+ dirName.c_str(),
+ cmSystemTools::OUTPUT_NONE, 0);
if ( !res || retVal )
{
std::string tmpFile = this->GetOption("CPACK_TOPLEVEL_DIRECTORY");
@@ -824,7 +822,6 @@ CreateComponentDescription(cmCPackComponent *component,
componentCode += " File /r \"${INST_DIR}\\" +
component->Name + "\\*.*\"\n";
}
- componentCode += " noinstall_" + component->Name + ":\n";
componentCode += "SectionEnd\n";
// Macro used to remove the component
diff --git a/Source/CTest/cmCTestGenericHandler.cxx b/Source/CTest/cmCTestGenericHandler.cxx
index 8c3c22a..fd75e45 100644
--- a/Source/CTest/cmCTestGenericHandler.cxx
+++ b/Source/CTest/cmCTestGenericHandler.cxx
@@ -18,7 +18,7 @@
//----------------------------------------------------------------------
cmCTestGenericHandler::cmCTestGenericHandler()
{
- this->HandlerVerbose = false;
+ this->HandlerVerbose = cmSystemTools::OUTPUT_NONE;
this->CTest = 0;
this->SubmitIndex = 0;
this->AppendXML = false;
diff --git a/Source/CTest/cmCTestGenericHandler.h b/Source/CTest/cmCTestGenericHandler.h
index 7393145..18189ec 100644
--- a/Source/CTest/cmCTestGenericHandler.h
+++ b/Source/CTest/cmCTestGenericHandler.h
@@ -16,6 +16,7 @@
#include "cmObject.h"
#include "cmCTest.h"
+#include "cmSystemTools.h" //OutputOption
class cmMakefile;
class cmCTestCommand;
@@ -31,7 +32,9 @@ public:
/**
* If verbose then more informaiton is printed out
*/
- void SetVerbose(bool val) { this->HandlerVerbose = val; }
+ void SetVerbose(bool val)
+ { this->HandlerVerbose = val ?
+ cmSystemTools::OUTPUT_MERGE : cmSystemTools::OUTPUT_NONE; }
/**
* Populate internals from CTest custom scripts
@@ -91,7 +94,7 @@ protected:
bool StartLogFile(const char* name, cmGeneratedFileStream& xofs);
bool AppendXML;
- bool HandlerVerbose;
+ cmSystemTools::OutputOption HandlerVerbose;
cmCTest *CTest;
t_StringToString Options;
t_StringToString PersistentOptions;
diff --git a/Source/CTest/cmCTestTestHandler.cxx b/Source/CTest/cmCTestTestHandler.cxx
index e3b81df..b824e47 100644
--- a/Source/CTest/cmCTestTestHandler.cxx
+++ b/Source/CTest/cmCTestTestHandler.cxx
@@ -1301,7 +1301,8 @@ int cmCTestTestHandler::ExecuteCommands(std::vector<cmStdString>& vec)
int retVal = 0;
cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, "Run command: " << *it
<< std::endl);
- if ( !cmSystemTools::RunSingleCommand(it->c_str(), 0, &retVal, 0, true
+ if ( !cmSystemTools::RunSingleCommand(it->c_str(), 0, &retVal, 0,
+ cmSystemTools::OUTPUT_MERGE
/*this->Verbose*/) || retVal != 0 )
{
cmCTestLog(this->CTest, ERROR_MESSAGE, "Problem running command: "
diff --git a/Source/cmComputeLinkInformation.cxx b/Source/cmComputeLinkInformation.cxx
index e3c33a2..c87b64d 100644
--- a/Source/cmComputeLinkInformation.cxx
+++ b/Source/cmComputeLinkInformation.cxx
@@ -1603,6 +1603,18 @@ void cmComputeLinkInformation::LoadImplicitLinkInfo()
cmSystemTools::ExpandListArgument(implicitLinks, implicitDirVec);
}
+ // Append library architecture to all implicit platform directories
+ // and add them to the set
+ if(const char* libraryArch =
+ this->Makefile->GetDefinition("CMAKE_LIBRARY_ARCHITECTURE"))
+ {
+ for (std::vector<std::string>::const_iterator i = implicitDirVec.begin();
+ i != implicitDirVec.end(); ++i)
+ {
+ this->ImplicitLinkDirs.insert(*i + "/" + libraryArch);
+ }
+ }
+
// Get language-specific implicit directories.
std::string implicitDirVar = "CMAKE_";
implicitDirVar += this->LinkLanguage;
diff --git a/Source/cmDocumentVariables.cxx b/Source/cmDocumentVariables.cxx
index 4e75f9c..ebe2988 100644
--- a/Source/cmDocumentVariables.cxx
+++ b/Source/cmDocumentVariables.cxx
@@ -953,7 +953,7 @@ void cmDocumentVariables::DefineVariables(cmake* cm)
cm->DefineProperty
("WIN32", cmProperty::VARIABLE,
"True on windows systems, including win64.",
- "Set to true when the target system is Windows and on cygwin.",false,
+ "Set to true when the target system is Windows.",false,
"Variables That Describe the System");
cm->DefineProperty
diff --git a/Source/cmExtraCodeBlocksGenerator.cxx b/Source/cmExtraCodeBlocksGenerator.cxx
index 4f93067..28ea10a 100644
--- a/Source/cmExtraCodeBlocksGenerator.cxx
+++ b/Source/cmExtraCodeBlocksGenerator.cxx
@@ -266,10 +266,17 @@ void cmExtraCodeBlocksGenerator
}
// Convert
+ const char* cmakeRoot = mf->GetDefinition("CMAKE_ROOT");
for (std::vector<std::string>::const_iterator jt = listFiles.begin();
jt != listFiles.end();
++jt)
{
+ // don't put cmake's own files into the project (#12110):
+ if (jt->find(cmakeRoot) == 0)
+ {
+ continue;
+ }
+
const std::string &relative = cmSystemTools::RelativePath(
it->second[0]->GetMakefile()->GetHomeDirectory(),
jt->c_str());
diff --git a/Source/cmFindPackageCommand.cxx b/Source/cmFindPackageCommand.cxx
index 9d1c220..5aed5e2 100644
--- a/Source/cmFindPackageCommand.cxx
+++ b/Source/cmFindPackageCommand.cxx
@@ -1196,20 +1196,20 @@ void cmFindPackageCommand::AppendSuccessInformation()
if ((cmSystemTools::IsOn(result)) || (cmSystemTools::IsOn(upperResult)))
{
this->AppendToProperty("PACKAGES_FOUND");
- if (!this->Quiet)
- {
- this->AppendToProperty("ENABLED_FEATURES");
- }
}
else
{
this->AppendToProperty("PACKAGES_NOT_FOUND");
- if (!this->Quiet)
- {
- this->AppendToProperty("DISABLED_FEATURES");
- }
}
+ // Record whether the find was quiet or not, so this can be used
+ // e.g. in FeatureSummary.cmake
+ std::string quietInfoPropName = "_CMAKE_";
+ quietInfoPropName += this->Name;
+ quietInfoPropName += "_QUIET";
+ this->Makefile->GetCMakeInstance()->SetProperty(quietInfoPropName.c_str(),
+ this->Quiet ? "TRUE" : "FALSE");
+
// set a global property to record the required version of this package
std::string versionInfoPropName = "_CMAKE_";
versionInfoPropName += this->Name;
diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx
index 6c8938e..2eae01e 100644
--- a/Source/cmGlobalGenerator.cxx
+++ b/Source/cmGlobalGenerator.cxx
@@ -1136,7 +1136,7 @@ int cmGlobalGenerator::Build(
const char *config,
bool clean, bool fast,
double timeout,
- bool verbose,
+ cmSystemTools::OutputOption outputflag,
const char* extraOptions,
std::vector<std::string> const& nativeOptions)
{
@@ -1176,7 +1176,7 @@ int cmGlobalGenerator::Build(
}
if (!cmSystemTools::RunSingleCommand(cleanCommand.c_str(), outputPtr,
- &retVal, 0, verbose, timeout))
+ &retVal, 0, outputflag, timeout))
{
cmSystemTools::SetRunCommandHideConsole(hideconsole);
cmSystemTools::Error("Generator: execution of make clean failed.");
@@ -1217,7 +1217,7 @@ int cmGlobalGenerator::Build(
}
if (!cmSystemTools::RunSingleCommand(command, outputPtr,
- &retVal, 0, verbose, timeout))
+ &retVal, 0, outputflag, timeout))
{
cmSystemTools::SetRunCommandHideConsole(hideconsole);
cmSystemTools::Error
diff --git a/Source/cmGlobalGenerator.h b/Source/cmGlobalGenerator.h
index 5268731..b7b1bff 100644
--- a/Source/cmGlobalGenerator.h
+++ b/Source/cmGlobalGenerator.h
@@ -17,7 +17,7 @@
#include "cmTarget.h" // For cmTargets
#include "cmTargetDepend.h" // For cmTargetDependSet
-
+#include "cmSystemTools.h" // for cmSystemTools::OutputOption
class cmake;
class cmMakefile;
class cmLocalGenerator;
@@ -102,7 +102,8 @@ public:
std::string *output,
const char *makeProgram, const char *config,
bool clean, bool fast,
- double timeout, bool verbose=false,
+ double timeout,
+ cmSystemTools::OutputOption outputflag=cmSystemTools::OUTPUT_NONE,
const char* extraOptions = 0,
std::vector<std::string> const& nativeOptions =
std::vector<std::string>());
diff --git a/Source/cmLocalVisualStudio7Generator.cxx b/Source/cmLocalVisualStudio7Generator.cxx
index 7a62b9c..3e76f59 100644
--- a/Source/cmLocalVisualStudio7Generator.cxx
+++ b/Source/cmLocalVisualStudio7Generator.cxx
@@ -1279,7 +1279,7 @@ void cmLocalVisualStudio7Generator::WriteVCProjFile(std::ostream& fout,
fout << "\t</Files>\n";
// Write the VCProj file's footer.
- this->WriteVCProjFooter(fout);
+ this->WriteVCProjFooter(fout, target);
}
struct cmLVS7GFileConfig
@@ -1880,10 +1880,28 @@ cmLocalVisualStudio7Generator::WriteProjectStart(std::ostream& fout,
}
-void cmLocalVisualStudio7Generator::WriteVCProjFooter(std::ostream& fout)
+void cmLocalVisualStudio7Generator::WriteVCProjFooter(std::ostream& fout,
+ cmTarget &target)
{
- fout << "\t<Globals>\n"
- << "\t</Globals>\n"
+ fout << "\t<Globals>\n";
+
+ cmPropertyMap const& props = target.GetProperties();
+ for(cmPropertyMap::const_iterator i = props.begin(); i != props.end(); ++i)
+ {
+ if(i->first.find("VS_GLOBAL_") == 0)
+ {
+ std::string name = i->first.substr(10);
+ if(name != "")
+ {
+ fout << "\t\t<Global\n"
+ << "\t\t\tName=\"" << name << "\"\n"
+ << "\t\t\tValue=\"" << i->second.GetValue() << "\"\n"
+ << "\t\t/>\n";
+ }
+ }
+ }
+
+ fout << "\t</Globals>\n"
<< "</VisualStudioProject>\n";
}
diff --git a/Source/cmLocalVisualStudio7Generator.h b/Source/cmLocalVisualStudio7Generator.h
index 160e2d4..4fdbc58 100644
--- a/Source/cmLocalVisualStudio7Generator.h
+++ b/Source/cmLocalVisualStudio7Generator.h
@@ -84,7 +84,7 @@ private:
void WriteProjectFiles();
void WriteVCProjHeader(std::ostream& fout, const char *libName,
cmTarget &tgt, std::vector<cmSourceGroup> &sgs);
- void WriteVCProjFooter(std::ostream& fout);
+ void WriteVCProjFooter(std::ostream& fout, cmTarget &target);
void CreateSingleVCProj(const char *lname, cmTarget &tgt);
void WriteVCProjFile(std::ostream& fout, const char *libName,
cmTarget &tgt);
diff --git a/Source/cmSetTargetPropertiesCommand.h b/Source/cmSetTargetPropertiesCommand.h
index 9e39401..feead00 100644
--- a/Source/cmSetTargetPropertiesCommand.h
+++ b/Source/cmSetTargetPropertiesCommand.h
@@ -143,6 +143,10 @@ public:
"VS_SCC_PROJECTNAME, VS_SCC_LOCALPATH, VS_SCC_PROVIDER can be set "
"to add support for source control bindings in a Visual Studio "
"project file.\n"
+ "VS_GLOBAL_<variable> can be set to add a Visual Studio "
+ "project-specific global variable. "
+ "Qt integration works better if VS_GLOBAL_QtVersion is set to "
+ "the Qt version FindQt4.cmake found. For example, \"4.7.3\"\n"
"The PRE_INSTALL_SCRIPT and POST_INSTALL_SCRIPT properties are the "
"old way to specify CMake scripts to run before and after "
"installing a target. They are used only when the old "
diff --git a/Source/cmSiteNameCommand.cxx b/Source/cmSiteNameCommand.cxx
index 7b80c5c..04e357c 100644
--- a/Source/cmSiteNameCommand.cxx
+++ b/Source/cmSiteNameCommand.cxx
@@ -63,7 +63,7 @@ bool cmSiteNameCommand
{
std::string host;
cmSystemTools::RunSingleCommand(hostname_cmd.c_str(),
- &host, 0, 0, false);
+ &host, 0, 0, cmSystemTools::OUTPUT_NONE);
// got the hostname
if (host.length())
diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx
index dbb2226..03364bd 100644
--- a/Source/cmSystemTools.cxx
+++ b/Source/cmSystemTools.cxx
@@ -12,7 +12,7 @@
#if defined(_MSC_VER) && _MSC_VER < 1300
# define _WIN32_WINNT 0x0400 /* for wincrypt.h */
#endif
-#include "cmSystemTools.h"
+#include "cmSystemTools.h"
#include <ctype.h>
#include <errno.h>
#include <time.h>
@@ -126,7 +126,7 @@ const char* cmSystemTools::GetWindows9xComspecSubstitute()
return cmSystemTools::s_Windows9xComspecSubstitute.c_str();
}
-void (*cmSystemTools::s_ErrorCallback)(const char*, const char*,
+void (*cmSystemTools::s_ErrorCallback)(const char*, const char*,
bool&, void*);
void (*cmSystemTools::s_StdoutCallback)(const char*, int len, void*);
void* cmSystemTools::s_ErrorCallbackClientData = 0;
@@ -144,7 +144,7 @@ void cmSystemTools::ExpandRegistryValues(std::string& source, KeyWOW64 view)
// a close square-bracket. The ']' character must be the first in the
// list of characters inside the [^...] block of the expression.
cmsys::RegularExpression regEntry("\\[(HKEY[^]]*)\\]");
-
+
// check for black line or comment
while (regEntry.find(source))
{
@@ -237,7 +237,7 @@ void cmSystemTools::Stdout(const char* s)
{
if(s_StdoutCallback)
{
- (*s_StdoutCallback)(s, static_cast<int>(strlen(s)),
+ (*s_StdoutCallback)(s, static_cast<int>(strlen(s)),
s_StdoutCallbackClientData);
}
else
@@ -247,6 +247,12 @@ void cmSystemTools::Stdout(const char* s)
}
}
+void cmSystemTools::Stderr(const char* s, int length)
+{
+ std::cerr.write(s, length);
+ std::cerr.flush();
+}
+
void cmSystemTools::Stdout(const char* s, int length)
{
if(s_StdoutCallback)
@@ -268,7 +274,7 @@ void cmSystemTools::Message(const char* m1, const char *title)
}
if(s_ErrorCallback)
{
- (*s_ErrorCallback)(m1, title, s_DisableMessages,
+ (*s_ErrorCallback)(m1, title, s_DisableMessages,
s_ErrorCallbackClientData);
return;
}
@@ -276,7 +282,7 @@ void cmSystemTools::Message(const char* m1, const char *title)
{
std::cerr << m1 << std::endl << std::flush;
}
-
+
}
@@ -311,7 +317,7 @@ bool cmSystemTools::IsOn(const char* val)
return false;
}
std::basic_string<char> v = val;
-
+
for(std::basic_string<char>::iterator c = v.begin();
c != v.end(); c++)
{
@@ -344,13 +350,13 @@ bool cmSystemTools::IsOff(const char* val)
return true;
}
std::basic_string<char> v = val;
-
+
for(std::basic_string<char>::iterator c = v.begin();
c != v.end(); c++)
{
*c = static_cast<char>(toupper(*c));
}
- return (v == "OFF" || v == "0" || v == "NO" || v == "FALSE" ||
+ return (v == "OFF" || v == "0" || v == "NO" || v == "FALSE" ||
v == "N" || cmSystemTools::IsNOTFOUND(v.c_str()) || v == "IGNORE");
}
@@ -569,15 +575,15 @@ std::vector<cmStdString> cmSystemTools::ParseArguments(const char* command)
args.push_back(arg);
}
}
-
+
return args;
}
bool cmSystemTools::RunSingleCommand(std::vector<cmStdString>const& command,
std::string* output ,
- int* retVal , const char* dir ,
- bool verbose ,
+ int* retVal , const char* dir ,
+ OutputOption outputflag ,
double timeout )
{
std::vector<const char*> argv;
@@ -599,46 +605,62 @@ bool cmSystemTools::RunSingleCommand(std::vector<cmStdString>const& command,
{
cmsysProcess_SetOption(cp, cmsysProcess_Option_HideWindow, 1);
}
+
cmsysProcess_SetTimeout(cp, timeout);
cmsysProcess_Execute(cp);
-
+
std::vector<char> tempOutput;
char* data;
int length;
- if ( output || verbose )
- {
- while(cmsysProcess_WaitForData(cp, &data, &length, 0))
+ int pipe;
+ if ( output || outputflag != OUTPUT_NONE )
{
- if(output || verbose)
+ while((pipe = cmsysProcess_WaitForData(cp, &data, &length, 0)) > 0)
{
- // Translate NULL characters in the output into valid text.
- // Visual Studio 7 puts these characters in the output of its
- // build process.
- for(int i=0; i < length; ++i)
+ if(output || outputflag != OUTPUT_NONE)
{
- if(data[i] == '\0')
+ // Translate NULL characters in the output into valid text.
+ // Visual Studio 7 puts these characters in the output of its
+ // build process.
+ for(int i=0; i < length; ++i)
{
- data[i] = ' ';
+ if(data[i] == '\0')
+ {
+ data[i] = ' ';
+ }
+ }
+ }
+ if ( output )
+ {
+ tempOutput.insert(tempOutput.end(), data, data+length);
+ }
+ if(outputflag != OUTPUT_NONE)
+ {
+ if(outputflag == OUTPUT_MERGE)
+ {
+ cmSystemTools::Stdout(data, length);
+ }
+ else
+ {
+ if(pipe == cmsysProcess_Pipe_STDERR)
+ {
+ cmSystemTools::Stderr(data, length);
+ }
+ else if(pipe == cmsysProcess_Pipe_STDOUT)
+ {
+ cmSystemTools::Stdout(data, length);
+ }
}
}
- }
- if ( output )
- {
- tempOutput.insert(tempOutput.end(), data, data+length);
- }
- if(verbose)
- {
- cmSystemTools::Stdout(data, length);
}
}
- }
-
+
cmsysProcess_WaitForExit(cp, 0);
if ( output && tempOutput.begin() != tempOutput.end())
{
output->append(&*tempOutput.begin(), tempOutput.size());
}
-
+
bool result = true;
if(cmsysProcess_GetState(cp) == cmsysProcess_State_Exited)
{
@@ -657,7 +679,7 @@ bool cmSystemTools::RunSingleCommand(std::vector<cmStdString>const& command,
else if(cmsysProcess_GetState(cp) == cmsysProcess_State_Exception)
{
const char* exception_str = cmsysProcess_GetExceptionString(cp);
- if ( verbose )
+ if ( outputflag != OUTPUT_NONE )
{
std::cerr << exception_str << std::endl;
}
@@ -670,7 +692,7 @@ bool cmSystemTools::RunSingleCommand(std::vector<cmStdString>const& command,
else if(cmsysProcess_GetState(cp) == cmsysProcess_State_Error)
{
const char* error_str = cmsysProcess_GetErrorString(cp);
- if ( verbose )
+ if ( outputflag != OUTPUT_NONE )
{
std::cerr << error_str << std::endl;
}
@@ -683,7 +705,7 @@ bool cmSystemTools::RunSingleCommand(std::vector<cmStdString>const& command,
else if(cmsysProcess_GetState(cp) == cmsysProcess_State_Expired)
{
const char* error_str = "Process terminated due to timeout\n";
- if ( verbose )
+ if ( outputflag != OUTPUT_NONE )
{
std::cerr << error_str << std::endl;
}
@@ -693,22 +715,22 @@ bool cmSystemTools::RunSingleCommand(std::vector<cmStdString>const& command,
}
result = false;
}
-
+
cmsysProcess_Delete(cp);
return result;
}
bool cmSystemTools::RunSingleCommand(
- const char* command,
+ const char* command,
std::string* output,
- int *retVal,
+ int *retVal,
const char* dir,
- bool verbose,
+ OutputOption outputflag,
double timeout)
{
if(s_DisableRunCommandOutput)
{
- verbose = false;
+ outputflag = OUTPUT_NONE;
}
std::vector<cmStdString> args = cmSystemTools::ParseArguments(command);
@@ -717,17 +739,17 @@ bool cmSystemTools::RunSingleCommand(
{
return false;
}
- return cmSystemTools::RunSingleCommand(args, output,retVal,
- dir, verbose, timeout);
+ return cmSystemTools::RunSingleCommand(args, output,retVal,
+ dir, outputflag, timeout);
}
-bool cmSystemTools::RunCommand(const char* command,
+bool cmSystemTools::RunCommand(const char* command,
std::string& output,
const char* dir,
bool verbose,
int timeout)
{
int dummy;
- return cmSystemTools::RunCommand(command, output, dummy,
+ return cmSystemTools::RunCommand(command, output, dummy,
dir, verbose, timeout);
}
@@ -742,11 +764,11 @@ bool RunCommandViaWin32(const char* command,
int timeout)
{
#if defined(__BORLANDC__)
- return
+ return
cmWin32ProcessExecution::
- BorlandRunCommand(command, dir, output,
- retVal,
- verbose, timeout,
+ BorlandRunCommand(command, dir, output,
+ retVal,
+ verbose, timeout,
cmSystemTools::GetRunCommandHideConsole());
#else // Visual studio
::SetLastError(ERROR_SUCCESS);
@@ -760,7 +782,7 @@ bool RunCommandViaWin32(const char* command,
{
resProc.SetHideWindows(true);
}
-
+
if ( cmSystemTools::GetWindows9xComspecSubstitute() )
{
resProc.SetConsoleSpawn(cmSystemTools::GetWindows9xComspecSubstitute() );
@@ -787,7 +809,7 @@ bool RunCommandViaSystem(const char* command,
std::string& output,
int& retVal,
bool verbose)
-{
+{
std::cout << "@@ " << command << std::endl;
std::string commandInDir;
@@ -987,9 +1009,9 @@ bool RunCommandViaPopen(const char* command,
// run a command unix uses popen (easy)
// windows uses system and ShortPath
-bool cmSystemTools::RunCommand(const char* command,
+bool cmSystemTools::RunCommand(const char* command,
std::string& output,
- int &retVal,
+ int &retVal,
const char* dir,
bool verbose,
int timeout)
@@ -998,7 +1020,7 @@ bool cmSystemTools::RunCommand(const char* command,
{
verbose = false;
}
-
+
#if defined(WIN32) && !defined(__CYGWIN__)
// if the command does not start with a quote, then
// try to find the program, and if the program can not be
@@ -1017,9 +1039,9 @@ bool cmSystemTools::RunCommand(const char* command,
{
break;
}
- }
+ }
}
- // if there are more than two double quotes use
+ // if there are more than two double quotes use
// GetShortPathName, the cmd.exe program in windows which
// is used by system fails to execute if there are more than
// one set of quotes in the arguments
@@ -1043,16 +1065,16 @@ bool cmSystemTools::RunCommand(const char* command,
shortCmd += " ";
shortCmd += args;
- //return RunCommandViaSystem(shortCmd.c_str(), dir,
+ //return RunCommandViaSystem(shortCmd.c_str(), dir,
// output, retVal, verbose);
- //return WindowsRunCommand(shortCmd.c_str(), dir,
+ //return WindowsRunCommand(shortCmd.c_str(), dir,
//output, retVal, verbose);
- return RunCommandViaWin32(shortCmd.c_str(), dir,
+ return RunCommandViaWin32(shortCmd.c_str(), dir,
output, retVal, verbose, timeout);
}
else
{
- cmSystemTools::Error("Could not parse command line with quotes ",
+ cmSystemTools::Error("Could not parse command line with quotes ",
command);
}
}
@@ -1116,7 +1138,7 @@ bool cmSystemTools::cmCopyFile(const char* source, const char* destination)
return Superclass::CopyFileAlways(source, destination);
}
-bool cmSystemTools::CopyFileIfDifferent(const char* source,
+bool cmSystemTools::CopyFileIfDifferent(const char* source,
const char* destination)
{
return Superclass::CopyFileIfDifferent(source, destination);
@@ -1247,7 +1269,7 @@ void cmSystemTools::Glob(const char *directory, const char *regexp,
{
cmsys::Directory d;
cmsys::RegularExpression reg(regexp);
-
+
if (d.Load(directory))
{
size_t numf;
@@ -1300,7 +1322,7 @@ void cmSystemTools::GlobDirs(const char *fullPath,
}
-void cmSystemTools::ExpandList(std::vector<std::string> const& arguments,
+void cmSystemTools::ExpandList(std::vector<std::string> const& arguments,
std::vector<std::string>& newargs)
{
std::vector<std::string>::const_iterator i;
@@ -1399,8 +1421,8 @@ void cmSystemTools::ExpandListArgument(const std::string& arg,
}
}
-bool cmSystemTools::SimpleGlob(const cmStdString& glob,
- std::vector<cmStdString>& files,
+bool cmSystemTools::SimpleGlob(const cmStdString& glob,
+ std::vector<cmStdString>& files,
int type /* = 0 */)
{
files.clear();
@@ -1440,8 +1462,8 @@ bool cmSystemTools::SimpleGlob(const cmStdString& glob,
{
continue;
}
- if ( sfname.size() >= ppath.size() &&
- sfname.substr(0, ppath.size()) ==
+ if ( sfname.size() >= ppath.size() &&
+ sfname.substr(0, ppath.size()) ==
ppath )
{
files.push_back(fname);
@@ -1461,10 +1483,10 @@ cmSystemTools::FileFormat cmSystemTools::GetFileFormat(const char* cext)
}
//std::string ext = cmSystemTools::LowerCase(cext);
std::string ext = cext;
- if ( ext == "c" || ext == ".c" ||
- ext == "m" || ext == ".m"
+ if ( ext == "c" || ext == ".c" ||
+ ext == "m" || ext == ".m"
) { return cmSystemTools::C_FILE_FORMAT; }
- if (
+ if (
ext == "C" || ext == ".C" ||
ext == "M" || ext == ".M" ||
ext == "c++" || ext == ".c++" ||
@@ -1473,22 +1495,22 @@ cmSystemTools::FileFormat cmSystemTools::GetFileFormat(const char* cext)
ext == "cxx" || ext == ".cxx" ||
ext == "mm" || ext == ".mm"
) { return cmSystemTools::CXX_FILE_FORMAT; }
- if (
+ if (
ext == "f" || ext == ".f" ||
ext == "F" || ext == ".F" ||
ext == "f77" || ext == ".f77" ||
ext == "f90" || ext == ".f90" ||
ext == "for" || ext == ".for" ||
- ext == "f95" || ext == ".f95"
+ ext == "f95" || ext == ".f95"
) { return cmSystemTools::FORTRAN_FILE_FORMAT; }
if ( ext == "java" || ext == ".java" )
{ return cmSystemTools::JAVA_FILE_FORMAT; }
- if (
- ext == "H" || ext == ".H" ||
- ext == "h" || ext == ".h" ||
+ if (
+ ext == "H" || ext == ".H" ||
+ ext == "h" || ext == ".h" ||
ext == "h++" || ext == ".h++" ||
- ext == "hm" || ext == ".hm" ||
- ext == "hpp" || ext == ".hpp" ||
+ ext == "hm" || ext == ".hm" ||
+ ext == "hpp" || ext == ".hpp" ||
ext == "hxx" || ext == ".hxx" ||
ext == "in" || ext == ".in" ||
ext == "txx" || ext == ".txx"
@@ -1501,18 +1523,18 @@ cmSystemTools::FileFormat cmSystemTools::GetFileFormat(const char* cext)
ext == "a" || ext == ".a")
{ return cmSystemTools::STATIC_LIBRARY_FILE_FORMAT; }
if ( ext == "o" || ext == ".o" ||
- ext == "obj" || ext == ".obj")
+ ext == "obj" || ext == ".obj")
{ return cmSystemTools::OBJECT_FILE_FORMAT; }
#ifdef __APPLE__
- if ( ext == "dylib" || ext == ".dylib" )
+ if ( ext == "dylib" || ext == ".dylib" )
{ return cmSystemTools::SHARED_LIBRARY_FILE_FORMAT; }
- if ( ext == "so" || ext == ".so" ||
- ext == "bundle" || ext == ".bundle" )
- { return cmSystemTools::MODULE_FILE_FORMAT; }
+ if ( ext == "so" || ext == ".so" ||
+ ext == "bundle" || ext == ".bundle" )
+ { return cmSystemTools::MODULE_FILE_FORMAT; }
#else // __APPLE__
- if ( ext == "so" || ext == ".so" ||
- ext == "sl" || ext == ".sl" ||
- ext == "dll" || ext == ".dll" )
+ if ( ext == "so" || ext == ".so" ||
+ ext == "sl" || ext == ".sl" ||
+ ext == "dll" || ext == ".dll" )
{ return cmSystemTools::SHARED_LIBRARY_FILE_FORMAT; }
#endif // __APPLE__
return cmSystemTools::UNKNOWN_FILE_FORMAT;
@@ -1708,7 +1730,7 @@ bool cmSystemTools::IsPathToFramework(const char* path)
return false;
}
-bool cmSystemTools::CreateTar(const char* outFileName,
+bool cmSystemTools::CreateTar(const char* outFileName,
const std::vector<cmStdString>& files,
bool gzip, bool bzip2, bool verbose)
{
@@ -1773,7 +1795,7 @@ namespace{
static time_t now;
size_t u_width = 6;
size_t gs_width = 13;
-
+
/*
* We avoid collecting the entire list in memory at once by
* listing things as we see them. However, that also means we can't
@@ -1788,7 +1810,7 @@ namespace{
fprintf(out, "%s %d ",
archive_entry_strmode(entry),
archive_entry_nlink(entry));
-
+
/* Use uname if it's present, else uid. */
p = archive_entry_uname(entry);
if ((p == NULL) || (*p == '\0'))
@@ -1809,7 +1831,7 @@ namespace{
{
fprintf(out, "%s", p);
w = strlen(p);
- }
+ }
else
{
sprintf(tmp, "%lu",
@@ -1817,20 +1839,20 @@ namespace{
w = strlen(tmp);
fprintf(out, "%s", tmp);
}
-
+
/*
* Print device number or file size, right-aligned so as to make
* total width of group and devnum/filesize fields be gs_width.
* If gs_width is too small, grow it.
*/
if (archive_entry_filetype(entry) == AE_IFCHR
- || archive_entry_filetype(entry) == AE_IFBLK)
+ || archive_entry_filetype(entry) == AE_IFBLK)
{
sprintf(tmp, "%lu,%lu",
(unsigned long)archive_entry_rdevmajor(entry),
(unsigned long)archive_entry_rdevminor(entry));
}
- else
+ else
{
/*
* Note the use of platform-dependent macros to format
@@ -1851,7 +1873,7 @@ namespace{
#define HALF_YEAR (time_t)365 * 86400 / 2
#if defined(_WIN32) && !defined(__CYGWIN__)
/* Windows' strftime function does not support %e format. */
-#define DAY_FMT "%d"
+#define DAY_FMT "%d"
#else
#define DAY_FMT "%e" /* Day number without leading zeros */
#endif
@@ -1881,15 +1903,15 @@ namespace{
#ifdef __BORLANDC__
# pragma warn -8066 /* unreachable code */
#endif
-
+
long copy_data(struct archive *ar, struct archive *aw)
{
long r;
const void *buff;
size_t size;
off_t offset;
-
- for (;;)
+
+ for (;;)
{
r = archive_read_data_block(ar, &buff, &size, &offset);
if (r == ARCHIVE_EOF)
@@ -1901,7 +1923,7 @@ long copy_data(struct archive *ar, struct archive *aw)
return (r);
}
r = archive_write_data_block(aw, buff, size, offset);
- if (r != ARCHIVE_OK)
+ if (r != ARCHIVE_OK)
{
cmSystemTools::Message("archive_write_data_block()",
archive_error_string(aw));
@@ -1911,7 +1933,7 @@ long copy_data(struct archive *ar, struct archive *aw)
return r;
}
-bool extract_tar(const char* outFileName, bool verbose,
+bool extract_tar(const char* outFileName, bool verbose,
bool extract)
{
struct archive* a = archive_read_new();
@@ -1921,12 +1943,12 @@ bool extract_tar(const char* outFileName, bool verbose,
struct archive_entry *entry;
int r = archive_read_open_file(a, outFileName, 10240);
if(r)
- {
+ {
cmSystemTools::Error("Problem with archive_read_open_file(): ",
archive_error_string(a));
return false;
}
- for (;;)
+ for (;;)
{
r = archive_read_next_header(a, &entry);
if (r == ARCHIVE_EOF)
@@ -1969,7 +1991,7 @@ bool extract_tar(const char* outFileName, bool verbose,
cmSystemTools::Error("Current file:",
archive_entry_pathname(entry));
}
- else
+ else
{
copy_data(a, ext);
r = archive_write_finish_entry(ext);
@@ -1991,9 +2013,9 @@ bool extract_tar(const char* outFileName, bool verbose,
}
}
-#endif
+#endif
-bool cmSystemTools::ExtractTar(const char* outFileName,
+bool cmSystemTools::ExtractTar(const char* outFileName,
bool , bool verbose)
{
#if defined(CMAKE_BUILD_WITH_CMAKE)
@@ -2005,7 +2027,7 @@ bool cmSystemTools::ExtractTar(const char* outFileName,
#endif
}
-bool cmSystemTools::ListTar(const char* outFileName,
+bool cmSystemTools::ListTar(const char* outFileName,
bool ,
bool verbose)
{
@@ -2121,8 +2143,8 @@ int cmSystemTools::WaitForLine(cmsysProcess* process, std::string& line,
}
void cmSystemTools::DoNotInheritStdPipes()
-{
-#ifdef _WIN32
+{
+#ifdef _WIN32
// Check to see if we are attached to a console
// if so, then do not stop the inherited pipes
// or stdout and stderr will not show up in dos
diff --git a/Source/cmSystemTools.h b/Source/cmSystemTools.h
index ce49959..641c89f 100644
--- a/Source/cmSystemTools.h
+++ b/Source/cmSystemTools.h
@@ -29,9 +29,9 @@ class cmSystemTools: public cmsys::SystemTools
{
public:
typedef cmsys::SystemTools Superclass;
-
+
/** Expand out any arguements in the vector that have ; separated
- * strings into multiple arguements. A new vector is created
+ * strings into multiple arguements. A new vector is created
* containing the expanded versions of all arguments in argsIn.
*/
static void ExpandList(std::vector<std::string> const& argsIn,
@@ -52,7 +52,7 @@ public:
typedef void (*ErrorCallback)(const char*, const char*, bool&, void*);
/**
* Set the function used by GUI's to display error messages
- * Function gets passed: message as a const char*,
+ * Function gets passed: message as a const char*,
* title as a const char*, and a reference to bool that when
* set to false, will disable furthur messages (cancel).
*/
@@ -75,10 +75,13 @@ public:
typedef void (*StdoutCallback)(const char*, int length, void*);
static void SetStdoutCallback(StdoutCallback, void* clientData=0);
+ ///! Send a string to stderr. Stdout callbacks will not be invoced.
+ static void Stderr(const char* s, int length);
+
///! Return true if there was an error at any point.
- static bool GetErrorOccuredFlag()
+ static bool GetErrorOccuredFlag()
{
- return cmSystemTools::s_ErrorOccured ||
+ return cmSystemTools::s_ErrorOccured ||
cmSystemTools::s_FatalErrorOccured;
}
///! If this is set to true, cmake stops processing commands.
@@ -91,7 +94,7 @@ public:
cmSystemTools::s_ErrorOccured = true;
}
///! Return true if there was an error at any point.
- static bool GetFatalErrorOccured()
+ static bool GetFatalErrorOccured()
{
return cmSystemTools::s_FatalErrorOccured;
}
@@ -102,25 +105,25 @@ public:
cmSystemTools::s_FatalErrorOccured = false;
cmSystemTools::s_ErrorOccured = false;
}
-
+
/**
* Does a string indicates that CMake/CPack/CTest internally
* forced this value. This is not the same as On, but this
* may be considered as "internally switched on".
*/
static bool IsInternallyOn(const char* val);
- /**
+ /**
* does a string indicate a true or on value ? This is not the same
- * as ifdef.
- */
+ * as ifdef.
+ */
static bool IsOn(const char* val);
-
- /**
+
+ /**
* does a string indicate a false or off value ? Note that this is
* not the same as !IsOn(...) because there are a number of
* ambiguous values such as "/usr/local/bin" a path will result in
* IsON and IsOff both returning false. Note that the special path
- * NOTFOUND, *-NOTFOUND or IGNORE will cause IsOff to return true.
+ * NOTFOUND, *-NOTFOUND or IGNORE will cause IsOff to return true.
*/
static bool IsOff(const char* val);
@@ -128,7 +131,7 @@ public:
static bool IsNOTFOUND(const char* value);
///! Return true if the path is a framework
static bool IsPathToFramework(const char* value);
-
+
static bool DoesFileExistWithExtensions(
const char *name,
const std::vector<std::string>& sourceExts);
@@ -154,13 +157,13 @@ public:
* want to find. 0 means all files, -1 means directories, 1 means
* files only. This method returns true if search was succesfull.
*/
- static bool SimpleGlob(const cmStdString& glob,
- std::vector<cmStdString>& files,
+ static bool SimpleGlob(const cmStdString& glob,
+ std::vector<cmStdString>& files,
int type = 0);
-
+
///! Copy a file.
static bool cmCopyFile(const char* source, const char* destination);
- static bool CopyFileIfDifferent(const char* source,
+ static bool CopyFileIfDifferent(const char* source,
const char* destination);
/** Rename a file or directory within a single disk volume (atomic
@@ -184,45 +187,53 @@ public:
* If timeout is specified, the command will be terminated after
* timeout expires.
*/
- static bool RunCommand(const char* command, std::string& output,
+ static bool RunCommand(const char* command, std::string& output,
const char* directory = 0,
bool verbose = true, int timeout = 0);
static bool RunCommand(const char* command, std::string& output,
- int &retVal, const char* directory = 0,
- bool verbose = true, int timeout = 0);
+ int &retVal, const char* directory = 0,
+ bool verbose = true, int timeout = 0);
/**
- * Run a single executable command and put the stdout and stderr
- * in output.
+ * Run a single executable command
*
- * If verbose is false, no user-viewable output from the program
- * being run will be generated.
+ * Output is controlled with outputflag. If outputflag is OUTPUT_NONE, no
+ * user-viewable output from the program being run will be generated.
+ * OUTPUT_MERGE is the legacy behaviour where stdout and stderr are merged
+ * into stdout. OUTPUT_NORMAL passes through the output to stdout/stderr as
+ * it was received.
*
* If timeout is specified, the command will be terminated after
* timeout expires. Timeout is specified in seconds.
*
* Argument retVal should be a pointer to the location where the
- * exit code will be stored. If the retVal is not specified and
- * the program exits with a code other than 0, then the this
+ * exit code will be stored. If the retVal is not specified and
+ * the program exits with a code other than 0, then the this
* function will return false.
*
* If the command has spaces in the path the caller MUST call
* cmSystemTools::ConvertToRunCommandPath on the command before passing
* it into this function or it will not work. The command must be correctly
- * escaped for this to with spaces.
+ * escaped for this to with spaces.
*/
+ enum OutputOption
+ {
+ OUTPUT_NONE = 0,
+ OUTPUT_MERGE,
+ OUTPUT_NORMAL
+ };
static bool RunSingleCommand(const char* command, std::string* output = 0,
- int* retVal = 0, const char* dir = 0,
- bool verbose = true,
+ int* retVal = 0, const char* dir = 0,
+ OutputOption outputflag = OUTPUT_MERGE,
double timeout = 0.0);
- /**
+ /**
* In this version of RunSingleCommand, command[0] should be
* the command to run, and each argument to the command should
* be in comand[1]...command[command.size()]
*/
static bool RunSingleCommand(std::vector<cmStdString> const& command,
std::string* output = 0,
- int* retVal = 0, const char* dir = 0,
- bool verbose = true,
+ int* retVal = 0, const char* dir = 0,
+ OutputOption outputflag = OUTPUT_MERGE,
double timeout = 0.0);
/**
@@ -295,7 +306,7 @@ public:
static const char* GetWindows9xComspecSubstitute();
/** Windows if this is true, the CreateProcess in RunCommand will
- * not show new consol windows when running programs.
+ * not show new consol windows when running programs.
*/
static void SetRunCommandHideConsole(bool v){s_RunCommandHideConsole = v;}
static bool GetRunCommandHideConsole(){ return s_RunCommandHideConsole;}
@@ -303,16 +314,16 @@ public:
* result of strerror(errno)
*/
static void ReportLastSystemError(const char* m);
-
+
/** a general output handler for cmsysProcess */
static int WaitForLine(cmsysProcess* process, std::string& line,
double timeout,
std::vector<char>& out,
std::vector<char>& err);
-
+
/** Split a string on its newlines into multiple lines. Returns
false only if the last line stored had no newline. */
- static bool Split(const char* s, std::vector<cmStdString>& l);
+ static bool Split(const char* s, std::vector<cmStdString>& l);
static void SetForceUnixPaths(bool v)
{
s_ForceUnixPaths = v;
@@ -327,14 +338,14 @@ public:
static void ConvertToOutputSlashes(std::string& path);
// ConvertToRunCommandPath does not use s_ForceUnixPaths and should
- // be used when RunCommand is called from cmake, because the
+ // be used when RunCommand is called from cmake, because the
// running cmake needs paths to be in its format
static std::string ConvertToRunCommandPath(const char* path);
//! Check if the first string ends with the second one.
static bool StringEndsWith(const char* str1, const char* str2);
-
- /** compute the relative path from local to remote. local must
- be a directory. remote can be a file or a directory.
+
+ /** compute the relative path from local to remote. local must
+ be a directory. remote can be a file or a directory.
Both remote and local must be full paths. Basically, if
you are in directory local and you want to access the file in remote
what is the relative path to do that. For example:
@@ -385,7 +396,7 @@ public:
static bool CreateTar(const char* outFileName,
const std::vector<cmStdString>& files, bool gzip,
bool bzip2, bool verbose);
- static bool ExtractTar(const char* inFileName, bool gzip,
+ static bool ExtractTar(const char* inFileName, bool gzip,
bool verbose);
// This should be called first thing in main
// it will keep child processes from inheriting the
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index e10ba4a..17a26cc 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -960,6 +960,14 @@ void cmTarget::DefineProperties(cmake *cm)
"Visual Studio Source Code Control Project.",
"Can be set to change the visual studio source code control "
"project name property.");
+ cm->DefineProperty
+ ("VS_GLOBAL_<variable>", cmProperty::TARGET,
+ "Visual Studio project-specific global variable.",
+ "Tell the Visual Studio generator to set the global variable "
+ "'<variable>' to a given value in the generated Visual Studio "
+ "project. Ignored on other generators. Qt integration works "
+ "better if VS_GLOBAL_QtVersion is set to the version "
+ "FindQt4.cmake found. For example, \"4.7.3\"");
#if 0
cm->DefineProperty
diff --git a/Source/cmTryRunCommand.cxx b/Source/cmTryRunCommand.cxx
index 4d31a14..c9c4ed5 100644
--- a/Source/cmTryRunCommand.cxx
+++ b/Source/cmTryRunCommand.cxx
@@ -194,7 +194,7 @@ void cmTryRunCommand::RunExecutable(const std::string& runArgs,
int timeout = 0;
bool worked = cmSystemTools::RunSingleCommand(finalCommand.c_str(),
out, &retVal,
- 0, false, timeout);
+ 0, cmSystemTools::OUTPUT_NONE, timeout);
// set the run var
char retChar[1000];
if (worked)
diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx
index d710405..ac4296c 100644
--- a/Source/cmVisualStudio10TargetGenerator.cxx
+++ b/Source/cmVisualStudio10TargetGenerator.cxx
@@ -178,8 +178,23 @@ void cmVisualStudio10TargetGenerator::Generate()
this->WriteString("<ProjectGUID>", 2);
(*this->BuildFileStream) << "{" << this->GUID << "}</ProjectGUID>\n";
- this->WriteString("<SccProjectName />\n", 2);
- this->WriteString("<SccLocalPath />\n", 2);
+ const char* vsProjectName = this->Target->GetProperty("VS_SCC_PROJECTNAME");
+ const char* vsLocalPath = this->Target->GetProperty("VS_SCC_LOCALPATH");
+ const char* vsProvider = this->Target->GetProperty("VS_SCC_PROVIDER");
+
+ if ( vsProjectName && vsLocalPath && vsProvider)
+ {
+ this->WriteString("<SccProjectName>", 2);
+ (*this->BuildFileStream) << cmVS10EscapeXML(vsProjectName) <<
+ "</SccProjectName>\n";
+ this->WriteString("<SccLocalPath>", 2);
+ (*this->BuildFileStream) << cmVS10EscapeXML(vsLocalPath) <<
+ "</SccLocalPath>\n";
+ this->WriteString("<SccProvider>", 2);
+ (*this->BuildFileStream) << cmVS10EscapeXML(vsProvider) <<
+ "</SccProvider>\n";
+ }
+
this->WriteString("<Keyword>Win32Proj</Keyword>\n", 2);
this->WriteString("<Platform>", 2);
(*this->BuildFileStream) << this->Platform << "</Platform>\n";
diff --git a/Source/cmake.cxx b/Source/cmake.cxx
index ec87ab6..51cc9d4 100644
--- a/Source/cmake.cxx
+++ b/Source/cmake.cxx
@@ -1299,7 +1299,7 @@ int cmake::ExecuteCMakeCommand(std::vector<std::string>& args)
int retval = 0;
int timeout = 0;
if ( cmSystemTools::RunSingleCommand(command.c_str(), 0, &retval,
- directory.c_str(), true, timeout) )
+ directory.c_str(), cmSystemTools::OUTPUT_MERGE, timeout) )
{
return retval;
}
@@ -3984,7 +3984,7 @@ bool cmake::RunCommand(const char* comment,
// use rc command to create .res file
cmSystemTools::RunSingleCommand(command,
&output,
- &retCode, 0, false);
+ &retCode, 0, cmSystemTools::OUTPUT_NONE);
// always print the output of the command, unless
// it is the dumb rc command banner, but if the command
// returned an error code then print the output anyway as
@@ -4302,7 +4302,8 @@ int cmake::Build(const std::string& dir,
const std::string& target,
const std::string& config,
const std::vector<std::string>& nativeOptions,
- bool clean)
+ bool clean,
+ cmSystemTools::OutputOption outputflag)
{
if(!cmSystemTools::FileIsDirectory(dir.c_str()))
{
@@ -4344,7 +4345,7 @@ int cmake::Build(const std::string& dir,
projName.c_str(), target.c_str(),
&output,
makeProgram.c_str(),
- config.c_str(), clean, false, 0, true,
+ config.c_str(), clean, false, 0, outputflag,
0, nativeOptions);
}
diff --git a/Source/cmake.h b/Source/cmake.h
index b791b7c..f2a2ae3 100644
--- a/Source/cmake.h
+++ b/Source/cmake.h
@@ -364,7 +364,8 @@ class cmake
const std::string& target,
const std::string& config,
const std::vector<std::string>& nativeOptions,
- bool clean);
+ bool clean,
+ cmSystemTools::OutputOption outputflag);
void UnwatchUnusedCli(const char* var);
void WatchUnusedCli(const char* var);
diff --git a/Source/cmakemain.cxx b/Source/cmakemain.cxx
index 663ce8f..1fe9e82 100644
--- a/Source/cmakemain.cxx
+++ b/Source/cmakemain.cxx
@@ -62,6 +62,7 @@ static const char * cmDocumentationDescription[][3] =
" --config <cfg> = For multi-configuration tools, choose <cfg>.\n" \
" --clean-first = Build target 'clean' first, then build.\n" \
" (To clean only, use --target 'clean'.)\n" \
+ " --use-stderr = Don't merge stdout/stderr.\n" \
" -- = Pass remaining options to the native tool.\n"
//----------------------------------------------------------------------------
@@ -568,6 +569,7 @@ static int do_build(int ac, char** av)
std::string dir;
std::vector<std::string> nativeOptions;
bool clean = false;
+ cmSystemTools::OutputOption outputflag = cmSystemTools::OUTPUT_MERGE;
enum Doing { DoingNone, DoingDir, DoingTarget, DoingConfig, DoingNative};
Doing doing = DoingDir;
@@ -590,6 +592,10 @@ static int do_build(int ac, char** av)
clean = true;
doing = DoingNone;
}
+ else if(strcmp(av[i], "--use-stderr") == 0)
+ {
+ outputflag = cmSystemTools::OUTPUT_NORMAL;
+ }
else if(strcmp(av[i], "--") == 0)
{
doing = DoingNative;
@@ -635,6 +641,6 @@ static int do_build(int ac, char** av)
}
cmake cm;
- return cm.Build(dir, target, config, nativeOptions, clean);
+ return cm.Build(dir, target, config, nativeOptions, clean, outputflag);
#endif
}
diff --git a/Source/kwsys/kwsysDateStamp.cmake b/Source/kwsys/kwsysDateStamp.cmake
index 33cd79b..a4a6252 100644
--- a/Source/kwsys/kwsysDateStamp.cmake
+++ b/Source/kwsys/kwsysDateStamp.cmake
@@ -15,7 +15,7 @@
SET(KWSYS_DATE_STAMP_YEAR 2011)
# KWSys version date month component. Format is MM.
-SET(KWSYS_DATE_STAMP_MONTH 07)
+SET(KWSYS_DATE_STAMP_MONTH 08)
# KWSys version date day component. Format is DD.
-SET(KWSYS_DATE_STAMP_DAY 27)
+SET(KWSYS_DATE_STAMP_DAY 02)