[cmake-commits] alex committed CMakeLists.txt 1.361 1.361.2.1
cmBootstrapCommands.cxx 1.9 1.9.2.1 cmCommands.cxx 1.110
1.110.2.1 cmCustomCommand.h 1.20 1.20.2.1 cmFindBase.cxx
1.19.2.2 1.19.2.3 cmFindBase.h 1.9.2.1 1.9.2.2
cmGlobalGenerator.cxx 1.173.2.1 1.173.2.2 cmGlobalGenerator.h
1.73 1.73.2.1 cmGlobalUnixMakefileGenerator3.cxx 1.105
1.105.2.1 cmGlobalUnixMakefileGenerator3.h 1.39 1.39.2.1
cmGlobalVisualStudio6Generator.cxx 1.67 1.67.2.1
cmGlobalVisualStudio7Generator.cxx 1.85 1.85.2.1
cmGlobalWatcomWMakeGenerator.cxx 1.11 1.11.2.1
cmGlobalXCodeGenerator.cxx 1.142 1.142.2.1
cmGlobalXCodeGenerator.h 1.45 1.45.2.1 cmIncludeCommand.cxx
1.18.2.3 1.18.2.4 cmIncludeCommand.h 1.14.4.2 1.14.4.3
cmListFileCache.h 1.17.4.1 1.17.4.2 cmLocalGenerator.cxx
1.212.2.2 1.212.2.3 cmLocalGenerator.h 1.78.2.2 1.78.2.3
cmLocalUnixMakefileGenerator3.cxx 1.204 1.204.2.1
cmLocalUnixMakefileGenerator3.h 1.69 1.69.2.1
cmLocalVisualStudio6Generator.cxx 1.120 1.120.2.1
cmLocalVisualStudio6Generator.h 1.16 1.16.2.1
cmLocalVisualStudio7Generator.cxx 1.186 1.186.2.1
cmLocalVisualStudio7Generator.h 1.37 1.37.2.1
cmLocalVisualStudioGenerator.cxx 1.10 1.10.2.1
cmLocalVisualStudioGenerator.h 1.5 1.5.2.1 cmMakefile.cxx
1.383.2.1 1.383.2.2 cmMakefileExecutableTargetGenerator.cxx
1.33 1.33.2.1 cmMakefileLibraryTargetGenerator.cxx 1.39
1.39.2.1 cmMakefileLibraryTargetGenerator.h 1.3 1.3.2.1
cmMakefileTargetGenerator.cxx 1.61 1.61.2.1
cmMakefileTargetGenerator.h 1.14 1.14.2.1
cmMakefileUtilityTargetGenerator.cxx 1.5 1.5.2.1 cmTarget.cxx
1.134 1.134.2.1 cmTarget.h 1.80 1.80.2.1 cmTryRunCommand.cxx
1.22.2.1 1.22.2.2 cmTryRunCommand.h 1.9 1.9.4.1 cmVersion.cxx
1.845 1.845.2.1
cmake-commits at cmake.org
cmake-commits at cmake.org
Thu May 17 10:24:38 EDT 2007
Update of /cvsroot/CMake/CMake/Source
In directory public:/mounts/ram/cvs-serv18561/Source
Modified Files:
Tag: CMake-CrossCompileBasic
CMakeLists.txt cmBootstrapCommands.cxx cmCommands.cxx
cmCustomCommand.h cmFindBase.cxx cmFindBase.h
cmGlobalGenerator.cxx cmGlobalGenerator.h
cmGlobalUnixMakefileGenerator3.cxx
cmGlobalUnixMakefileGenerator3.h
cmGlobalVisualStudio6Generator.cxx
cmGlobalVisualStudio7Generator.cxx
cmGlobalWatcomWMakeGenerator.cxx cmGlobalXCodeGenerator.cxx
cmGlobalXCodeGenerator.h cmIncludeCommand.cxx
cmIncludeCommand.h cmListFileCache.h cmLocalGenerator.cxx
cmLocalGenerator.h cmLocalUnixMakefileGenerator3.cxx
cmLocalUnixMakefileGenerator3.h
cmLocalVisualStudio6Generator.cxx
cmLocalVisualStudio6Generator.h
cmLocalVisualStudio7Generator.cxx
cmLocalVisualStudio7Generator.h
cmLocalVisualStudioGenerator.cxx
cmLocalVisualStudioGenerator.h cmMakefile.cxx
cmMakefileExecutableTargetGenerator.cxx
cmMakefileLibraryTargetGenerator.cxx
cmMakefileLibraryTargetGenerator.h
cmMakefileTargetGenerator.cxx cmMakefileTargetGenerator.h
cmMakefileUtilityTargetGenerator.cxx cmTarget.cxx cmTarget.h
cmTryRunCommand.cxx cmTryRunCommand.h cmVersion.cxx
Log Message:
ENH: merge changes from HEAD into the branch
-change INCLUDE(file [OPTIONAL] [VAR]) to INCLUDE(file [OPTIONAL] [RESULT_VARIABLE VAR])
-add tests for INCLUDE(), CMAKE_TOOLCHAIN_FILE and FIND_XXX()
-keep the stripping in CPack for now
-support a MS toolchain suffix
Alex
Index: cmLocalVisualStudio7Generator.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmLocalVisualStudio7Generator.cxx,v
retrieving revision 1.186
retrieving revision 1.186.2.1
diff -u -d -r1.186 -r1.186.2.1
--- cmLocalVisualStudio7Generator.cxx 10 Apr 2007 13:54:01 -0000 1.186
+++ cmLocalVisualStudio7Generator.cxx 17 May 2007 14:24:36 -0000 1.186.2.1
@@ -42,8 +42,7 @@
{
}
-
-void cmLocalVisualStudio7Generator::Generate()
+void cmLocalVisualStudio7Generator::AddHelperCommands()
{
std::set<cmStdString> lang;
lang.insert("C");
@@ -53,6 +52,10 @@
lang.insert("DEF");
this->CreateCustomTargetsAndCommands(lang);
this->FixGlobalTargets();
+}
+
+void cmLocalVisualStudio7Generator::Generate()
+{
this->OutputVCProjFile();
}
@@ -124,16 +127,6 @@
{
this->AddVCProjBuildRule(l->second);
}
-
- // INCLUDE_EXTERNAL_MSPROJECT command only affects the workspace
- // so don't build a projectfile for it
- if ((l->second.GetType() != cmTarget::INSTALL_FILES)
- && (l->second.GetType() != cmTarget::INSTALL_PROGRAMS)
- && (strncmp(l->first.c_str(), "INCLUDE_EXTERNAL_MSPROJECT", 26) != 0))
- {
- cmTarget& target = l->second;
- target.TraceVSDependencies(target.GetName(), this->Makefile);
- }
}
for(cmTargets::iterator l = tgts.begin();
@@ -512,9 +505,9 @@
this->Makefile->IsOn("CMAKE_VERBOSE_MAKEFILE"));
// Add a definition for the configuration name.
- std::string configDefine = "CMAKE_INTDIR=\\\"";
+ std::string configDefine = "CMAKE_INTDIR=\"";
configDefine += configName;
- configDefine += "\\\"";
+ configDefine += "\"";
targetOptions.AddDefine(configDefine);
// Add the export symbol definition for shared library objects.
@@ -623,7 +616,7 @@
<< "\t\t\t/>\n";
}
- this->OutputTargetRules(fout, target, libName);
+ this->OutputTargetRules(fout, configName, target, libName);
this->OutputBuildTool(fout, configName, target);
fout << "\t\t</Configuration>\n";
}
@@ -1141,17 +1134,8 @@
fout << "\t\t\t\tRelativePath=\"" << d << "\">\n";
if (command)
{
- // Construct the entire set of commands in one string.
- std::string script =
- this->ConstructScript(command->GetCommandLines(),
- command->GetWorkingDirectory(),
- command->GetEscapeOldStyle(),
- command->GetEscapeAllowMakeVars());
- std::string comment = this->ConstructComment(*command);
const char* flags = compileFlags.size() ? compileFlags.c_str(): 0;
- this->WriteCustomRule(fout, source.c_str(), script.c_str(),
- comment.c_str(), command->GetDepends(),
- command->GetOutputs(), flags);
+ this->WriteCustomRule(fout, source.c_str(), *command, flags);
}
else if(compileFlags.size() || additionalDeps.length()
|| objectName.size() || excludedFromBuild)
@@ -1228,12 +1212,11 @@
void cmLocalVisualStudio7Generator::
WriteCustomRule(std::ostream& fout,
const char* source,
- const char* command,
- const char* comment,
- const std::vector<std::string>& depends,
- const std::vector<std::string>& outputs,
+ const cmCustomCommand& command,
const char* compileFlags)
{
+ std::string comment = this->ConstructComment(command);
+
// Write the rule for each configuration.
std::vector<std::string>::iterator i;
std::vector<std::string> *configs =
@@ -1251,14 +1234,21 @@
<< "\t\t\t\t\tAdditionalOptions=\""
<< this->EscapeForXML(compileFlags) << "\"/>\n";
}
+
+ std::string script =
+ this->ConstructScript(command.GetCommandLines(),
+ command.GetWorkingDirectory(),
+ i->c_str(),
+ command.GetEscapeOldStyle(),
+ command.GetEscapeAllowMakeVars());
fout << "\t\t\t\t\t<Tool\n"
<< "\t\t\t\t\tName=\"VCCustomBuildTool\"\n"
<< "\t\t\t\t\tDescription=\""
- << this->EscapeForXML(comment) << "\"\n"
+ << this->EscapeForXML(comment.c_str()) << "\"\n"
<< "\t\t\t\t\tCommandLine=\""
- << this->EscapeForXML(command) << "\"\n"
+ << this->EscapeForXML(script.c_str()) << "\"\n"
<< "\t\t\t\t\tAdditionalDependencies=\"";
- if(depends.empty())
+ if(command.GetDepends().empty())
{
// There are no real dependencies. Produce an artificial one to
// make sure the rule runs reliably.
@@ -1272,9 +1262,10 @@
else
{
// Write out the dependencies for the rule.
- std::string temp;
- for(std::vector<std::string>::const_iterator d = depends.begin();
- d != depends.end(); ++d)
+ for(std::vector<std::string>::const_iterator d =
+ command.GetDepends().begin();
+ d != command.GetDepends().end();
+ ++d)
{
// Get the real name of the dependency in case it is a CMake target.
std::string dep = this->GetRealDependency(d->c_str(), i->c_str());
@@ -1284,7 +1275,7 @@
}
fout << "\"\n";
fout << "\t\t\t\t\tOutputs=\"";
- if(outputs.empty())
+ if(command.GetOutputs().empty())
{
fout << source << "_force";
}
@@ -1292,8 +1283,10 @@
{
// Write a rule for the output generated by this command.
const char* sep = "";
- for(std::vector<std::string>::const_iterator o = outputs.begin();
- o != outputs.end(); ++o)
+ for(std::vector<std::string>::const_iterator o =
+ command.GetOutputs().begin();
+ o != command.GetOutputs().end();
+ ++o)
{
fout << sep << this->ConvertToXMLOutputPathSingle(o->c_str());
sep = ";";
@@ -1324,6 +1317,7 @@
// look for custom rules on a target and collect them together
void cmLocalVisualStudio7Generator
::OutputTargetRules(std::ostream& fout,
+ const char* configName,
cmTarget &target,
const char * /*libName*/)
{
@@ -1351,6 +1345,7 @@
std::string script =
this->ConstructScript(cr->GetCommandLines(),
cr->GetWorkingDirectory(),
+ configName,
cr->GetEscapeOldStyle(),
cr->GetEscapeAllowMakeVars());
fout << this->EscapeForXML(script.c_str()).c_str();
@@ -1380,6 +1375,7 @@
std::string script =
this->ConstructScript(cr->GetCommandLines(),
cr->GetWorkingDirectory(),
+ configName,
cr->GetEscapeOldStyle(),
cr->GetEscapeAllowMakeVars());
fout << this->EscapeForXML(script.c_str()).c_str();
@@ -1409,6 +1405,7 @@
std::string script =
this->ConstructScript(cr->GetCommandLines(),
cr->GetWorkingDirectory(),
+ configName,
cr->GetEscapeOldStyle(),
cr->GetEscapeAllowMakeVars());
fout << this->EscapeForXML(script.c_str()).c_str();
@@ -1843,14 +1840,13 @@
for(std::vector<cmStdString>::const_iterator di = this->Defines.begin();
di != this->Defines.end(); ++di)
{
- // Escape this flag for the IDE.
- std::string define =
- cmLocalVisualStudio7GeneratorEscapeForXML(di->c_str());
-
- // Old comment:
// Double-quotes in the value of the definition must be escaped
- // with a backslash. The entire definition should be quoted in
- // the generated xml attribute to avoid confusing the VS parser.
+ // with a backslash.
+ std::string define = di->c_str();
+ cmSystemTools::ReplaceString(define, "\"", "\\\"");
+
+ // Escape this flag for the IDE.
+ define = cmLocalVisualStudio7GeneratorEscapeForXML(define.c_str());
// Write this flag. Quote it if the definition is not
// alphanumeric.
Index: cmLocalVisualStudio7Generator.h
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmLocalVisualStudio7Generator.h,v
retrieving revision 1.37
retrieving revision 1.37.2.1
diff -u -d -r1.37 -r1.37.2.1
--- cmLocalVisualStudio7Generator.h 10 Apr 2007 13:54:01 -0000 1.37
+++ cmLocalVisualStudio7Generator.h 17 May 2007 14:24:36 -0000 1.37.2.1
@@ -41,7 +41,9 @@
cmLocalVisualStudio7Generator();
virtual ~cmLocalVisualStudio7Generator();
-
+
+ virtual void AddHelperCommands();
+
/**
* Generate the makefile for this directory.
*/
@@ -89,8 +91,8 @@
std::string EscapeForXML(const char* s);
std::string ConvertToXMLOutputPath(const char* path);
std::string ConvertToXMLOutputPathSingle(const char* path);
- void OutputTargetRules(std::ostream& fout, cmTarget &target,
- const char *libName);
+ void OutputTargetRules(std::ostream& fout, const char* configName,
+ cmTarget &target, const char *libName);
void OutputBuildTool(std::ostream& fout, const char* configName,
cmTarget& t);
void OutputLibraries(std::ostream& fout,
@@ -104,12 +106,10 @@
const char* group,
const char* filter);
void WriteVCProjEndGroup(std::ostream& fout);
+
void WriteCustomRule(std::ostream& fout,
const char* source,
- const char* command,
- const char* comment,
- const std::vector<std::string>& depends,
- const std::vector<std::string>& outputs,
+ const cmCustomCommand& command,
const char* extraFlags);
void WriteTargetVersionAttribute(std::ostream& fout, cmTarget& target);
Index: cmFindBase.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmFindBase.cxx,v
retrieving revision 1.19.2.2
retrieving revision 1.19.2.3
diff -u -d -r1.19.2.2 -r1.19.2.3
--- cmFindBase.cxx 11 May 2007 20:25:09 -0000 1.19.2.2
+++ cmFindBase.cxx 17 May 2007 14:24:36 -0000 1.19.2.3
@@ -25,7 +25,7 @@
this->NoCMakeEnvironmentPath = false;
this->NoSystemEnvironmentPath = false;
this->NoCMakeSystemPath = false;
- this->FindPrefixMode = PrefixModeBoth;
+ this->FindRootPathMode = RootPathModeBoth;
// default is to search frameworks first on apple
#if defined(__APPLE__)
this->SearchFrameworkFirst = true;
@@ -253,17 +253,20 @@
this->AlreadyInCache = false;
- std::string findPrefixVar = "CMAKE_";
- findPrefixVar += this->CMakePathName;
- findPrefixVar += "_FIND_PREFIX_MODE";
- std::string prefixMode = this->Makefile->GetSafeDefinition(findPrefixVar.c_str());
- if (prefixMode=="NEVER")
+ std::string findRootPathVar = "CMAKE_FIND_ROOT_PATH_MODE_";
+ findRootPathVar += this->CMakePathName;
+ std::string rootPathMode = this->Makefile->GetSafeDefinition(findRootPathVar.c_str());
+ if (rootPathMode=="NEVER")
{
- this->FindPrefixMode = PrefixModeNoPrefix;
+ this->FindRootPathMode = RootPathModeNoRootPath;
}
- else if (prefixMode=="ONLY")
+ else if (rootPathMode=="ONLY")
{
- this->FindPrefixMode = PrefixModeOnlyPrefix;
+ this->FindRootPathMode = RootPathModeOnlyRootPath;
+ }
+ else if (rootPathMode=="BOTH")
+ {
+ this->FindRootPathMode = RootPathModeBoth;
}
std::vector<std::string> userPaths;
@@ -344,15 +347,20 @@
doingNames = false;
this->NoCMakeSystemPath = true;
}
- else if (args[j] == "NO_CMAKE_FIND_PREFIX")
+ else if (args[j] == "NO_CMAKE_FIND_ROOT_PATH")
{
- compatibility = false; // not sure, Alex
- this->FindPrefixMode = PrefixModeNoPrefix;
+ compatibility = false;
+ this->FindRootPathMode = RootPathModeNoRootPath;
}
- else if (args[j] == "ONLY_CMAKE_FIND_PREFIX")
+ else if (args[j] == "ONLY_CMAKE_FIND_ROOT_PATH")
{
- compatibility = false; // not sure, Alex
- this->FindPrefixMode = PrefixModeOnlyPrefix;
+ compatibility = false;
+ this->FindRootPathMode = RootPathModeOnlyRootPath;
+ }
+ else if (args[j] == "CMAKE_FIND_ROOT_PATH_BOTH")
+ {
+ compatibility = false;
+ this->FindRootPathMode = RootPathModeBoth;
}
else
{
@@ -419,7 +427,7 @@
}
this->ExpandPaths(userPaths);
- this->HandleCMakeFindPrefix();
+ this->HandleCMakeFindRootPath();
return true;
}
@@ -481,21 +489,21 @@
this->AddPaths(paths);
}
-void cmFindBase::HandleCMakeFindPrefix()
+void cmFindBase::HandleCMakeFindRootPath()
{
- if (this->FindPrefixMode == PrefixModeNoPrefix)
+ if (this->FindRootPathMode == RootPathModeNoRootPath)
{
return;
}
- const char* prefix = this->Makefile->GetDefinition("CMAKE_FIND_PREFIX");
- if ((prefix == 0) || (strlen(prefix) == 0))
+ const char* rootPath = this->Makefile->GetDefinition("CMAKE_FIND_ROOT_PATH");
+ if ((rootPath == 0) || (strlen(rootPath) == 0))
{
return;
}
std::vector<std::string> prefixes;
- cmSystemTools::ExpandListArgument(prefix, prefixes);
+ cmSystemTools::ExpandListArgument(rootPath, prefixes);
std::vector<std::string> unprefixedPaths=this->SearchPaths;
this->SearchPaths.clear();
@@ -514,7 +522,7 @@
}
}
- if (this->FindPrefixMode == PrefixModeBoth)
+ if (this->FindRootPathMode == RootPathModeBoth)
{
this->AddPaths(unprefixedPaths);
}
Index: cmGlobalUnixMakefileGenerator3.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmGlobalUnixMakefileGenerator3.cxx,v
retrieving revision 1.105
retrieving revision 1.105.2.1
diff -u -d -r1.105 -r1.105.2.1
--- cmGlobalUnixMakefileGenerator3.cxx 13 Apr 2007 14:22:33 -0000 1.105
+++ cmGlobalUnixMakefileGenerator3.cxx 17 May 2007 14:24:36 -0000 1.105.2.1
@@ -1056,7 +1056,7 @@
{
cmTarget *result;
cmLocalUnixMakefileGenerator3 *lg3;
-
+
// first check the same dir as the current target
lg3 = static_cast<cmLocalUnixMakefileGenerator3 *>
(target.GetMakefile()->GetLocalGenerator());
Index: cmLocalVisualStudioGenerator.h
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmLocalVisualStudioGenerator.h,v
retrieving revision 1.5
retrieving revision 1.5.2.1
diff -u -d -r1.5 -r1.5.2.1
--- cmLocalVisualStudioGenerator.h 16 Feb 2007 21:12:16 -0000 1.5
+++ cmLocalVisualStudioGenerator.h 17 May 2007 14:24:36 -0000 1.5.2.1
@@ -41,6 +41,7 @@
/** Construct a script from the given list of command lines. */
std::string ConstructScript(const cmCustomCommandLines& commandLines,
const char* workingDirectory,
+ const char* configName,
bool escapeOldStyle,
bool escapeAllowMakeVars,
const char* newline = "\n");
Index: cmTryRunCommand.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmTryRunCommand.cxx,v
retrieving revision 1.22.2.1
retrieving revision 1.22.2.2
diff -u -d -r1.22.2.1 -r1.22.2.2
--- cmTryRunCommand.cxx 11 May 2007 18:03:50 -0000 1.22.2.1
+++ cmTryRunCommand.cxx 17 May 2007 14:24:36 -0000 1.22.2.2
@@ -84,6 +84,7 @@
std::string output;
std::string executableSuffix=this->Makefile->GetDefinition("CMAKE_EXECUTABLE_SUFFIX");
std::string command1 = binaryDirectory;
+ std::vector<std::string> attemptedPaths;
command1 += "/cmTryCompileExec";
command1 += executableSuffix;
std::string fullPath;
@@ -91,34 +92,68 @@
{
fullPath = cmSystemTools::CollapseFullPath(command1.c_str());
}
- else
+ attemptedPaths.push_back(command1);
+ command1 = binaryDirectory;
+ // try CMAKE_TRY_COMPILE_CONFIGURATION if it is set
+ if (fullPath.empty())
{
- std::string command2 = binaryDirectory;
- command2 += "/Debug/cmTryCompileExec";
- command2 += executableSuffix;
- if(cmSystemTools::FileExists(command2.c_str()))
+ const char* config =
+ this->Makefile->GetDefinition("CMAKE_TRY_COMPILE_CONFIGURATION");
+ // if a config was specified try that first
+ if (config && config[0])
{
- fullPath = cmSystemTools::CollapseFullPath(command2.c_str());
+ command1 += "/";
+ command1 += config;
+ command1 += "/cmTryCompileExec";
+ command1 += executableSuffix;
+ if(cmSystemTools::FileExists(command1.c_str()))
+ {
+ fullPath = cmSystemTools::CollapseFullPath(command1.c_str());
+ }
+ attemptedPaths.push_back(command1);
}
- else
+ }
+ // try Debug if still not found
+ if (fullPath.empty())
+ {
+ command1 = binaryDirectory;
+ command1 += "/Debug/cmTryCompileExec";
+ command1 += executableSuffix;
+ if(cmSystemTools::FileExists(command1.c_str()))
{
- std::string command3 = binaryDirectory;
- command3 += "/Development/cmTryCompileExec";
- command3 += executableSuffix;
- if(cmSystemTools::FileExists(command3.c_str()))
+ fullPath = cmSystemTools::CollapseFullPath(command1.c_str());
+ }
+ attemptedPaths.push_back(command1);
+ }
+ // try Deployment if still not found
+ if (fullPath.empty())
+ {
+ command1 = binaryDirectory;
+ command1 += "/Development/cmTryCompileExec";
+ command1 += executableSuffix;
+ if(cmSystemTools::FileExists(command1.c_str()))
+ {
+ fullPath = cmSystemTools::CollapseFullPath(command1.c_str());
+ }
+ attemptedPaths.push_back(command1);
+ }
+ if (fullPath.empty())
+ {
+ cmOStringStream emsg;
+ emsg << "Unable to find executable for TRY_RUN: tried \"";
+ for (i = 0; i < attemptedPaths.size(); ++i)
+ {
+ emsg << attemptedPaths[i];
+ if (i < attemptedPaths.size() - 1)
{
- fullPath = cmSystemTools::CollapseFullPath(command3.c_str());
+ emsg << "\" and \"";
}
else
{
- cmOStringStream emsg;
- emsg << "Unable to find executable for TRY_RUN: tried \""
- << command1 << "\" and \""
- << command2 << "\" and \""
- << command3 << "\".";
- cmSystemTools::Error(emsg.str().c_str());
+ emsg << "\".";
}
}
+ cmSystemTools::Error(emsg.str().c_str());
}
if (fullPath.size() > 1)
{
@@ -156,7 +191,7 @@
}
this->Makefile->AddCacheDefinition(argv[0].c_str(), retChar,
"Result of TRY_RUN",
- cmCacheManager::INTERNAL);
+ cmCacheManager::INTERNAL);
}
}
Index: cmMakefileLibraryTargetGenerator.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmMakefileLibraryTargetGenerator.cxx,v
retrieving revision 1.39
retrieving revision 1.39.2.1
diff -u -d -r1.39 -r1.39.2.1
--- cmMakefileLibraryTargetGenerator.cxx 19 Mar 2007 14:00:35 -0000 1.39
+++ cmMakefileLibraryTargetGenerator.cxx 17 May 2007 14:24:36 -0000 1.39.2.1
@@ -29,7 +29,7 @@
//----------------------------------------------------------------------------
cmMakefileLibraryTargetGenerator::cmMakefileLibraryTargetGenerator()
{
- this->DriveCustomCommandsOnDepends = true;
+ this->CustomCommandDriver = OnDepends;
}
//----------------------------------------------------------------------------
@@ -111,6 +111,13 @@
//----------------------------------------------------------------------------
void cmMakefileLibraryTargetGenerator::WriteSharedLibraryRules(bool relink)
{
+#ifdef __APPLE__
+ if(this->Target->GetPropertyAsBool("FRAMEWORK"))
+ {
+ this->WriteFrameworkRules(relink);
+ return;
+ }
+#endif
const char* linkLanguage =
this->Target->GetLinkerLanguage(this->GlobalGenerator);
std::string linkRuleVar = "CMAKE_";
@@ -184,6 +191,238 @@
}
//----------------------------------------------------------------------------
+void cmMakefileLibraryTargetGenerator::WriteFrameworkRules(bool relink)
+{
+ const char* linkLanguage =
+ this->Target->GetLinkerLanguage(this->GlobalGenerator);
+ std::string linkRuleVar = "CMAKE_";
+ if (linkLanguage)
+ {
+ linkRuleVar += linkLanguage;
+ }
+ linkRuleVar += "_CREATE_MACOSX_FRAMEWORK";
+
+ std::string extraFlags;
+ this->LocalGenerator->AppendFlags(extraFlags,
+ this->Target->GetProperty("LINK_FLAGS"));
+ std::string linkFlagsConfig = "LINK_FLAGS_";
+ linkFlagsConfig +=
+ cmSystemTools::UpperCase(this->LocalGenerator->ConfigurationName.c_str());
+ this->LocalGenerator->AppendFlags
+ (extraFlags, this->Target->GetProperty(linkFlagsConfig.c_str()));
+ this->LocalGenerator->AddConfigVariableFlags
+ (extraFlags, "CMAKE_MACOSX_FRAMEWORK_LINKER_FLAGS",
+ this->LocalGenerator->ConfigurationName.c_str());
+
+ // TODO: .def files should be supported here also.
+ this->WriteLibraryRules(linkRuleVar.c_str(), extraFlags.c_str(), relink);
+}
+
+
+//----------------------------------------------------------------------------
+void cmMakefileLibraryTargetGenerator::CreateFrameworkLinksAndDirs(
+ std::string& targetName,
+ std::string& outpath,
+ const char* version)
+{
+ std::string symlink;
+ std::string symlink2;
+ // Make foo.framework/Versions
+ std::string dir = outpath;
+ dir += "Versions";
+ cmSystemTools::MakeDirectory(dir.c_str());
+ std::string cwd = cmSystemTools::GetCurrentWorkingDirectory();
+ // cd foo.framework to setup symlinks with relative paths
+ cmSystemTools::ChangeDirectory((outpath+"Versions").c_str());
+ // Current -> version
+ symlink = version;
+ symlink2 = "Current";
+ cmSystemTools::RemoveFile("Current");
+ cmSystemTools::CreateSymlink(symlink.c_str(), symlink2.c_str());
+ this->Makefile->AddCMakeOutputFile((outpath + "Versions/Current").c_str());
+ // change to top level of framework to create next set of symlinks
+ cmSystemTools::ChangeDirectory(outpath.c_str());
+ // foo -> Versions/Current/foo
+ symlink = "Versions/Current/";
+ symlink += targetName;
+ symlink2 = targetName;
+ cmSystemTools::CreateSymlink(symlink.c_str(), symlink2.c_str());
+ this->Makefile->AddCMakeOutputFile((outpath + targetName).c_str());
+ // Resources -> Versions/Current/Resources
+ symlink = "Versions/Current/Resources";
+ symlink2 = "Resources";
+ cmSystemTools::CreateSymlink(symlink.c_str(), symlink2.c_str());
+ this->Makefile->AddCMakeOutputFile((outpath + "Resources").c_str());
+ // Libraries -> Versions/Current/Libraries
+ symlink = "Versions/Current/Libraries";
+ symlink2 = "Libraries";
+ cmSystemTools::CreateSymlink(symlink.c_str(), symlink2.c_str());
+ this->Makefile->AddCMakeOutputFile((outpath + "Libraries").c_str());
+ // Headers -> Versions/Current/Headers
+ symlink = "Versions/Current/Headers";
+ symlink2 = "Headers";
+ cmSystemTools::CreateSymlink(symlink.c_str(), symlink2.c_str());
+ this->Makefile->AddCMakeOutputFile((outpath + "Headers").c_str());
+ // go back to where we were
+ cmSystemTools::ChangeDirectory(cwd.c_str());
+}
+
+//----------------------------------------------------------------------------
+void cmMakefileLibraryTargetGenerator::CopyFrameworkPublicHeaders(
+ std::string& targetName,
+ std::string& outpath,
+ const char* /*version*/)
+{
+ std::string fullOutput= outpath + targetName;
+ const char* headers = this->Target->GetProperty("FRAMEWORK_PUBLIC_HEADERS");
+ if(!headers)
+ {
+ return;
+ }
+ std::vector<std::string> headersVec;
+ cmSystemTools::ExpandListArgument(headers,
+ headersVec);
+ cmCustomCommandLines commandLines;
+ std::vector<std::string> depends;
+ for(std::vector<std::string>::iterator i = headersVec.begin();
+ i != headersVec.end(); ++i)
+ {
+ cmCustomCommandLine line;
+ cmSourceFile* sf = this->Makefile->GetOrCreateSource(i->c_str());
+ std::string dest = outpath + "Headers/";
+ dest += sf->GetSourceName();
+ std::string ext = sf->GetSourceExtension();
+ if(ext.size())
+ {
+ dest += ".";
+ dest += sf->GetSourceExtension();
+ }
+ line.push_back("$(CMAKE_COMMAND)");
+ line.push_back("-E");
+ line.push_back("copy_if_different");
+ line.push_back(sf->GetFullPath());
+ depends.push_back(sf->GetFullPath());
+ line.push_back(dest);
+ commandLines.push_back(line);
+ // make sure the target gets rebuilt if any of the headers is removed
+ this->GenerateExtraOutput(dest.c_str(),
+ fullOutput.c_str());
+ }
+ // add a set of prebuild commands to run on the target
+ this->Makefile->
+ AddCustomCommandToTarget(this->Target->GetName(),
+ depends,
+ commandLines,
+ cmTarget::PRE_BUILD,
+ "copy files",
+ this->Makefile->GetCurrentOutputDirectory());
+}
+
+//----------------------------------------------------------------------------
+void cmMakefileLibraryTargetGenerator::CopyFrameworkResources(
+ std::string& targetName,
+ std::string& outpath,
+ const char* /*version*/)
+{
+ std::string fullOutput= outpath + targetName;
+ const char* resources = this->Target->GetProperty("FRAMEWORK_RESOURCES");
+ if(!resources)
+ {
+ return;
+ }
+ std::vector<std::string> resourcesVec;
+ cmSystemTools::ExpandListArgument(resources,
+ resourcesVec);
+ cmCustomCommandLines commandLines;
+ std::vector<std::string> depends;
+ for(std::vector<std::string>::iterator i = resourcesVec.begin();
+ i != resourcesVec.end(); ++i)
+ {
+ cmCustomCommandLine line;
+ cmSourceFile* sf = this->Makefile->GetOrCreateSource(i->c_str());
+ std::string dest = outpath + "Resources/";
+ dest += sf->GetSourceName();
+ std::string ext = sf->GetSourceExtension();
+ if(ext.size())
+ {
+ dest += ".";
+ dest += sf->GetSourceExtension();
+ }
+ line.push_back("$(CMAKE_COMMAND)");
+ line.push_back("-E");
+ line.push_back("copy_if_different");
+ line.push_back(sf->GetFullPath());
+ depends.push_back(sf->GetFullPath());
+ line.push_back(dest);
+ commandLines.push_back(line);
+ // make sure the target gets rebuilt if any of the resources is removed
+ this->GenerateExtraOutput(dest.c_str(),
+ fullOutput.c_str());
+ }
+ // add a set of prebuild commands to run on the target
+ this->Makefile->
+ AddCustomCommandToTarget(this->Target->GetName(),
+ depends,
+ commandLines,
+ cmTarget::PRE_BUILD,
+ "copy files",
+ this->Makefile->GetCurrentOutputDirectory());
+}
+
+//----------------------------------------------------------------------------
+void cmMakefileLibraryTargetGenerator::CreateFramework(
+ std::string& targetName,
+ std::string& outpath)
+{
+ std::string macdir = outpath;
+ const char* version = this->Target->GetProperty("FRAMEWORK_VERSION");
+ if(!version)
+ {
+ version = "A";
+ std::string message =
+ "Warning: FRAMEWORK_VERSION property not found on ";
+ message += targetName;
+ message += ". Default to verison A.";
+ cmSystemTools::Message(message.c_str());
+ }
+ // create the symbolic links and directories
+ this->CreateFrameworkLinksAndDirs(targetName,
+ outpath,
+ version);
+ macdir += "Versions/";
+ macdir += version;
+ macdir += "/";
+ outpath += "Versions/";
+ outpath += version;
+ outpath += "/";
+
+ cmSystemTools::MakeDirectory((macdir + "Libraries").c_str());
+ cmSystemTools::MakeDirectory((macdir + "Headers").c_str());
+ // Configure the Info.plist file. Note that it needs the executable name
+ // to be set
+ std::string rsrcDir = macdir + "Resources/";
+ cmSystemTools::MakeDirectory(rsrcDir.c_str());
+ this->Makefile->AddDefinition("MACOSX_FRAMEWORK_NAME",
+ targetName.c_str());
+ std::string f1 =
+ this->Makefile->GetModulesFile("MacOSXFrameworkInfo.plist.in");
+ if ( f1.size() == 0 )
+ {
+ cmSystemTools::Error(
+ "could not find Mac OSX framework Info.plist template file.");
+ }
+ std::string f2 = rsrcDir + "Info.plist";
+ this->Makefile->ConfigureFile(f1.c_str(), f2.c_str(),
+ false, false, false);
+ this->CopyFrameworkPublicHeaders(targetName,
+ outpath,
+ version);
+ this->CopyFrameworkResources(targetName,
+ outpath,
+ version);
+}
+
+//----------------------------------------------------------------------------
void cmMakefileLibraryTargetGenerator::WriteLibraryRules
(const char* linkRuleVar, const char* extraFlags, bool relink)
{
@@ -269,6 +508,13 @@
outpathImp += "/";
}
}
+#if defined(__APPLE__)
+ // If we're creating a framework, place the output into a framework directory
+ if(this->Target->GetPropertyAsBool("FRAMEWORK"))
+ {
+ this->CreateFramework(targetName, outpath);
+ }
+#endif
std::string targetFullPath = outpath + targetName;
std::string targetFullPathPDB = outpath + targetNamePDB;
std::string targetFullPathSO = outpath + targetNameSO;
@@ -510,7 +756,6 @@
this->Makefile->GetHomeOutputDirectory());
commands.insert(commands.end(), commands1.begin(), commands1.end());
}
-
// Add the post-build rules when building but not when relinking.
if(!relink)
{
Index: cmTarget.h
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmTarget.h,v
retrieving revision 1.80
retrieving revision 1.80.2.1
diff -u -d -r1.80 -r1.80.2.1
--- cmTarget.h 28 Mar 2007 03:13:25 -0000 1.80
+++ cmTarget.h 17 May 2007 14:24:36 -0000 1.80.2.1
@@ -55,7 +55,7 @@
void SetType(TargetType f, const char* name);
///! Set/Get the name of the target
- const char* GetName() {return this->Name.c_str();}
+ const char* GetName() const {return this->Name.c_str();}
///! Set the cmMakefile that owns this target
void SetMakefile(cmMakefile *mf);
@@ -180,7 +180,7 @@
/**
* Trace through the source files in this target and add al source files
- * that they depend on, used by the visual studio generators
+ * that they depend on, used by all generators
*/
void TraceVSDependencies(std::string projName, cmMakefile *mf);
@@ -291,6 +291,13 @@
const LibraryID& lib,
const LibraryID& dep);
+ /*
+ * Checks the prebuild, prelink and postbuild custom commands for known
+ * targets and adds them to the dependencies.
+ */
+ void CheckForTargetsAsCommand(const std::vector<cmCustomCommand>& commands);
+
+
/**
* Emits the library \a lib and all its dependencies into link_line.
* \a emitted keeps track of the libraries that have been emitted to
Index: CMakeLists.txt
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/CMakeLists.txt,v
retrieving revision 1.361
retrieving revision 1.361.2.1
diff -u -d -r1.361 -r1.361.2.1
--- CMakeLists.txt 18 Apr 2007 04:12:16 -0000 1.361
+++ CMakeLists.txt 17 May 2007 14:24:36 -0000 1.361.2.1
@@ -1,7 +1,3 @@
-CMAKE_MINIMUM_REQUIRED(VERSION 1.5)
-
-INCLUDE_REGULAR_EXPRESSION("^.*$")
-
# configure the .h file
CONFIGURE_FILE(
"${CMake_SOURCE_DIR}/Source/cmConfigure.cmake.h.in"
@@ -354,936 +350,6 @@
SUBDIRS(WXDialog)
ENDIF(BUILD_WXDialog)
-# Testing
-IF(BUILD_TESTING)
- # Should the long tests be run?
- OPTION(CMAKE_RUN_LONG_TESTS "Should the long tests be run (such as Bootstrap)." ON)
- MARK_AS_ADVANCED(CMAKE_RUN_LONG_TESTS)
-
- IF (CMAKE_RUN_LONG_TESTS)
- OPTION(CTEST_TEST_CTEST
- "Should the tests that run a full sub ctest process be run?"
- OFF)
- MARK_AS_ADVANCED(CTEST_TEST_CTEST)
- ENDIF (CMAKE_RUN_LONG_TESTS)
-
- ADD_TEST(CommandLineTest ${CMAKE_CTEST_COMMAND}
- --build-and-test
- "${CMake_SOURCE_DIR}/Tests/CommandLineTest"
- "${CMake_BINARY_DIR}/Tests/CommandLineTest"
- --build-two-config
- --build-generator ${CMAKE_TEST_GENERATOR}
- --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
- --build-project CommandLineTest
- --test-command CommandLineTest)
-
- ADD_TEST(TarTest ${CMAKE_CTEST_COMMAND}
- --build-and-test
- "${CMake_SOURCE_DIR}/Tests/TarTest"
- "${CMake_BINARY_DIR}/Tests/TarTest"
- --build-two-config
- --build-generator ${CMAKE_TEST_GENERATOR}
- --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
- --build-project TestTar
- --test-command TestTarExec)
-
- ADD_TEST(TargetName ${CMAKE_CTEST_COMMAND}
- --build-and-test
- "${CMake_SOURCE_DIR}/Tests/TargetName"
- "${CMake_BINARY_DIR}/Tests/TargetName"
- --build-two-config
- --build-generator ${CMAKE_TEST_GENERATOR}
- --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
- --build-project TargetName
- --test-command ${CMAKE_CMAKE_COMMAND} -E compare_files
- ${CMake_SOURCE_DIR}/Tests/TargetName/scripts/hello_world
- ${CMake_BINARY_DIR}/Tests/TargetName/scripts/hello_world)
-
- ADD_TEST(LibName ${CMAKE_CTEST_COMMAND}
- --build-and-test
- "${CMake_SOURCE_DIR}/Tests/LibName"
- "${CMake_BINARY_DIR}/Tests/LibName"
- --build-two-config
- --build-generator ${CMAKE_TEST_GENERATOR}
- --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
- --build-project LibName
- --build-exe-dir "${CMake_BINARY_DIR}/Tests/LibName/lib"
- --test-command foobar
- )
-
- ADD_TEST(CustComDepend ${CMAKE_CTEST_COMMAND}
- --build-and-test
- "${CMake_SOURCE_DIR}/Tests/CustComDepend"
- "${CMake_BINARY_DIR}/Tests/CustComDepend"
- --build-two-config
- --build-generator ${CMAKE_TEST_GENERATOR}
- --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
- --build-project CustComDepend
- --build-exe-dir "${CMake_BINARY_DIR}/Tests/CustComDepend/bin"
- --test-command foo bar.c
- )
-
- ADD_TEST(CustomCommand ${CMAKE_CTEST_COMMAND}
- --build-and-test
- "${CMake_SOURCE_DIR}/Tests/CustomCommand"
- "${CMake_BINARY_DIR}/Tests/CustomCommand"
- --build-two-config
- --build-generator ${CMAKE_TEST_GENERATOR}
- --build-project CustomCommand
- --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
- --build-exe-dir "${CMake_BINARY_DIR}/Tests/CustomCommand/bin"
- --test-command CustomCommand
- )
-
- ADD_TEST(CustomCommandWorkingDirectory ${CMAKE_CTEST_COMMAND}
- --build-and-test
- "${CMake_SOURCE_DIR}/Tests/CustomCommandWorkingDirectory"
- "${CMake_BINARY_DIR}/Tests/CustomCommandWorkingDirectory"
- --build-two-config
- --build-generator ${CMAKE_TEST_GENERATOR}
- --build-project TestWorkingDir
- --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
- --build-exe-dir "${CMake_BINARY_DIR}/Tests/CustomCommandWorkingDirectory"
- --test-command working
- )
-
- ADD_TEST(FindPackageTest ${CMAKE_CTEST_COMMAND}
- --build-and-test
- "${CMake_SOURCE_DIR}/Tests/FindPackageTest"
- "${CMake_BINARY_DIR}/Tests/FindPackageTest"
- --build-two-config
- --build-generator ${CMAKE_TEST_GENERATOR}
- --build-project FindPackageTest
- --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
- --test-command FindPackageTest)
-
- ADD_TEST(SystemInformation ${CMAKE_CTEST_COMMAND}
- --build-and-test
- "${CMake_SOURCE_DIR}/Tests/SystemInformation"
- "${CMake_BINARY_DIR}/Tests/SystemInformation"
- --build-two-config
- --build-generator ${CMAKE_TEST_GENERATOR}
- --build-project DumpInformation
- --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
- --test-command DumpInformation)
-
- ADD_TEST(StringFileTest ${CMAKE_CTEST_COMMAND}
- --build-and-test
- "${CMake_SOURCE_DIR}/Tests/StringFileTest"
- "${CMake_BINARY_DIR}/Tests/StringFileTest"
- --build-two-config
- --build-generator ${CMAKE_TEST_GENERATOR}
- --build-project StringFileTest
- --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
- --test-command StringFileTest)
-
- ADD_TEST(MathTest ${CMAKE_CTEST_COMMAND}
- --build-and-test
- "${CMake_SOURCE_DIR}/Tests/MathTest"
- "${CMake_BINARY_DIR}/Tests/MathTest"
- --build-two-config
- --build-generator ${CMAKE_TEST_GENERATOR}
- --build-project MathTest
- --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
- --test-command MathTestExec)
-
- ADD_TEST(TryCompile ${CMAKE_CTEST_COMMAND}
- --build-and-test
- "${CMake_SOURCE_DIR}/Tests/TryCompile"
- "${CMake_BINARY_DIR}/Tests/TryCompile"
- --build-generator ${CMAKE_TEST_GENERATOR}
- --build-project TryCompile
- --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
- --build-two-config
- --test-command TryCompile)
-
- ADD_TEST(simple ${CMAKE_CTEST_COMMAND}
- --build-and-test
- "${CMake_SOURCE_DIR}/Tests/Simple"
- "${CMake_BINARY_DIR}/Tests/Simple"
- --build-generator ${CMAKE_TEST_GENERATOR}
- --build-project Simple
- --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
- --build-two-config
- --test-command simple)
-
- #ADD_TEST(SimpleExclude ${CMAKE_CTEST_COMMAND}
- # --build-and-test
- # "${CMake_SOURCE_DIR}/Tests/SimpleExclude"
- # "${CMake_BINARY_DIR}/Tests/SimpleExclude"
- # --build-generator ${CMAKE_TEST_GENERATOR}
- # --build-project SimpleExclude
- # --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
- # --build-two-config
- # --test-command t4
- # #--test-command "${CMAKE_COMMAND}"
- # #"-DCONFIGURATION=\${CTEST_CONFIGURATION_TYPE}"
- # #-P "${CMAKE_BINARY_DIR}/Tests/SimpleExclude/run.cmake"
- # )
-
-# ADD_TEST(SameName ${CMAKE_CTEST_COMMAND}
-# --build-and-test
-# "${CMake_SOURCE_DIR}/Tests/SameName"
-# "${CMake_BINARY_DIR}/Tests/SameName"
-# --build-generator ${CMAKE_TEST_GENERATOR}
-# --build-project SameName
-# --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
-# --build-two-config
-# --test-command
-# "${CMake_BINARY_DIR}/Tests/SameName/Exe1/mytest2")
-
- ADD_TEST(OutOfSource ${CMAKE_CTEST_COMMAND}
- --build-and-test
- "${CMake_SOURCE_DIR}/Tests/OutOfSource"
- "${CMake_BINARY_DIR}/Tests/OutOfSource"
- --build-generator ${CMAKE_TEST_GENERATOR}
- --build-project OutOfSource
- --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
- --build-two-config
- --test-command
- "${CMake_BINARY_DIR}/Tests/OutOfSource/SubDir/OutOfSourceSubdir/simple")
-
- ADD_TEST(PreOrder ${CMAKE_CTEST_COMMAND}
- --build-and-test
- "${CMake_SOURCE_DIR}/Tests/PreOrder"
- "${CMake_BINARY_DIR}/Tests/PreOrder"
- --build-generator ${CMAKE_TEST_GENERATOR}
- --build-project PreOrder
- --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
- --build-two-config
- --test-command simple)
-
- ADD_TEST(conly ${CMAKE_CTEST_COMMAND}
- --build-and-test
- "${CMake_SOURCE_DIR}/Tests/COnly"
- "${CMake_BINARY_DIR}/Tests/COnly"
- --build-generator ${CMAKE_TEST_GENERATOR}
- --build-project conly
- --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
- --build-two-config
- --test-command conly)
-
- ADD_TEST(CxxOnly ${CMAKE_CTEST_COMMAND}
- --build-and-test
- "${CMake_SOURCE_DIR}/Tests/CxxOnly"
- "${CMake_BINARY_DIR}/Tests/CxxOnly"
- --build-generator ${CMAKE_TEST_GENERATOR}
- --build-project cxxonly
- --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
- --build-two-config
- --test-command cxxonly)
-
- ADD_TEST(NewlineArgs ${CMAKE_CTEST_COMMAND}
- --build-and-test
- "${CMake_SOURCE_DIR}/Tests/NewlineArgs"
- "${CMake_BINARY_DIR}/Tests/NewlineArgs"
- --build-generator ${CMAKE_TEST_GENERATOR}
- --build-project newlineargs
- --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
- --build-two-config
- --test-command cxxonly)
-
- ADD_TEST(MacroTest ${CMAKE_CTEST_COMMAND}
- --build-and-test
- "${CMake_SOURCE_DIR}/Tests/MacroTest"
- "${CMake_BINARY_DIR}/Tests/MacroTest"
- --build-generator ${CMAKE_TEST_GENERATOR}
- --build-project littleMacroTest
- --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
- --build-two-config
- --test-command miniMacroTest)
-
- SET(SimpleInstallInstallDir
- "${CMake_BINARY_DIR}/Tests/SimpleInstall/InstallDirectory")
- ADD_TEST(SimpleInstall ${CMAKE_CTEST_COMMAND}
- --build-and-test
- "${CMake_SOURCE_DIR}/Tests/SimpleInstall"
- "${CMake_BINARY_DIR}/Tests/SimpleInstall"
- --build-generator ${CMAKE_TEST_GENERATOR}
- --build-project TestSimpleInstall
- --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
- --build-two-config
- --build-options
- "-DCMAKE_INSTALL_PREFIX:PATH=${SimpleInstallInstallDir}"
- --test-command ${SimpleInstallInstallDir}/MyTest/bin/SimpleInstallExe)
- ADD_TEST(SimpleInstall-Stage2 ${CMAKE_CTEST_COMMAND}
- --build-and-test
- "${CMake_SOURCE_DIR}/Tests/SimpleInstallS2"
- "${CMake_BINARY_DIR}/Tests/SimpleInstallS2"
- --build-generator ${CMAKE_TEST_GENERATOR}
- --build-project TestSimpleInstall
- --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
- --build-two-config
- --build-options
- "-DCMAKE_INSTALL_PREFIX:PATH=${SimpleInstallInstallDir}"
- "-DSTAGE2:BOOL=1"
- --test-command ${SimpleInstallInstallDir}/MyTest/bin/SimpleInstallS2)
-
- ADD_TEST(X11 ${CMAKE_CTEST_COMMAND}
- --build-and-test
- "${CMake_SOURCE_DIR}/Tests/X11"
- "${CMake_BINARY_DIR}/Tests/X11"
- --build-generator ${CMAKE_TEST_GENERATOR}
- --build-project UseX11
- --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
- --build-two-config
- --test-command UseX11)
-
- ADD_TEST(LoadedCommand ${CMAKE_CTEST_COMMAND}
- --build-and-test
- "${CMake_SOURCE_DIR}/Tests/LoadCommand"
- "${CMake_BINARY_DIR}/Tests/LoadCommand"
- --build-generator ${CMAKE_TEST_GENERATOR}
- --build-project LoadedCommand
- --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
- --build-two-config
- --test-command LoadedCommand)
-
- ADD_TEST(LoadedCommandOneConfig ${CMAKE_CTEST_COMMAND}
- --build-and-test
- "${CMake_SOURCE_DIR}/Tests/LoadCommandOneConfig"
- "${CMake_BINARY_DIR}/Tests/LoadCommandOneConfig"
- --build-generator ${CMAKE_TEST_GENERATOR}
- --build-project LoadedCommand
- --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
- --test-command LoadedCommand
- )
-
- # Como does not seem to support shared libraries.
- GET_FILENAME_COMPONENT(CMAKE_BASE_NAME ${CMAKE_CXX_COMPILER} NAME_WE)
- IF(CMAKE_BASE_NAME MATCHES "^como$")
- SET(COMPILER_IS_COMO 1)
- ENDIF(CMAKE_BASE_NAME MATCHES "^como$")
- IF(NOT COMPILER_IS_COMO)
- ADD_TEST(complex ${CMAKE_CTEST_COMMAND}
- --build-and-test
- "${CMake_SOURCE_DIR}/Tests/Complex"
- "${CMake_BINARY_DIR}/Tests/Complex"
- --build-two-config
- --build-config-sample "${CMAKE_CTEST_COMMAND}"
- --build-generator ${CMAKE_TEST_GENERATOR}
- --build-project Complex
- --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
- --build-exe-dir "${CMake_BINARY_DIR}/Tests/Complex/bin"
- --build-options
- -DCMAKE_TEST_DIFFERENT_GENERATOR:BOOL=${CMAKE_TEST_DIFFERENT_GENERATOR}
- -DCMAKE_TEST_SYSTEM_LIBRARIES:BOOL=${CMAKE_TEST_SYSTEM_LIBRARIES}
- --test-command complex
- )
-
- ADD_TEST(complexOneConfig ${CMAKE_CTEST_COMMAND}
- --build-and-test
- "${CMake_SOURCE_DIR}/Tests/ComplexOneConfig"
- "${CMake_BINARY_DIR}/Tests/ComplexOneConfig"
- --build-generator ${CMAKE_TEST_GENERATOR}
- --build-project Complex
- --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
- --build-exe-dir "${CMake_BINARY_DIR}/Tests/ComplexOneConfig/bin"
- --build-options
- -DCMAKE_TEST_DIFFERENT_GENERATOR:BOOL=${CMAKE_TEST_DIFFERENT_GENERATOR}
- -DCMAKE_TEST_SYSTEM_LIBRARIES:BOOL=${CMAKE_TEST_SYSTEM_LIBRARIES}
- --test-command complex)
-
- ADD_TEST(SetLang ${CMAKE_CTEST_COMMAND}
- --build-and-test
- "${CMake_SOURCE_DIR}/Tests/SetLang"
- "${CMake_BINARY_DIR}/Tests/SetLang"
- --build-two-config
- --build-generator ${CMAKE_TEST_GENERATOR}
- --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
- --build-project SetLang
- --test-command bar)
-
-# ADD_TEST(ConvLibrary ${CMAKE_CTEST_COMMAND}
-# --build-and-test
-# "${CMake_SOURCE_DIR}/Tests/ConvLibrary"
-# "${CMake_BINARY_DIR}/Tests/ConvLibrary"
-# --build-two-config
-# --build-generator ${CMAKE_TEST_GENERATOR}
-# --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
-# --build-project ConvLibrary
-# --test-command bartest)
-
-
-# ADD_TEST(complexRelativePaths ${CMAKE_CTEST_COMMAND}
-# --build-and-test
-# "${CMake_SOURCE_DIR}/Tests/ComplexRelativePaths"
-# "${CMake_BINARY_DIR}/Tests/ComplexRelativePaths"
-# --build-generator ${CMAKE_TEST_GENERATOR}
-# --build-project complex
-# --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
-# --build-exe-dir "${CMake_BINARY_DIR}/Tests/ComplexRelativePaths/bin"
-# --build-options -DCMAKE_USE_RELATIVE_PATHS:BOOL=ON
-# --test-command complex)
-
- ENDIF(NOT COMPILER_IS_COMO)
-
- ADD_TEST(Example ${CMAKE_CTEST_COMMAND}
- --build-and-test
- "${CMake_SOURCE_DIR}/Example"
- "${CMake_BINARY_DIR}/Example"
- --build-generator ${CMAKE_TEST_GENERATOR}
- --build-project HELLO
- --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
- --build-exe-dir "${CMake_BINARY_DIR}/Example/Demo"
- --test-command helloDemo
- )
-
- ADD_TEST(TutorialStep1 ${CMAKE_CTEST_COMMAND}
- --build-and-test
- "${CMake_SOURCE_DIR}/Tests/Tutorial/Step1"
- "${CMake_BINARY_DIR}/Tests/Tutorial/Step1"
- --build-two-config
- --build-generator ${CMAKE_TEST_GENERATOR}
- --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
- --build-project Tutorial
- --test-command Tutorial 25.0)
-
- ADD_TEST(TutorialStep2 ${CMAKE_CTEST_COMMAND}
- --build-and-test
- "${CMake_SOURCE_DIR}/Tests/Tutorial/Step2"
- "${CMake_BINARY_DIR}/Tests/Tutorial/Step2"
- --build-two-config
- --build-generator ${CMAKE_TEST_GENERATOR}
- --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
- --build-project Tutorial
- --test-command Tutorial 25.0)
-
- ADD_TEST(TutorialStep3 ${CMAKE_CTEST_COMMAND}
- --build-and-test
- "${CMake_SOURCE_DIR}/Tests/Tutorial/Step3"
- "${CMake_BINARY_DIR}/Tests/Tutorial/Step3"
- --build-two-config
- --build-generator ${CMAKE_TEST_GENERATOR}
- --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
- --build-project Tutorial
- --test-command Tutorial 25.0)
-
- ADD_TEST(TutorialStep4 ${CMAKE_CTEST_COMMAND}
- --build-and-test
- "${CMake_SOURCE_DIR}/Tests/Tutorial/Step4"
- "${CMake_BINARY_DIR}/Tests/Tutorial/Step4"
- --build-two-config
- --build-generator ${CMAKE_TEST_GENERATOR}
- --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
- --build-project Tutorial
- --test-command Tutorial 25.0)
-
- ADD_TEST(TutorialStep5 ${CMAKE_CTEST_COMMAND}
- --build-and-test
- "${CMake_SOURCE_DIR}/Tests/Tutorial/Step5"
- "${CMake_BINARY_DIR}/Tests/Tutorial/Step5"
- --build-two-config
- --build-generator ${CMAKE_TEST_GENERATOR}
- --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
- --build-project Tutorial
- --test-command Tutorial 25.0)
-
- ADD_TEST(testing ${CMAKE_CTEST_COMMAND}
- --build-and-test
- "${CMake_SOURCE_DIR}/Tests/Testing"
- "${CMake_BINARY_DIR}/Tests/Testing"
- --build-generator ${CMAKE_TEST_GENERATOR}
- --build-project Testing
- --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
- --build-exe-dir "${CMake_BINARY_DIR}/Tests/Testing/bin"
- --test-command testing
- )
-
- ADD_TEST(wrapping ${CMAKE_CTEST_COMMAND}
- --build-and-test
- "${CMake_SOURCE_DIR}/Tests/Wrapping"
- "${CMake_BINARY_DIR}/Tests/Wrapping"
- --build-generator ${CMAKE_TEST_GENERATOR}
- --build-project Wrapping
- --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
- --build-exe-dir "${CMake_BINARY_DIR}/Tests/Wrapping/bin"
- --test-command wrapping
- )
- # use the FindQt3.cmake from this cmake as it may not be in an older version of cmake
- INCLUDE (${CMAKE_SOURCE_DIR}/Modules/FindQt3.cmake)
- MARK_AS_ADVANCED(
- QT_INCLUDE_PATH
- QT_MOC_EXE
- QT_QT_LIBRARY
- QT_UIC_EXE)
-
- IF (QT_FOUND AND QT_WRAP_UI)
- ADD_TEST(qtwrapping ${CMAKE_CTEST_COMMAND}
- --build-and-test
- "${CMake_SOURCE_DIR}/Tests/Wrapping"
- "${CMake_BINARY_DIR}/Tests/Wrapping"
- --build-generator ${CMAKE_TEST_GENERATOR}
- --build-project Wrapping
- --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
- --build-exe-dir "${CMake_BINARY_DIR}/Tests/Wrapping/bin"
- --test-command qtwrapping
- )
- ENDIF (QT_FOUND AND QT_WRAP_UI)
-
- ADD_TEST(testdriver1 ${CMAKE_CTEST_COMMAND}
- --build-and-test
- "${CMake_SOURCE_DIR}/Tests/TestDriver"
- "${CMake_BINARY_DIR}/Tests/TestDriver"
- --build-generator ${CMAKE_TEST_GENERATOR}
- --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
- --build-exe-dir "${CMake_BINARY_DIR}/Tests/Wrapping/bin"
- --build-project TestDriverTest
- --test-command TestDriverTest test1
- )
-
- ADD_TEST(testdriver2 ${CMAKE_CTEST_COMMAND}
- --build-and-test
- "${CMake_SOURCE_DIR}/Tests/TestDriver"
- "${CMake_BINARY_DIR}/Tests/TestDriver"
- --build-generator ${CMAKE_TEST_GENERATOR}
- --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
- --build-exe-dir "${CMake_BINARY_DIR}/Tests/Wrapping/bin"
- --build-project TestDriverTest
- --test-command TestDriverTest test2
- )
-
- ADD_TEST(testdriver3 ${CMAKE_CTEST_COMMAND}
- --build-and-test
- "${CMake_SOURCE_DIR}/Tests/TestDriver"
- "${CMake_BINARY_DIR}/Tests/TestDriver"
- --build-generator ${CMAKE_TEST_GENERATOR}
- --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
- --build-exe-dir "${CMake_BINARY_DIR}/Tests/Wrapping/bin"
- --build-project TestDriverTest
- --test-command TestDriverTest subdir/test3
- )
-
- ADD_TEST(dependency_w_libout ${CMAKE_CTEST_COMMAND}
- --build-and-test
- "${CMake_SOURCE_DIR}/Tests/Dependency"
- "${CMake_BINARY_DIR}/Tests/Dependency/WithLibOut"
- --build-exe-dir "${CMake_BINARY_DIR}/Tests/Dependency/WithLibOut/Exec"
- --build-project Dependency
- --build-generator ${CMAKE_TEST_GENERATOR}
- --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
- --build-options
- -DLIBRARY_OUTPUT_PATH:PATH=${CMake_BINARY_DIR}/Tests/Dependency/WithLibOut/Lib
- --test-command exec
- )
-
-
- ADD_TEST(dependency_wo_lib_out ${CMAKE_CTEST_COMMAND}
- --build-and-test
- "${CMake_SOURCE_DIR}/Tests/Dependency"
- "${CMake_BINARY_DIR}/Tests/Dependency/WOLibOut"
- --build-exe-dir "${CMake_BINARY_DIR}/Tests/Dependency/WOLibOut/Exec"
- --build-generator ${CMAKE_TEST_GENERATOR}
- --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
- --build-project Dependency
- --test-command exec
- )
-
- ADD_TEST(dependency2 ${CMAKE_CTEST_COMMAND}
- --build-and-test
- "${CMake_SOURCE_DIR}/Tests/Dependency"
- "${CMake_BINARY_DIR}/Tests/Dependency/WithLibOut"
- --build-exe-dir "${CMake_BINARY_DIR}/Tests/Dependency/WithLibOut/Exec2"
- --build-generator ${CMAKE_TEST_GENERATOR}
- --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
- --build-project Dependency
- --build-options
- -DLIBRARY_OUTPUT_PATH:PATH=${CMake_BINARY_DIR}/Tests/Dependency/WithLibOut/Lib
- --test-command exec2
- )
-
- ADD_TEST(dependency3 ${CMAKE_CTEST_COMMAND}
- --build-and-test
- "${CMake_SOURCE_DIR}/Tests/Dependency"
- "${CMake_BINARY_DIR}/Tests/Dependency/WithLibOut"
- --build-exe-dir "${CMake_BINARY_DIR}/Tests/Dependency/WithLibOut/Exec3"
- --build-generator ${CMAKE_TEST_GENERATOR}
- --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
- --build-project Dependency
- --build-options
- -DLIBRARY_OUTPUT_PATH:PATH=${CMake_BINARY_DIR}/Tests/Dependency/WithLibOut/Lib
- --test-command exec3)
-
- ADD_TEST(dependency4 ${CMAKE_CTEST_COMMAND}
- --build-and-test
- "${CMake_SOURCE_DIR}/Tests/Dependency"
- "${CMake_BINARY_DIR}/Tests/Dependency/WithLibOut"
- --build-exe-dir "${CMake_BINARY_DIR}/Tests/Dependency/WithLibOut/Exec4"
- --build-generator ${CMAKE_TEST_GENERATOR}
- --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
- --build-project Dependency
- --build-options
- -DLIBRARY_OUTPUT_PATH:PATH=${CMake_BINARY_DIR}/Tests/Dependency/WithLibOut/Lib
- --test-command exec4
- )
-
- ADD_TEST(JumpWithLibOut ${CMAKE_CTEST_COMMAND}
- --build-and-test
- "${CMake_SOURCE_DIR}/Tests/Jump"
- "${CMake_BINARY_DIR}/Tests/Jump/WithLibOut"
- --build-exe-dir "${CMake_BINARY_DIR}/Tests/Jump/WithLibOut/Executable"
- --build-project Jump
- --build-generator ${CMAKE_TEST_GENERATOR}
- --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
- --build-options
- -DLIBRARY_OUTPUT_PATH:PATH=${CMake_BINARY_DIR}/Tests/Jump/WithLibOut/Lib
- --test-command jumpExecutable
- )
-
- ADD_TEST(JumpNoLibOut ${CMAKE_CTEST_COMMAND}
- --build-and-test
- "${CMake_SOURCE_DIR}/Tests/Jump"
- "${CMake_BINARY_DIR}/Tests/Jump/NoLibOut"
- --build-exe-dir "${CMake_BINARY_DIR}/Tests/Jump/NoLibOut/Executable"
- --build-run-dir "${CMake_BINARY_DIR}/Tests/Jump/NoLibOut/Executable"
- --build-project Jump
- --build-generator ${CMAKE_TEST_GENERATOR}
- --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
- --test-command jumpExecutable
- )
-
- ADD_TEST(linkline ${CMAKE_CTEST_COMMAND}
- --build-and-test
- "${CMake_SOURCE_DIR}/Tests/LinkLine"
- "${CMake_BINARY_DIR}/Tests/LinkLine"
- --build-exe-dir "${CMake_BINARY_DIR}/Tests/LinkLine"
- --build-generator ${CMAKE_TEST_GENERATOR}
- --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
- --build-project LinkLine
- --test-command Exec
- )
-
- ADD_TEST(linkorder1 ${CMAKE_CTEST_COMMAND}
- --build-and-test
- "${CMake_SOURCE_DIR}/Tests/LinkLineOrder"
- "${CMake_BINARY_DIR}/Tests/LinkLineOrder"
- --build-generator ${CMAKE_TEST_GENERATOR}
- --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
- --build-exe-dir "${CMake_BINARY_DIR}/Tests/LinkLineOrder"
- --build-project LinkLineOrder
- --test-command Exec1
- )
-
- ADD_TEST(linkorder2 ${CMAKE_CTEST_COMMAND}
- --build-and-test
- "${CMake_SOURCE_DIR}/Tests/LinkLineOrder"
- "${CMake_BINARY_DIR}/Tests/LinkLineOrder"
- --build-exe-dir "${CMake_BINARY_DIR}/Tests/LinkLineOrder"
- --build-generator ${CMAKE_TEST_GENERATOR}
- --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
- --build-project LinkLineOrder
- --test-command Exec2
- )
-
- ADD_TEST(ExternalOBJ ${CMAKE_CTEST_COMMAND}
- --build-and-test
- "${CMake_SOURCE_DIR}/Tests/ExternalOBJ"
- "${CMake_BINARY_DIR}/Tests/ExternalOBJ"
- --build-generator ${CMAKE_TEST_GENERATOR}
- --build-project ExternalOBJ
- --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
- --build-exe-dir "${CMake_BINARY_DIR}/ExternalOBJ"
- --test-command executable
- )
-
- ADD_TEST(Plugin ${CMAKE_CTEST_COMMAND}
- --build-and-test
- "${CMake_SOURCE_DIR}/Tests/Plugin"
- "${CMake_BINARY_DIR}/Tests/Plugin"
- --build-generator ${CMAKE_TEST_GENERATOR}
- --build-project Plugin
- --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
- --build-two-config
- --test-command bin/example)
-
- IF(NOT CMAKE_TEST_DIFFERENT_GENERATOR)
- ADD_TEST(kwsys ${CMAKE_CTEST_COMMAND}
- --build-and-test
- "${CMake_SOURCE_DIR}/Source/kwsys"
- "${CMake_BINARY_DIR}/Tests/kwsys"
- --build-exe-dir "${CMake_BINARY_DIR}/Tests/kwsys"
- --build-generator ${CMAKE_TEST_GENERATOR}
- --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
- --build-project kwsys
- --test-command kwsysTestsCxx testIOS
- )
- ENDIF(NOT CMAKE_TEST_DIFFERENT_GENERATOR)
- SET(MAKE_IS_GNU )
- IF(${CMAKE_TEST_MAKEPROGRAM} MATCHES make)
- EXEC_PROGRAM(
- ${CMAKE_TEST_MAKEPROGRAM} ARGS --version
- RETURN_VALUE res OUTPUT_VARIABLE out
- )
- IF("${res}" EQUAL 0)
- IF("${out}" MATCHES "GNU")
- SET(MAKE_IS_GNU 1)
- ENDIF("${out}" MATCHES "GNU")
- ENDIF("${res}" EQUAL 0)
- ENDIF(${CMAKE_TEST_MAKEPROGRAM} MATCHES make)
-
- # only add this test on platforms that support it
- # some old versions of make simply cannot handle spaces in paths
- IF (MAKE_IS_GNU OR
- "${CMAKE_TEST_MAKEPROGRAM}" MATCHES "nmake|gmake|wmake" OR
- "${CMAKE_TEST_GENERATOR}" MATCHES "Visual Studio|XCode|Borland")
- ADD_TEST(SubDirSpaces ${CMAKE_CTEST_COMMAND}
- --build-and-test
- "${CMake_SOURCE_DIR}/Tests/SubDirSpaces"
- "${CMake_BINARY_DIR}/Tests/SubDirSpaces"
- --build-exe-dir
- "${CMake_BINARY_DIR}/Tests/SubDirSpaces/Executable Sources"
- --build-generator ${CMAKE_TEST_GENERATOR}
- --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
- --build-project SUBDIR
- --test-command test
- "${CMake_BINARY_DIR}/Tests/SubDirSpaces/ShouldBeHere"
- "${CMake_BINARY_DIR}/Tests/SubDirSpaces/testfromsubdir.obj"
- )
- ENDIF (MAKE_IS_GNU OR
- "${CMAKE_TEST_MAKEPROGRAM}" MATCHES "nmake|gmake|wmake" OR
- "${CMAKE_TEST_GENERATOR}" MATCHES "Visual Studio|XCode|Borland")
-
- IF (WIN32)
- ADD_TEST(SubDir ${CMAKE_CTEST_COMMAND}
- --build-and-test
- "${CMake_SOURCE_DIR}/Tests/SubDir"
- "${CMake_BINARY_DIR}/Tests/SubDir"
- --build-exe-dir "${CMake_BINARY_DIR}/Tests/SubDir/Executable"
- --build-generator ${CMAKE_TEST_GENERATOR}
- --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
- --build-project SUBDIR
- --test-command test
- "${CMake_BINARY_DIR}/Tests/SubDir/ShouldBeHere"
- "${CMake_BINARY_DIR}/Tests/SubDir/testfromsubdir.obj"
- )
- ELSE (WIN32)
- ADD_TEST(SubDir ${CMAKE_CTEST_COMMAND}
- --build-and-test
- "${CMake_SOURCE_DIR}/Tests/SubDir"
- "${CMake_BINARY_DIR}/Tests/SubDir"
- --build-exe-dir "${CMake_BINARY_DIR}/Tests/SubDir/Executable"
- --build-generator ${CMAKE_TEST_GENERATOR}
- --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
- --build-project SUBDIR
- --test-command test
- "${CMake_BINARY_DIR}/Tests/SubDir/ShouldBeHere"
- "${CMake_BINARY_DIR}/Tests/SubDir/testfromsubdir.o"
- )
- ENDIF (WIN32)
-
- IF(CMAKE_TEST_MSVC)
- ADD_TEST(PrecompiledHeader ${CMAKE_CTEST_COMMAND}
- --build-and-test
- "${CMake_SOURCE_DIR}/Tests/PrecompiledHeader"
- "${CMake_BINARY_DIR}/Tests/PrecompiledHeader"
- --build-generator ${CMAKE_TEST_GENERATOR}
- --build-project PrecompiledHeader
- --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
- --build-two-config
- --test-command foo)
- ENDIF(CMAKE_TEST_MSVC)
-
- IF("${CMAKE_TEST_GENERATOR}" MATCHES "Makefile")
- ADD_TEST(MakeClean ${CMAKE_CTEST_COMMAND}
- --build-and-test
- "${CMake_SOURCE_DIR}/Tests/MakeClean"
- "${CMake_BINARY_DIR}/Tests/MakeClean"
- --build-generator ${CMAKE_TEST_GENERATOR}
- --build-project MakeClean
- --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
- --build-exe-dir "${CMake_BINARY_DIR}/MakeClean"
- --test-command check_clean
- )
- ENDIF("${CMAKE_TEST_GENERATOR}" MATCHES "Makefile")
-
- IF(${CMAKE_TEST_GENERATOR} MATCHES "Visual Studio")
- ADD_TEST(VSExternalInclude ${CMAKE_CTEST_COMMAND}
- --build-and-test
- "${CMake_SOURCE_DIR}/Tests/VSExternalInclude"
- "${CMake_BINARY_DIR}/Tests/VSExternalInclude"
- --build-two-config
- --build-generator ${CMAKE_TEST_GENERATOR}
- --build-project VSExternalInclude
- --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
- --test-command VSExternalInclude)
- ENDIF(${CMAKE_TEST_GENERATOR} MATCHES "Visual Studio")
-
- IF (APPLE AND CMAKE_COMPILER_IS_GNUCXX)
- SET(BundleTestInstallDir
- "${CMake_BINARY_DIR}/Tests/BundleTest/InstallDirectory")
- ADD_TEST(BundleTest ${CMAKE_CTEST_COMMAND}
- --build-and-test
- "${CMake_SOURCE_DIR}/Tests/BundleTest"
- "${CMake_BINARY_DIR}/Tests/BundleTest"
- --build-two-config
- --build-generator ${CMAKE_TEST_GENERATOR}
- --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
- --build-project BundleTest
- --build-target install
-# --build-target package
- --build-options "-DCMAKE_INSTALL_PREFIX:PATH=${BundleTestInstallDir}"
- "-DCMake_SOURCE_DIR:PATH=${CMAKE_SOURCE_DIR}"
- --test-command
- ${BundleTestInstallDir}/Application/SecondBundleExe.app/Contents/MacOS/SecondBundleExe)
-
- ADD_TEST(objc++ ${CMAKE_CTEST_COMMAND}
- --build-and-test
- "${CMake_SOURCE_DIR}/Tests/ObjC++"
- "${CMake_BINARY_DIR}/Tests/ObjC++"
- --build-generator ${CMAKE_TEST_GENERATOR}
- --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
- --build-project objc++
- --test-command objc++
- )
- ENDIF (APPLE AND CMAKE_COMPILER_IS_GNUCXX)
-
- IF (CTEST_TEST_CTEST AND CMAKE_RUN_LONG_TESTS)
- CONFIGURE_FILE("${CMake_SOURCE_DIR}/Tests/CTestTest/test.cmake.in"
- "${CMake_BINARY_DIR}/Tests/CTestTest/test.cmake" @ONLY ESCAPE_QUOTES)
- ADD_TEST(CTestTest ${CMAKE_CTEST_COMMAND}
- -S "${CMake_BINARY_DIR}/Tests/CTestTest/test.cmake" -V
- --output-log "${CMake_BINARY_DIR}/Tests/CTestTest/testOutput.log"
- )
- CONFIGURE_FILE("${CMake_SOURCE_DIR}/Tests/CTestTest2/test.cmake.in"
- "${CMake_BINARY_DIR}/Tests/CTestTest2/test.cmake" @ONLY ESCAPE_QUOTES)
- ADD_TEST(CTestTest2 ${CMAKE_CTEST_COMMAND}
- -S "${CMake_BINARY_DIR}/Tests/CTestTest2/test.cmake" -V
- --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(COMMAND SET_TESTS_PROPERTIES)
- # if timeouts have not already been set
- GET_TEST_PROPERTY(CTestTest TIMEOUT PREVIOUS_TIMEOUT)
- IF ("${PREVIOUS_TIMEOUT}" MATCHES NOTFOUND)
- SET_TESTS_PROPERTIES ( CTestTest PROPERTIES TIMEOUT 1500)
- ENDIF ("${PREVIOUS_TIMEOUT}" MATCHES NOTFOUND)
-
- GET_TEST_PROPERTY(CTestTest2 TIMEOUT PREVIOUS_TIMEOUT)
- IF ("${PREVIOUS_TIMEOUT}" MATCHES NOTFOUND)
- SET_TESTS_PROPERTIES ( CTestTest2 PROPERTIES TIMEOUT 1500)
- ENDIF ("${PREVIOUS_TIMEOUT}" MATCHES NOTFOUND)
-
- GET_TEST_PROPERTY(CTestTest3 TIMEOUT PREVIOUS_TIMEOUT)
- IF ("${PREVIOUS_TIMEOUT}" MATCHES NOTFOUND)
- SET_TESTS_PROPERTIES ( CTestTest3 PROPERTIES TIMEOUT 1500)
- ENDIF ("${PREVIOUS_TIMEOUT}" MATCHES NOTFOUND)
- ENDIF(COMMAND SET_TESTS_PROPERTIES)
- ENDIF (CTEST_TEST_CTEST AND CMAKE_RUN_LONG_TESTS)
-
- IF("${CMAKE_TEST_GENERATOR}" MATCHES Xcode)
- SET(CMAKE_SKIP_BOOTSTRAP_TEST 1)
- ENDIF("${CMAKE_TEST_GENERATOR}" MATCHES Xcode)
- IF(EXISTS "${CMAKE_BINARY_DIR}/CMakeLists.txt")
- # 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)
-
-
- 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-generator "${CMAKE_TEST_GENERATOR}"
- --test-command
- ${CMake_BINARY_DIR}/Tests/BootstrapTest/Bootstrap.cmk/cmake)
-
- # provide more time for the bootstrap test
- IF (COMMAND GET_TEST_PROPERTY)
- GET_TEST_PROPERTY(BootstrapTest TIMEOUT PREVIOUS_TIMEOUT)
- IF ("${PREVIOUS_TIMEOUT}" MATCHES NOTFOUND)
- SET_TESTS_PROPERTIES ( BootstrapTest PROPERTIES TIMEOUT 1500)
- ENDIF ("${PREVIOUS_TIMEOUT}" MATCHES NOTFOUND)
- ENDIF (COMMAND GET_TEST_PROPERTY)
-
- ENDIF(UNIX AND CMAKE_RUN_LONG_TESTS AND NOT CMAKE_SKIP_BOOTSTRAP_TEST)
-
- # fortran does not work for IDE builds because
- # CMAKE_STANDARD_LIBRARIES needs to be per language
- IF(CMAKE_TEST_GENERATOR MATCHES "Makefiles")
- # see if we can find a fortran compiler on the machine
- # if so, add the fortran test and see if it works.
- SET(CMAKE_Fortran_COMPILER_LIST ifort ifc efc f95 pgf95
- lf95 xlf95 fort gfortran f90 pgf90 xlf90
- epcf90 f77 fort77 frt pgf77 xlf fl32 af77 g77 )
- FIND_PROGRAM(CMAKE_Fortran_COMPILER_FULLPATH NAMES ${CMAKE_Fortran_COMPILER_LIST} )
- MARK_AS_ADVANCED(CMAKE_Fortran_COMPILER_FULLPATH)
- IF(CMAKE_Fortran_COMPILER_FULLPATH)
- ADD_TEST(Fortran ${CMAKE_CTEST_COMMAND}
- --build-and-test
- "${CMake_SOURCE_DIR}/Tests/Fortran"
- "${CMake_BINARY_DIR}/Tests/Fortran"
- --build-generator ${CMAKE_TEST_GENERATOR}
- --build-project testf
- --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
- --build-two-config
- --test-command testf)
- ENDIF(CMAKE_Fortran_COMPILER_FULLPATH)
- ENDIF(CMAKE_TEST_GENERATOR MATCHES "Makefiles")
- IF(NOT CMAKE_TEST_GENERATOR MATCHES "Xcode")
- INCLUDE(FindJava)
- IF(JAVA_COMPILE AND JAVA_RUNTIME AND JAVA_ARCHIVE AND NOT MINGW)
- GET_FILENAME_COMPONENT(JNIPATH ${JAVA_COMPILE} PATH)
- FIND_FILE(JNI_H jni.h
- "${JNIPATH}/../include"
- "${JNIPATH}/../java/include")
- IF(JNI_H)
- FILE(READ "${JNI_H}" JNI_FILE)
- IF("${JNI_FILE}" MATCHES "JDK1_2")
- ADD_TEST(Java ${CMAKE_CTEST_COMMAND}
- --build-and-test
- "${CMake_SOURCE_DIR}/Tests/Java"
- "${CMake_BINARY_DIR}/Tests/Java"
- --build-generator ${CMAKE_TEST_GENERATOR}
- --build-project hello
- --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
- --build-two-config
- --build-run-dir "${CMake_BINARY_DIR}/Tests/Java/"
- --test-command ${JAVA_RUNTIME} -classpath hello.jar HelloWorld)
- ENDIF("${JNI_FILE}" MATCHES "JDK1_2")
- ENDIF(JNI_H)
- ENDIF(JAVA_COMPILE AND JAVA_RUNTIME AND JAVA_ARCHIVE AND NOT MINGW)
- ENDIF(NOT CMAKE_TEST_GENERATOR MATCHES "Xcode")
-
- IF(BUILD_WXDialog AND wxWidgets_CONFIG_EXECUTABLE)
- # Will be set if the WX gui is on
- ADD_TEST(UseWX ${CMAKE_CTEST_COMMAND}
- --build-and-test
- "${CMake_SOURCE_DIR}/Tests/UseWX"
- "${CMake_BINARY_DIR}/Tests/UseWX"
- --build-generator ${CMAKE_TEST_GENERATOR}
- --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
- --build-exe-dir ${CMake_BINARY_DIR}/Tests/UseWX
- --build-project UsewxWidgets
- --build-options -DwxWidgets_CONFIG_EXECUTABLE=${wxWidgets_CONFIG_EXECUTABLE}
- --test-command UseWX
- )
- ENDIF(BUILD_WXDialog AND wxWidgets_CONFIG_EXECUTABLE)
-
- IF(UNIX)
- STRING(COMPARE EQUAL "${CMAKE_INSTALL_PREFIX}" "${CMake_BINARY_DIR}/Tests/TestShellInstall/Prefix"
- PREFIX_IS_FOR_TEST)
- IF(PREFIX_IS_FOR_TEST)
- CONFIGURE_FILE(
- ${CMake_SOURCE_DIR}/Tests/TestInstall.sh.in
- ${CMake_BINARY_DIR}/Tests/TestShellInstall/TestInstall.sh
- @ONLY IMMEDIATE
- )
- ADD_TEST(ShellInstall /bin/sh ${CMake_BINARY_DIR}/Tests/TestShellInstall/TestShellInstall.sh)
- ENDIF(PREFIX_IS_FOR_TEST)
- ENDIF(UNIX)
-
-ENDIF(BUILD_TESTING)
-
INCLUDE (${CMAKE_BINARY_DIR}/Source/LocalUserOptions.cmake OPTIONAL)
INCLUDE (${CMAKE_SOURCE_DIR}/Source/LocalUserOptions.cmake OPTIONAL)
Index: cmMakefileTargetGenerator.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmMakefileTargetGenerator.cxx,v
retrieving revision 1.61
retrieving revision 1.61.2.1
diff -u -d -r1.61 -r1.61.2.1
--- cmMakefileTargetGenerator.cxx 30 Mar 2007 14:53:02 -0000 1.61
+++ cmMakefileTargetGenerator.cxx 17 May 2007 14:24:36 -0000 1.61.2.1
@@ -35,7 +35,7 @@
this->BuildFileStream = 0;
this->InfoFileStream = 0;
this->FlagFileStream = 0;
- this->DriveCustomCommandsOnDepends = false;
+ this->CustomCommandDriver = OnBuild;
}
cmMakefileTargetGenerator *
@@ -788,7 +788,7 @@
commands.push_back(depCmd.str());
// Make sure all custom command outputs in this target are built.
- if(this->DriveCustomCommandsOnDepends)
+ if(this->CustomCommandDriver == OnDepends)
{
this->DriveCustomCommands(depends);
}
@@ -874,6 +874,10 @@
std::vector<std::string> depends;
this->LocalGenerator->AppendCustomDepend(depends, cc);
+ // Add a dependency on the rule file itself.
+ this->LocalGenerator->AppendRuleDepend(depends,
+ this->BuildFileNameFull.c_str());
+
// Check whether we need to bother checking for a symbolic output.
bool need_symbolic = this->GlobalGenerator->GetNeedSymbolicMark();
@@ -919,7 +923,7 @@
// to be created.
std::vector<std::string> commands;
std::vector<std::string> depends;
- std::string emptyCommand = this->GlobalGenerator->GetEmptyCommandHack();
+ std::string emptyCommand = this->GlobalGenerator->GetEmptyRuleHackCommand();
if(!emptyCommand.empty())
{
commands.push_back(emptyCommand);
@@ -1096,7 +1100,7 @@
comment = "Rule to build all files generated by this target.";
// Make sure all custom command outputs in this target are built.
- if(!this->DriveCustomCommandsOnDepends)
+ if(this->CustomCommandDriver == OnBuild)
{
this->DriveCustomCommands(depends);
}
Index: cmTarget.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmTarget.cxx,v
retrieving revision 1.134
retrieving revision 1.134.2.1
diff -u -d -r1.134 -r1.134.2.1
--- cmTarget.cxx 10 Apr 2007 13:54:01 -0000 1.134
+++ cmTarget.cxx 17 May 2007 14:24:36 -0000 1.134.2.1
@@ -408,6 +408,33 @@
}
}
+
+void
+cmTarget
+::CheckForTargetsAsCommand(const std::vector<cmCustomCommand>& commands)
+{
+ for ( std::vector<cmCustomCommand>::const_iterator cli = commands.begin();
+ cli != commands.end();
+ ++cli )
+ {
+ for(cmCustomCommandLines::const_iterator cit =
+ cli->GetCommandLines().begin();
+ cit!=cli->GetCommandLines().end();
+ ++cit )
+ {
+ std::string command = *cit->begin();
+ // see if we can find a target with this name
+ cmTarget* t = this->Makefile->GetLocalGenerator()->
+ GetGlobalGenerator()->FindTarget ( 0, command.c_str() );
+ if ( ( t ) && ( t->GetType() ==cmTarget::EXECUTABLE ) )
+ {
+ this->AddUtility ( command.c_str() );
+ }
+ }
+ }
+}
+
+
void cmTarget::TraceVSDependencies(std::string projFile,
cmMakefile *makefile)
{
@@ -504,6 +531,11 @@
}
}
}
+
+ CheckForTargetsAsCommand(this->GetPreBuildCommands());
+ CheckForTargetsAsCommand(this->GetPreLinkCommands());
+ CheckForTargetsAsCommand(this->GetPostBuildCommands());
+
while (!srcFilesToProcess.empty())
{
// is this source the output of a custom command
@@ -533,9 +565,30 @@
srcFilesQueued.insert(temp);
}
}
+
+ // check if commands for this custom commands are names of targets and
+ // if that's the case add these targets as dependencies
+ std::vector<std::string> automaticTargetDepends;
+ for(cmCustomCommandLines::const_iterator it=
+ outsf->GetCustomCommand()->GetCommandLines().begin();
+ it!=outsf->GetCustomCommand()->GetCommandLines().end();
+ ++it)
+ {
+ const std::string& currentCommand = (*it)[0];
+ // see if we can find a target with this name
+ cmTarget* t = this->Makefile->GetLocalGenerator()->
+ GetGlobalGenerator()->FindTarget(0, currentCommand.c_str());
+ if (( t) && (t->GetType()==cmTarget::EXECUTABLE))
+ {
+ automaticTargetDepends.push_back(currentCommand);
+ }
+ }
+ outsf->GetCustomCommand()->AppendDepends(automaticTargetDepends);
+
// add its dependencies to the list to check
- unsigned int i;
- for (i = 0; i < outsf->GetCustomCommand()->GetDepends().size(); ++i)
+ for (unsigned int i = 0;
+ i < outsf->GetCustomCommand()->GetDepends().size();
+ ++i)
{
const std::string& fullName
= outsf->GetCustomCommand()->GetDepends()[i];
@@ -590,6 +643,7 @@
}
}
}
+
}
// finished with this SF move to the next
srcFilesToProcess.pop();
@@ -1249,21 +1303,24 @@
const char* lang = this->Makefile->GetLocalGenerator()->
GetGlobalGenerator()->
GetLanguageFromExtension(sf->GetSourceExtension().c_str());
- std::string lookupObj = objExtensionLookup1 + lang;
- lookupObj += objExtensionLookup2;
- const char* obj = this->Makefile->GetDefinition(lookupObj.c_str());
- if(obj)
+ if (lang)
{
- if(objectFiles.size())
+ std::string lookupObj = objExtensionLookup1 + lang;
+ lookupObj += objExtensionLookup2;
+ const char* obj = this->Makefile->GetDefinition(lookupObj.c_str());
+ if(obj)
{
- objectFiles += ";";
+ if(objectFiles.size())
+ {
+ objectFiles += ";";
+ }
+ std::string objFile = *d;
+ objFile += "/";
+ objFile += this->Makefile->GetLocalGenerator()->
+ GetSourceObjectName(*sf);
+ objFile += obj;
+ objectFiles += objFile;
}
- std::string objFile = *d;
- objFile += "/";
- objFile += this->Makefile->GetLocalGenerator()->
- GetSourceObjectName(*sf);
- objFile += obj;
- objectFiles += objFile;
}
}
}
@@ -1634,6 +1691,14 @@
{
targetSuffix = this->Makefile->GetSafeDefinition(suffixVar);
}
+#if defined(__APPLE__)
+ // frameworks do not have a prefix or a suffix
+ if(this->GetPropertyAsBool("FRAMEWORK"))
+ {
+ targetPrefix = 0;
+ targetSuffix = 0;
+ }
+#endif
// Begin the final name with the prefix.
outPrefix = targetPrefix?targetPrefix:"";
@@ -2145,7 +2210,6 @@
// Default to the current output directory.
out = ".";
}
-
// Convert the output path to a full path in case it is
// specified as a relative path. Treat a relative path as
// relative to the current output directory for this makefile.
@@ -2153,6 +2217,16 @@
cmSystemTools::CollapseFullPath
(out.c_str(), this->Makefile->GetStartOutputDirectory());
+#if defined(__APPLE__)
+ // frameworks do not have a prefix or a suffix
+ if(this->GetPropertyAsBool("FRAMEWORK"))
+ {
+ out += "/";
+ out += this->GetFullName(0, implib);
+ out += ".framework";
+ }
+#endif
+
// Make sure the output path exists on disk.
if(!cmSystemTools::MakeDirectory(out.c_str()))
{
Index: cmLocalUnixMakefileGenerator3.h
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmLocalUnixMakefileGenerator3.h,v
retrieving revision 1.69
retrieving revision 1.69.2.1
diff -u -d -r1.69 -r1.69.2.1
--- cmLocalUnixMakefileGenerator3.h 8 Mar 2007 19:57:28 -0000 1.69
+++ cmLocalUnixMakefileGenerator3.h 17 May 2007 14:24:36 -0000 1.69.2.1
@@ -177,6 +177,9 @@
/** used to create a recursive make call */
std::string GetRecursiveMakeCall(const char *makefile, const char* tgt);
+ // append flags to a string
+ virtual void AppendFlags(std::string& flags, const char* newFlags);
+
// append an echo command
enum EchoColor { EchoNormal, EchoDepend, EchoBuild, EchoLink,
EchoGenerate, EchoGlobal };
Index: cmGlobalXCodeGenerator.h
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmGlobalXCodeGenerator.h,v
retrieving revision 1.45
retrieving revision 1.45.2.1
diff -u -d -r1.45 -r1.45.2.1
--- cmGlobalXCodeGenerator.h 8 Mar 2007 20:24:01 -0000 1.45
+++ cmGlobalXCodeGenerator.h 17 May 2007 14:24:36 -0000 1.45.2.1
@@ -106,6 +106,15 @@
std::vector<cmCustomCommand>
const & commands,
const char* commandFileName);
+
+ void CreateCustomRulesMakefile(const char* makefileBasename,
+ cmTarget& target,
+ std::vector<cmCustomCommand> const & commands,
+ const char* configName,
+ const std::map<cmStdString, cmStdString>&
+ multipleOutputPairs
+ );
+
cmXCodeObject* FindXCodeTarget(cmTarget*);
// create cmXCodeObject from these functions so that memory can be managed
// correctly. All objects created are stored in this->XCodeObjects.
@@ -148,6 +157,7 @@
cmXCodeObject* dependTarget);
void CreateXCodeDependHackTarget(std::vector<cmXCodeObject*>& targets);
bool SpecialTargetEmitted(std::string const& tname);
+ void SetGenerationRoot(cmLocalGenerator* root);
void AddExtraTargets(cmLocalGenerator* root,
std::vector<cmLocalGenerator*>& gens);
cmXCodeObject* CreateBuildPhase(const char* name,
@@ -177,7 +187,6 @@
std::string CurrentReRunCMakeMakefile;
std::string CurrentXCodeHackMakefile;
std::string CurrentProject;
- std::string OutputDir;
std::set<cmStdString> TargetDoneSet;
std::vector<std::string> CurrentOutputDirectoryComponents;
std::vector<std::string> ProjectOutputDirectoryComponents;
Index: cmLocalVisualStudioGenerator.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmLocalVisualStudioGenerator.cxx,v
retrieving revision 1.10
retrieving revision 1.10.2.1
diff -u -d -r1.10 -r1.10.2.1
--- cmLocalVisualStudioGenerator.cxx 16 Feb 2007 21:12:16 -0000 1.10
+++ cmLocalVisualStudioGenerator.cxx 17 May 2007 14:24:36 -0000 1.10.2.1
@@ -111,6 +111,7 @@
cmLocalVisualStudioGenerator
::ConstructScript(const cmCustomCommandLines& commandLines,
const char* workingDirectory,
+ const char* configName,
bool escapeOldStyle,
bool escapeAllowMakeVars,
const char* newline_text)
@@ -152,13 +153,15 @@
// Start with the command name.
const cmCustomCommandLine& commandLine = *cl;
+ std::string commandName = this->GetRealLocation(commandLine[0].c_str(),
+ configName);
if(!workingDirectory)
{
- script += this->Convert(commandLine[0].c_str(),START_OUTPUT,SHELL);
+ script += this->Convert(commandName.c_str(),START_OUTPUT,SHELL);
}
else
{
- script += this->Convert(commandLine[0].c_str(),NONE,SHELL);
+ script += this->Convert(commandName.c_str(),NONE,SHELL);
}
// Add the arguments.
Index: cmTryRunCommand.h
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmTryRunCommand.h,v
retrieving revision 1.9
retrieving revision 1.9.4.1
diff -u -d -r1.9 -r1.9.4.1
--- cmTryRunCommand.h 13 Dec 2005 20:12:37 -0000 1.9
+++ cmTryRunCommand.h 17 May 2007 14:24:36 -0000 1.9.4.1
@@ -68,7 +68,7 @@
"Try compiling a srcfile. Return the success or failure in "
"COMPILE_RESULT_VAR. Then if the compile succeeded, run the "
"executable and return the result in RUN_RESULT_VAR. "
- "If the executable was built, but failed for to run for some "
+ "If the executable was built, but failed to run for some"
"reason, then RUN_RESULT_VAR will be set to FAILED_TO_RUN, and "
"the output will be in the COMPILE_RESULT_VAR. OUTPUT_VARIABLE "
"specifies the name of the variable to put all of the standard "
Index: cmGlobalXCodeGenerator.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmGlobalXCodeGenerator.cxx,v
retrieving revision 1.142
retrieving revision 1.142.2.1
diff -u -d -r1.142 -r1.142.2.1
--- cmGlobalXCodeGenerator.cxx 30 Mar 2007 14:53:02 -0000 1.142
+++ cmGlobalXCodeGenerator.cxx 17 May 2007 14:24:36 -0000 1.142.2.1
@@ -223,27 +223,44 @@
//----------------------------------------------------------------------------
void cmGlobalXCodeGenerator::Generate()
{
- this->cmGlobalGenerator::Generate();
std::map<cmStdString, std::vector<cmLocalGenerator*> >::iterator it;
+ // make sure extra targets are added before calling
+ // the parent generate which will call trace depends
for(it = this->ProjectMap.begin(); it!= this->ProjectMap.end(); ++it)
{
cmLocalGenerator* root = it->second[0];
- this->CurrentProject = root->GetMakefile()->GetProjectName();
- this->SetCurrentLocalGenerator(root);
- this->OutputDir = this->CurrentMakefile->GetHomeOutputDirectory();
- this->OutputDir =
- cmSystemTools::CollapseFullPath(this->OutputDir.c_str());
- cmSystemTools::SplitPath(this->OutputDir.c_str(),
- this->ProjectOutputDirectoryComponents);
- this->CurrentLocalGenerator = root;
+ this->SetGenerationRoot(root);
// add ALL_BUILD, INSTALL, etc
this->AddExtraTargets(root, it->second);
+ }
+ this->cmGlobalGenerator::Generate();
+ for(it = this->ProjectMap.begin(); it!= this->ProjectMap.end(); ++it)
+ {
+ cmLocalGenerator* root = it->second[0];
+ this->SetGenerationRoot(root);
// now create the project
this->OutputXCodeProject(root, it->second);
}
}
//----------------------------------------------------------------------------
+void cmGlobalXCodeGenerator::SetGenerationRoot(cmLocalGenerator* root)
+{
+ this->CurrentProject = root->GetMakefile()->GetProjectName();
+ this->SetCurrentLocalGenerator(root);
+ std::string outDir = this->CurrentMakefile->GetHomeOutputDirectory();
+ outDir =cmSystemTools::CollapseFullPath(outDir.c_str());
+ cmSystemTools::SplitPath(outDir.c_str(),
+ this->ProjectOutputDirectoryComponents);
+
+ this->CurrentXCodeHackMakefile =
+ root->GetMakefile()->GetCurrentOutputDirectory();
+ this->CurrentXCodeHackMakefile += "/CMakeScripts";
+ cmSystemTools::MakeDirectory(this->CurrentXCodeHackMakefile.c_str());
+ this->CurrentXCodeHackMakefile += "/XCODE_DEPEND_HELPER.make";
+}
+
+//----------------------------------------------------------------------------
void
cmGlobalXCodeGenerator::AddExtraTargets(cmLocalGenerator* root,
std::vector<cmLocalGenerator*>& gens)
@@ -259,10 +276,6 @@
// Add XCODE depend helper
std::string dir = mf->GetCurrentOutputDirectory();
- this->CurrentXCodeHackMakefile = dir;
- this->CurrentXCodeHackMakefile += "/CMakeScripts";
- cmSystemTools::MakeDirectory(this->CurrentXCodeHackMakefile.c_str());
- this->CurrentXCodeHackMakefile += "/XCODE_DEPEND_HELPER.make";
cmCustomCommandLine makecommand;
makecommand.push_back("make");
makecommand.push_back("-C");
@@ -419,6 +432,7 @@
lg->AppendFlags(flags, cmtarget.GetProperty("COMPILE_FLAGS"));
}
lg->AppendFlags(flags, sf->GetProperty("COMPILE_FLAGS"));
+ cmSystemTools::ReplaceString(flags, "\"", "\\\"");
cmXCodeObject* fileRef =
this->CreateObject(cmXCodeObject::PBXFileReference);
@@ -577,16 +591,17 @@
{
continue;
}
+
+ if(cmtarget.GetType() == cmTarget::UTILITY ||
+ cmtarget.GetType() == cmTarget::GLOBAL_TARGET)
+ {
+ targets.push_back(this->CreateUtilityTarget(cmtarget));
+ }
if(cmtarget.GetType() == cmTarget::UTILITY ||
cmtarget.GetType() == cmTarget::GLOBAL_TARGET ||
cmtarget.GetType() == cmTarget::INSTALL_FILES ||
cmtarget.GetType() == cmTarget::INSTALL_PROGRAMS)
{
- if(cmtarget.GetType() == cmTarget::UTILITY ||
- cmtarget.GetType() == cmTarget::GLOBAL_TARGET)
- {
- targets.push_back(this->CreateUtilityTarget(cmtarget));
- }
continue;
}
@@ -849,6 +864,7 @@
}
return retFlag;
}
+
//----------------------------------------------------------------------------
void
cmGlobalXCodeGenerator::AddCommandsToBuildPhase(cmXCodeObject* buildphase,
@@ -872,8 +888,31 @@
return;
}
+ // collect multiple outputs of custom commands into a set
+ // which will be used for every configuration
std::map<cmStdString, cmStdString> multipleOutputPairs;
-
+ for(std::vector<cmCustomCommand>::const_iterator i = commands.begin();
+ i != commands.end(); ++i)
+ {
+ cmCustomCommand const& cc = *i;
+ if(!cc.GetCommandLines().empty())
+ {
+ const std::vector<std::string>& outputs = cc.GetOutputs();
+ if(!outputs.empty())
+ {
+ // If there are more than one outputs treat the
+ // first as the primary output and make the rest depend on it.
+ std::vector<std::string>::const_iterator o = outputs.begin();
+ std::string primaryOutput = this->ConvertToRelativeForMake(o->c_str());
+ for(++o; o != outputs.end(); ++o)
+ {
+ std::string currentOutput=this->ConvertToRelativeForMake(o->c_str());
+ multipleOutputPairs[currentOutput] = primaryOutput;
+ }
+ }
+ }
+ }
+
std::string dir = this->CurrentMakefile->GetCurrentOutputDirectory();
dir += "/CMakeScripts";
cmSystemTools::MakeDirectory(dir.c_str());
@@ -883,7 +922,50 @@
makefile += "_";
makefile += name;
makefile += ".make";
- cmGeneratedFileStream makefileStream(makefile.c_str());
+
+ for (std::vector<std::string>::const_iterator currentConfig=
+ this->CurrentConfigurationTypes.begin();
+ currentConfig!=this->CurrentConfigurationTypes.end();
+ currentConfig++ )
+ {
+ this->CreateCustomRulesMakefile(makefile.c_str(),
+ target,
+ commands,
+ currentConfig->c_str(),
+ multipleOutputPairs);
+ }
+
+ std::string cdir = this->CurrentMakefile->GetCurrentOutputDirectory();
+ cdir = this->ConvertToRelativeForXCode(cdir.c_str());
+ std::string makecmd = "make -C ";
+ makecmd += cdir;
+ makecmd += " -f ";
+ makecmd += this->ConvertToRelativeForMake(
+ (makefile+"$CONFIGURATION").c_str());
+ if(!multipleOutputPairs.empty())
+ {
+ makecmd += " cmake_check_multiple_outputs";
+ }
+ makecmd += " all";
+ cmSystemTools::ReplaceString(makecmd, "\\ ", "\\\\ ");
+ buildphase->AddAttribute("shellScript",
+ this->CreateString(makecmd.c_str()));
+}
+
+//----------------------------------------------------------------------------
+void cmGlobalXCodeGenerator
+::CreateCustomRulesMakefile(const char* makefileBasename,
+ cmTarget& target,
+ std::vector<cmCustomCommand>
+ const & commands,
+ const char* configName,
+ const std::map<cmStdString,
+ cmStdString>& multipleOutputPairs
+ )
+{
+ std::string makefileName=makefileBasename;
+ makefileName+=configName;
+ cmGeneratedFileStream makefileStream(makefileName.c_str());
if(!makefileStream)
{
return;
@@ -909,7 +991,7 @@
o != outputs.end(); ++o)
{
makefileStream
- << "\\\n\t" << this->ConvertToRelativeForMake(o->c_str());
+ << "\\\n\t" << this->ConvertToRelativeForMake(o->c_str());
}
}
else
@@ -939,21 +1021,9 @@
const std::vector<std::string>& outputs = cc.GetOutputs();
if(!outputs.empty())
{
- // There is at least one output. If there is more than one treat the
- // first as the primary output and make the rest depend on it.
- std::vector<std::string>::const_iterator o = outputs.begin();
+ // There is at least one output, start the rule for it
std::string primary_output =
- this->ConvertToRelativeForMake(o->c_str());
- for(++o; o != outputs.end(); ++o)
- {
- std::string current_output =
- this->ConvertToRelativeForMake(o->c_str());
- makefileStream << current_output << ": "
- << primary_output << "\n";
- multipleOutputPairs[current_output] = primary_output;
- }
-
- // Start the rule for the primary output.
+ this->ConvertToRelativeForMake(outputs.begin()->c_str());
makefileStream << primary_output << ": ";
}
else
@@ -962,11 +1032,11 @@
makefileStream << tname[&cc] << ": ";
}
for(std::vector<std::string>::const_iterator d =
- cc.GetDepends().begin();
+ cc.GetDepends().begin();
d != cc.GetDepends().end(); ++d)
{
if(!this->FindTarget(this->CurrentProject.c_str(),
- d->c_str()))
+ d->c_str()))
{
// if the depend is not a target but
// is a full path then use it, if not then
@@ -974,7 +1044,7 @@
if(cmSystemTools::FileIsFullPath(d->c_str()))
{
makefileStream << "\\\n" << this
- ->ConvertToRelativeForMake(d->c_str());
+ ->ConvertToRelativeForMake(d->c_str());
}
}
else
@@ -989,12 +1059,14 @@
// Add each command line to the set of commands.
for(cmCustomCommandLines::const_iterator cl =
- cc.GetCommandLines().begin();
+ cc.GetCommandLines().begin();
cl != cc.GetCommandLines().end(); ++cl)
{
// Build the command line in a single string.
const cmCustomCommandLine& commandLine = *cl;
- std::string cmd2 = commandLine[0];
+ std::string cmd2 = this->CurrentLocalGenerator
+ ->GetRealLocation(commandLine[0].c_str(), configName);
+
cmSystemTools::ReplaceString(cmd2, "/./", "/");
cmd2 = this->ConvertToRelativeForMake(cmd2.c_str());
std::string cmd;
@@ -1011,13 +1083,13 @@
if(escapeOldStyle)
{
cmd += (this->CurrentLocalGenerator
- ->EscapeForShellOldStyle(commandLine[j].c_str()));
+ ->EscapeForShellOldStyle(commandLine[j].c_str()));
}
else
{
cmd += (this->CurrentLocalGenerator->
- EscapeForShell(commandLine[j].c_str(),
- escapeAllowMakeVars));
+ EscapeForShell(commandLine[j].c_str(),
+ escapeAllowMakeVars));
}
}
makefileStream << "\t" << cmd.c_str() << "\n";
@@ -1025,38 +1097,31 @@
}
}
- // Add a rule to deal with multiple outputs of custom commands.
+ // Add rules to deal with multiple outputs of custom commands.
if(!multipleOutputPairs.empty())
{
+ makefileStream <<
+ "\n# Dependencies of multiple outputs to their primary outputs \n";
+
+ for(std::map<cmStdString, cmStdString>::const_iterator o =
+ multipleOutputPairs.begin(); o != multipleOutputPairs.end(); ++o)
+ {
+ makefileStream << o->first << ": " << o->second << "\n";
+ }
+
makefileStream <<
- "\n"
- "cmake_check_multiple_outputs:\n";
+ "\n"
+ "cmake_check_multiple_outputs:\n";
for(std::map<cmStdString, cmStdString>::const_iterator o =
- multipleOutputPairs.begin(); o != multipleOutputPairs.end(); ++o)
+ multipleOutputPairs.begin(); o != multipleOutputPairs.end(); ++o)
{
makefileStream << "\t at if [ ! -f "
- << o->first << " ]; then rm -f "
- << o->second << "; fi\n";
+ << o->first << " ]; then rm -f "
+ << o->second << "; fi\n";
}
}
-
- std::string cdir = this->CurrentMakefile->GetCurrentOutputDirectory();
- cdir = this->ConvertToRelativeForXCode(cdir.c_str());
- std::string makecmd = "make -C ";
- makecmd += cdir;
- makecmd += " -f ";
- makecmd += this->ConvertToRelativeForMake(makefile.c_str());
- if(!multipleOutputPairs.empty())
- {
- makecmd += " cmake_check_multiple_outputs";
- }
- makecmd += " all";
- cmSystemTools::ReplaceString(makecmd, "\\ ", "\\\\ ");
- buildphase->AddAttribute("shellScript",
- this->CreateString(makecmd.c_str()));
}
-
//----------------------------------------------------------------------------
void cmGlobalXCodeGenerator::CreateBuildSettings(cmTarget& target,
cmXCodeObject* buildSettings,
@@ -1151,6 +1216,11 @@
target.GetType() == cmTarget::EXECUTABLE)
{
std::string pndir = target.GetDirectory();
+ if(target.GetPropertyAsBool("FRAMEWORK"))
+ {
+ pndir += "/..";
+ pndir = cmSystemTools::CollapseFullPath(pndir.c_str());
+ }
buildSettings->AddAttribute("SYMROOT",
this->CreateString(pndir.c_str()));
buildSettings->AddAttribute("EXECUTABLE_PREFIX",
@@ -1213,6 +1283,12 @@
}
case cmTarget::SHARED_LIBRARY:
{
+ if(target.GetPropertyAsBool("FRAMEWORK"))
+ {
+ fileType = "wrapper.framework";
+ productType = "com.apple.product-type.framework";
+ break;
+ }
fileType = "compiled.mach-o.dylib";
productType = "com.apple.product-type.library.dynamic";
@@ -1407,7 +1483,17 @@
{
// Get the install_name directory for the build tree.
install_name_dir = target.GetInstallNameDirForBuildTree(configName);
-
+ if(target.GetPropertyAsBool("FRAMEWORK"))
+ {
+ if(install_name_dir.find(".framework") != install_name_dir.npos)
+ {
+ install_name_dir = install_name_dir + "/..";
+ install_name_dir =
+ cmSystemTools::CollapseFullPath(install_name_dir.c_str());
+ std::cerr << "new install name " << install_name_dir << "\n";
+ }
+ }
+
if(install_name_dir.empty())
{
// Xcode will not pass the -install_name option at all if INSTALL_PATH
@@ -1873,11 +1959,41 @@
// now add the link libraries
if(cmtarget->GetType() != cmTarget::STATIC_LIBRARY)
{
+ std::string fdirs;
+ std::set<cmStdString> emitted;
+ emitted.insert("/System/Library/Frameworks");
for(std::vector<cmStdString>::iterator lib = libNames.begin();
lib != libNames.end(); ++lib)
{
- this->AppendBuildSettingAttribute(target, "OTHER_LDFLAGS",
- lib->c_str(), configName);
+ std::string& libString = *lib;
+ // check to see if this is a -F framework path and extract it if it is
+ // -F framework stuff should be in the FRAMEWORK_SEARCH_PATHS and not
+ // OTHER_LDFLAGS
+ if(libString.size() > 2 && libString[0] == '-'
+ && libString[1] == 'F')
+ {
+ std::string path = libString.substr(2);
+ // remove escaped spaces from the path
+ cmSystemTools::ReplaceString(path, "\\ ", " ");
+ if(emitted.insert(path).second)
+ {
+ if(fdirs.size())
+ {
+ fdirs += " ";
+ }
+ fdirs += this->XCodeEscapePath(path.c_str());
+ }
+ }
+ else
+ {
+ this->AppendBuildSettingAttribute(target, "OTHER_LDFLAGS",
+ lib->c_str(), configName);
+ }
+ }
+ if(fdirs.size())
+ {
+ this->AppendBuildSettingAttribute(target, "FRAMEWORK_SEARCH_PATHS",
+ fdirs.c_str(), configName);
}
}
}
@@ -2365,20 +2481,6 @@
cmMakefile* mf = (*g)->GetMakefile();
std::vector<cmSourceGroup> sourceGroups = mf->GetSourceGroups();
cmTargets &tgts = mf->GetTargets();
- // Call TraceVSDependencies on all targets
- for(cmTargets::iterator l = tgts.begin();
- l != tgts.end(); l++)
- {
- // INCLUDE_EXTERNAL_MSPROJECT command only affects the workspace
- // so don't build a projectfile for it
- if ((l->second.GetType() != cmTarget::INSTALL_FILES)
- && (l->second.GetType() != cmTarget::INSTALL_PROGRAMS)
- && (strncmp(l->first.c_str(), "INCLUDE_EXTERNAL_MSPROJECT", 26) != 0))
- {
- cmTarget& target = l->second;
- target.TraceVSDependencies(target.GetName(), mf);
- }
- }
// now for all custom commands that are not used directly in a
// target, add them to all targets in the current directory or
// makefile
@@ -2582,10 +2684,22 @@
{
if(config)
{
-
- dir += prefix;
- dir += config;
- dir += suffix;
+ if(dir.find(".framework") != dir.npos)
+ {
+ std::string::size_type pos = dir.rfind("/");
+ std::string framework = dir.substr(pos);
+ std::string newDir;
+ newDir = dir.substr(0, pos);
+ newDir += "/";
+ newDir += config;
+ dir = newDir;
+ }
+ else
+ {
+ dir += prefix;
+ dir += config;
+ dir += suffix;
+ }
}
}
}
Index: cmLocalVisualStudio6Generator.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmLocalVisualStudio6Generator.cxx,v
retrieving revision 1.120
retrieving revision 1.120.2.1
diff -u -d -r1.120 -r1.120.2.1
--- cmLocalVisualStudio6Generator.cxx 28 Mar 2007 03:13:25 -0000 1.120
+++ cmLocalVisualStudio6Generator.cxx 17 May 2007 14:24:36 -0000 1.120.2.1
@@ -32,13 +32,16 @@
{
}
-
-void cmLocalVisualStudio6Generator::Generate()
-{
+void cmLocalVisualStudio6Generator::AddHelperCommands()
+{
std::set<cmStdString> lang;
lang.insert("C");
lang.insert("CXX");
this->CreateCustomTargetsAndCommands(lang);
+}
+
+void cmLocalVisualStudio6Generator::Generate()
+{
this->OutputDSPFile();
}
@@ -116,16 +119,6 @@
{
this->AddDSPBuildRule(l->second);
}
-
- // INCLUDE_EXTERNAL_MSPROJECT command only affects the workspace
- // so don't build a projectfile for it
- if ((l->second.GetType() != cmTarget::INSTALL_FILES)
- && (l->second.GetType() != cmTarget::INSTALL_PROGRAMS)
- && (strncmp(l->first.c_str(), "INCLUDE_EXTERNAL_MSPROJECT", 26) != 0))
- {
- cmTarget& target = l->second;
- target.TraceVSDependencies(target.GetName(), this->Makefile);
- }
}
// build any targets
@@ -490,23 +483,8 @@
}
if (command)
{
- std::string script =
- this->ConstructScript(command->GetCommandLines(),
- command->GetWorkingDirectory(),
- command->GetEscapeOldStyle(),
- command->GetEscapeAllowMakeVars(),
- "\\\n\t");
- std::string comment =
- this->ConstructComment(*command,
- "Building Custom Rule $(InputPath)");
- if(comment == "<hack>")
- {
- comment = "";
- }
const char* flags = compileFlags.size() ? compileFlags.c_str(): 0;
- this->WriteCustomRule(fout, source.c_str(), script.c_str(),
- comment.c_str(), command->GetDepends(),
- command->GetOutputs(), flags);
+ this->WriteCustomRule(fout, source.c_str(), *command, flags);
}
else if(!compileFlags.empty() || !objectNameDir.empty())
{
@@ -603,16 +581,29 @@
cmLocalVisualStudio6Generator
::WriteCustomRule(std::ostream& fout,
const char* source,
- const char* command,
- const char* comment,
- const std::vector<std::string>& depends,
- const std::vector<std::string>& outputs,
+ const cmCustomCommand& command,
const char* flags)
{
+ std::string comment =
+ this->ConstructComment(command, "Building Custom Rule $(InputPath)");
+ if(comment == "<hack>")
+ {
+ comment = "";
+ }
+
// Write the rule for each configuration.
std::vector<std::string>::iterator i;
for(i = this->Configurations.begin(); i != this->Configurations.end(); ++i)
{
+
+ std::string script =
+ this->ConstructScript(command.GetCommandLines(),
+ command.GetWorkingDirectory(),
+ i->c_str(),
+ command.GetEscapeOldStyle(),
+ command.GetEscapeAllowMakeVars(),
+ "\\\n\t");
+
if (i == this->Configurations.begin())
{
fout << "!IF \"$(CFG)\" == " << i->c_str() << std::endl;
@@ -627,8 +618,10 @@
}
// Write out the dependencies for the rule.
fout << "USERDEP__HACK=";
- for(std::vector<std::string>::const_iterator d = depends.begin();
- d != depends.end(); ++d)
+ for(std::vector<std::string>::const_iterator d =
+ command.GetDepends().begin();
+ d != command.GetDepends().end();
+ ++d)
{
// Lookup the real name of the dependency in case it is a CMake target.
std::string dep = this->GetRealDependency(d->c_str(), i->c_str());
@@ -639,26 +632,28 @@
fout << "# PROP Ignore_Default_Tool 1\n";
fout << "# Begin Custom Build -";
- if(comment && *comment)
+ if(!comment.empty())
{
- fout << " " << comment;
+ fout << " " << comment.c_str();
}
fout << "\n\n";
- if(outputs.empty())
+ if(command.GetOutputs().empty())
{
fout << source
<< "_force : \"$(SOURCE)\" \"$(INTDIR)\" \"$(OUTDIR)\"\n\t";
- fout << command << "\n\n";
+ fout << script.c_str() << "\n\n";
}
else
{
- for(std::vector<std::string>::const_iterator o = outputs.begin();
- o != outputs.end(); ++o)
+ for(std::vector<std::string>::const_iterator o =
+ command.GetOutputs().begin();
+ o != command.GetOutputs().end();
+ ++o)
{
// Write a rule for every output generated by this command.
fout << this->ConvertToOptionallyRelativeOutputPath(o->c_str())
<< " : \"$(SOURCE)\" \"$(INTDIR)\" \"$(OUTDIR)\"\n\t";
- fout << command << "\n\n";
+ fout << script.c_str() << "\n\n";
}
}
fout << "# End Custom Build\n\n";
@@ -768,6 +763,7 @@
// look for custom rules on a target and collect them together
std::string
cmLocalVisualStudio6Generator::CreateTargetRules(cmTarget &target,
+ const char* configName,
const char * /* libName */)
{
std::string customRuleCode = "";
@@ -808,6 +804,7 @@
}
customRuleCode += this->ConstructScript(cr->GetCommandLines(),
cr->GetWorkingDirectory(),
+ configName,
cr->GetEscapeOldStyle(),
cr->GetEscapeAllowMakeVars(),
"\\\n\t");
@@ -822,6 +819,7 @@
}
customRuleCode += this->ConstructScript(cr->GetCommandLines(),
cr->GetWorkingDirectory(),
+ configName,
cr->GetEscapeOldStyle(),
cr->GetEscapeAllowMakeVars(),
"\\\n\t");
@@ -850,6 +848,7 @@
}
customRuleCode += this->ConstructScript(cr->GetCommandLines(),
cr->GetWorkingDirectory(),
+ configName,
cr->GetEscapeOldStyle(),
cr->GetEscapeAllowMakeVars(),
"\\\n\t");
@@ -1274,7 +1273,14 @@
// are there any custom rules on the target itself
// only if the target is a lib or exe
- std::string customRuleCode = this->CreateTargetRules(target, libName);
+ std::string customRuleCodeRelease
+ = this->CreateTargetRules(target, "RELEASE", libName);
+ std::string customRuleCodeDebug
+ = this->CreateTargetRules(target, "DEBUG", libName);
+ std::string customRuleCodeMinSizeRel
+ = this->CreateTargetRules(target, "MINSIZEREL", libName);
+ std::string customRuleCodeRelWithDebInfo
+ = this->CreateTargetRules(target, "RELWITHDEBINFO", libName);
std::ifstream fin(this->DSPHeaderTemplate.c_str());
if(!fin)
@@ -1307,8 +1313,6 @@
}
cmSystemTools::ReplaceString(line, "OUTPUT_LIBNAME_EXPORTS",
exportSymbol.c_str());
- cmSystemTools::ReplaceString(line, "CMAKE_CUSTOM_RULE_CODE",
- customRuleCode.c_str());
cmSystemTools::ReplaceString(line, "CMAKE_MFC_FLAG",
mfcFlag);
if(target.GetType() == cmTarget::STATIC_LIBRARY )
@@ -1337,6 +1341,18 @@
cmSystemTools::ReplaceString(line, "CM_MULTILINE_OPTIMIZED_LIBRARIES",
libMultiLineOptimizedOptions.c_str());
#endif
+
+ // Substitute the rules for custom command. When specifying just the
+ // target name for the command the command can be different for
+ // different configs
+ cmSystemTools::ReplaceString(line, "CMAKE_CUSTOM_RULE_CODE_RELEASE",
+ customRuleCodeRelease.c_str());
+ cmSystemTools::ReplaceString(line, "CMAKE_CUSTOM_RULE_CODE_DEBUG",
+ customRuleCodeDebug.c_str());
+ cmSystemTools::ReplaceString(line, "CMAKE_CUSTOM_RULE_CODE_MINSIZEREL",
+ customRuleCodeMinSizeRel.c_str());
+ cmSystemTools::ReplaceString(line, "CMAKE_CUSTOM_RULE_CODE_RELWITHDEBINFO",
+ customRuleCodeRelWithDebInfo.c_str());
// Substitute the real output name into the template.
cmSystemTools::ReplaceString(line, "OUTPUT_NAME_DEBUG",
Index: cmIncludeCommand.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmIncludeCommand.cxx,v
retrieving revision 1.18.2.3
retrieving revision 1.18.2.4
diff -u -d -r1.18.2.3 -r1.18.2.4
--- cmIncludeCommand.cxx 15 May 2007 17:30:39 -0000 1.18.2.3
+++ cmIncludeCommand.cxx 17 May 2007 14:24:36 -0000 1.18.2.4
@@ -20,7 +20,7 @@
// cmIncludeCommand
bool cmIncludeCommand::InitialPass(std::vector<std::string> const& args)
{
- if (args.size()< 1 || args.size() > 3)
+ if (args.size()< 1 || args.size() > 4)
{
this->SetError("called with wrong number of arguments. "
"Include only takes one file.");
@@ -41,18 +41,34 @@
}
optional = true;
}
- else
+ else if(args[i] == "RESULT_VARIABLE")
{
if (resultVarName.size() > 0)
{
this->SetError("called with invalid arguments: "
- "only one variable allowed");
+ "only one result variable allowed");
+ return false;
+ }
+ if(++i < args.size())
+ {
+ resultVarName = args[i];
+ }
+ else
+ {
+ this->SetError("called with no value for RESULT_VARIABLE.");
return false;
}
- resultVarName = args[i];
}
+ else if(i > 1) // compat.: in previous cmake versions the second
+ // parameter was ignore if it wasn't "OPTIONAL"
+ {
+ std::string errorText = "called with invalid argument: ";
+ errorText += args[i];
+ this->SetError(errorText.c_str());
+ return false;
+ }
}
-
+
if(!cmSystemTools::FileIsFullPath(fname.c_str()))
{
// Not a path. Maybe module.
Index: cmGlobalUnixMakefileGenerator3.h
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmGlobalUnixMakefileGenerator3.h,v
retrieving revision 1.39
retrieving revision 1.39.2.1
diff -u -d -r1.39 -r1.39.2.1
--- cmGlobalUnixMakefileGenerator3.h 12 Apr 2007 19:46:14 -0000 1.39
+++ cmGlobalUnixMakefileGenerator3.h 17 May 2007 14:24:36 -0000 1.39.2.1
@@ -111,9 +111,9 @@
check-build-system step. */
virtual void CheckMultipleOutputs(cmMakefile* mf, bool verbose);
- /** Get the command to use for a non-symbolic target file that has
- no rule. This is used for multiple output dependencies. */
- std::string GetEmptyCommandHack() { return this->EmptyCommandsHack; }
+ /** Get the command to use for a target that has no rule. This is
+ used for multiple output dependencies and for cmake_force. */
+ std::string GetEmptyRuleHackCommand() { return this->EmptyRuleHackCommand; }
/** Get the fake dependency to use when a rule has no real commands
or dependencies. */
@@ -175,11 +175,10 @@
// that can be added.
std::string EmptyRuleHackDepends;
- // Some make programs (Watcom) do not like rules with no commands
- // for non-symbolic targets. If non-empty this variable holds a
- // bogus command that may be put in the rule to satisfy the make
- // program.
- std::string EmptyCommandsHack;
+ // Some make programs (Watcom) do not like rules with no commands.
+ // If non-empty this variable holds a bogus command that may be put
+ // in the rule to satisfy the make program.
+ std::string EmptyRuleHackCommand;
typedef std::map<cmStdString, cmStdString> MultipleOutputPairsType;
MultipleOutputPairsType MultipleOutputPairs;
Index: cmMakefileExecutableTargetGenerator.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmMakefileExecutableTargetGenerator.cxx,v
retrieving revision 1.33
retrieving revision 1.33.2.1
diff -u -d -r1.33 -r1.33.2.1
--- cmMakefileExecutableTargetGenerator.cxx 18 Apr 2007 03:39:47 -0000 1.33
+++ cmMakefileExecutableTargetGenerator.cxx 17 May 2007 14:24:36 -0000 1.33.2.1
@@ -27,7 +27,7 @@
//----------------------------------------------------------------------------
cmMakefileExecutableTargetGenerator::cmMakefileExecutableTargetGenerator()
{
- this->DriveCustomCommandsOnDepends = true;
+ this->CustomCommandDriver = OnDepends;
}
//----------------------------------------------------------------------------
Index: cmCustomCommand.h
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmCustomCommand.h,v
retrieving revision 1.20
retrieving revision 1.20.2.1
diff -u -d -r1.20 -r1.20.2.1
--- cmCustomCommand.h 4 Oct 2006 19:24:24 -0000 1.20
+++ cmCustomCommand.h 17 May 2007 14:24:36 -0000 1.20.2.1
@@ -69,8 +69,8 @@
void SetEscapeAllowMakeVars(bool b);
/** set get the used status of the command */
- void SetUsed() { this->Used = true;};
- bool IsUsed() { return this->Used;};
+ void SetUsed() { this->Used = true;}
+ bool IsUsed() const { return this->Used;}
private:
std::vector<std::string> Outputs;
Index: cmGlobalVisualStudio6Generator.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmGlobalVisualStudio6Generator.cxx,v
retrieving revision 1.67
retrieving revision 1.67.2.1
diff -u -d -r1.67 -r1.67.2.1
--- cmGlobalVisualStudio6Generator.cxx 10 Apr 2007 17:09:03 -0000 1.67
+++ cmGlobalVisualStudio6Generator.cxx 17 May 2007 14:24:36 -0000 1.67.2.1
@@ -208,9 +208,8 @@
static_cast<cmLocalVisualStudio6Generator *>(generators[i])
->GetCreatedProjectNames();
cmTargets &tgts = generators[i]->GetMakefile()->GetTargets();
- cmTargets::iterator l = tgts.begin();
- for(std::vector<std::string>::iterator si = dspnames.begin();
- l != tgts.end(); ++l)
+ std::vector<std::string>::iterator si = dspnames.begin();
+ for(cmTargets::iterator l = tgts.begin(); l != tgts.end(); ++l)
{
// special handling for the current makefile
if(mf == generators[0]->GetMakefile())
Index: cmMakefileLibraryTargetGenerator.h
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmMakefileLibraryTargetGenerator.h,v
retrieving revision 1.3
retrieving revision 1.3.2.1
diff -u -d -r1.3 -r1.3.2.1
--- cmMakefileLibraryTargetGenerator.h 28 Sep 2006 20:40:35 -0000 1.3
+++ cmMakefileLibraryTargetGenerator.h 17 May 2007 14:24:36 -0000 1.3.2.1
@@ -35,6 +35,19 @@
void WriteModuleLibraryRules(bool relink);
void WriteLibraryRules(const char *linkRule, const char *extraFlags,
bool relink);
+ // MacOSX Framework support methods
+ void WriteFrameworkRules(bool relink);
+ void CreateFramework(std::string& targetName,
+ std::string& outpath);
+ void CreateFrameworkLinksAndDirs(std::string& targetName,
+ std::string& outpath,
+ const char* version);
+ void CopyFrameworkPublicHeaders(std::string& targetName,
+ std::string& outpath,
+ const char* version);
+ void CopyFrameworkResources(std::string& targetName,
+ std::string& outpath,
+ const char* version);
};
#endif
Index: cmMakefile.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmMakefile.cxx,v
retrieving revision 1.383.2.1
retrieving revision 1.383.2.2
diff -u -d -r1.383.2.1 -r1.383.2.2
--- cmMakefile.cxx 11 May 2007 20:25:09 -0000 1.383.2.1
+++ cmMakefile.cxx 17 May 2007 14:24:36 -0000 1.383.2.2
@@ -447,7 +447,6 @@
// push the listfile onto the stack
this->ListFileStack.push_back(filenametoread);
-
if(fullPath!=0)
{
*fullPath=filenametoread;
@@ -455,6 +454,8 @@
cmListFile cacheFile;
if( !cacheFile.ParseFile(filenametoread, requireProjectCommand) )
{
+ // pop the listfile off the stack
+ this->ListFileStack.pop_back();
if(fullPath!=0)
{
fullPath->clear();
@@ -585,18 +586,6 @@
ti->second.GetPostBuildCommands().push_back(cc);
break;
}
-
- // Add dependencies on commands CMake knows how to build.
- for(cmCustomCommandLines::const_iterator cli = commandLines.begin();
- cli != commandLines.end(); ++cli)
- {
- std::string cacheCommand = *cli->begin();
- if(const char* knownTarget =
- this->GetCacheManager()->GetCacheValue(cacheCommand.c_str()))
- {
- ti->second.AddUtility(knownTarget);
- }
- }
}
}
@@ -2762,17 +2751,20 @@
std::string cmMakefile::GetListFileStack()
{
- std::string tmp;
- for (std::deque<cmStdString>::iterator i = this->ListFileStack.begin();
- i != this->ListFileStack.end(); ++i)
+ cmOStringStream tmp;
+ size_t depth = this->ListFileStack.size();
+ std::deque<cmStdString>::iterator it = this->ListFileStack.end();
+ do
{
- if (i != this->ListFileStack.begin())
- {
- tmp += ";";
- }
- tmp += *i;
+ --it;
+ tmp << "\n[";
+ tmp << depth;
+ tmp << "]\t";
+ tmp << *it;
+ depth--;
}
- return tmp;
+ while (it != this->ListFileStack.begin());
+ return tmp.str();
}
// define properties
Index: cmLocalGenerator.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmLocalGenerator.cxx,v
retrieving revision 1.212.2.2
retrieving revision 1.212.2.3
diff -u -d -r1.212.2.2 -r1.212.2.3
--- cmLocalGenerator.cxx 15 May 2007 17:30:39 -0000 1.212.2.2
+++ cmLocalGenerator.cxx 17 May 2007 14:24:36 -0000 1.212.2.3
@@ -52,6 +52,7 @@
this->UseRelativePaths = false;
this->Configured = false;
this->EmitUniversalBinaryFlags = true;
+ this->IsMakefileGenerator = false;
this->RelativePathsConfigured = false;
this->PathConversionsSetup = false;
}
@@ -135,6 +136,30 @@
this->Makefile->ConfigureFinalPass();
}
+void cmLocalGenerator::TraceDependencies()
+{
+ // Generate the rule files for each target.
+ cmTargets& targets = this->Makefile->GetTargets();
+ for(cmTargets::iterator t = targets.begin(); t != targets.end(); ++t)
+ {
+ // INCLUDE_EXTERNAL_MSPROJECT command only affects the workspace
+ // so don't build a projectfile for it
+ if ((t->second.GetType() != cmTarget::INSTALL_FILES)
+ && (t->second.GetType() != cmTarget::INSTALL_PROGRAMS)
+ && (t->second.GetType() != cmTarget::INSTALL_DIRECTORY)
+ && (strncmp(t->first.c_str(), "INCLUDE_EXTERNAL_MSPROJECT", 26) != 0)
+ && (t->second.GetPropertyAsBool("IMPORTED") == false))
+ {
+ std::string projectFilename;
+ if (this->IsMakefileGenerator == false) // only use of this variable
+ {
+ projectFilename=t->second.GetName();
+ }
+ t->second.TraceVSDependencies(projectFilename, this->Makefile);
+ }
+ }
+}
+
void cmLocalGenerator::GenerateTestFiles()
{
if ( !this->Makefile->IsOn("CMAKE_TESTING_ENABLED") )
@@ -1486,6 +1511,8 @@
// Some search paths should never be emitted
emitted.insert("");
emitted.insert("/usr/lib");
+ emitted.insert("/usr/lib32");
+ emitted.insert("/usr/lib64");
std::string libPathFlag =
this->Makefile->GetRequiredDefinition("CMAKE_LIBRARY_PATH_FLAG");
std::string libLinkFlag =
@@ -1728,8 +1755,16 @@
// off the per-configuration subdirectory. The link directory
// ordering knows how to deal with this.
linkItem += tgt->GetDirectory(0, implib);
- linkItem += "/";
- linkItem += tgt->GetFullName(config, implib);
+ // on apple if the FRAMEWORK prop is set, then
+ // do not add the target full name but just use the directory
+ // name
+#ifdef __APPLE__
+ if(!tgt->GetPropertyAsBool("FRAMEWORK"))
+#endif
+ {
+ linkItem += "/";
+ linkItem += tgt->GetFullName(config, implib);
+ }
}
linkLibraries.push_back(linkItem);
// For full path, use the true location.
@@ -1979,6 +2014,20 @@
}
//----------------------------------------------------------------------------
+std::string cmLocalGenerator::GetRealLocation(const char* inName,
+ const char* config)
+{
+ std::string outName=inName;
+ // Look for a CMake target with the given name.
+ cmTarget* target = this->GlobalGenerator->FindTarget(0, inName);
+ if ((target!=0) && (target->GetType()==cmTarget::EXECUTABLE))
+ {
+ outName = target->GetLocation( config );
+ }
+ return outName;
+}
+
+//----------------------------------------------------------------------------
void cmLocalGenerator::AddSharedFlags(std::string& flags,
const char* lang,
bool shared)
@@ -2027,6 +2076,7 @@
{
if(newFlags && *newFlags)
{
+ std::string newf = newFlags;
if(flags.size())
{
flags += " ";
Index: cmLocalVisualStudio6Generator.h
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmLocalVisualStudio6Generator.h,v
retrieving revision 1.16
retrieving revision 1.16.2.1
diff -u -d -r1.16 -r1.16.2.1
--- cmLocalVisualStudio6Generator.h 16 Feb 2007 21:12:16 -0000 1.16
+++ cmLocalVisualStudio6Generator.h 17 May 2007 14:24:36 -0000 1.16.2.1
@@ -38,7 +38,9 @@
cmLocalVisualStudio6Generator();
virtual ~cmLocalVisualStudio6Generator();
-
+
+ virtual void AddHelperCommands();
+
/**
* Generate the makefile for this directory.
*/
@@ -84,10 +86,7 @@
void AddDSPBuildRule(cmTarget& tgt);
void WriteCustomRule(std::ostream& fout,
const char* source,
- const char* command,
- const char* comment,
- const std::vector<std::string>& depends,
- const std::vector<std::string>& outputs,
+ const cmCustomCommand& command,
const char* flags);
void AddUtilityCommandHack(cmTarget& target, int count,
std::vector<std::string>& depends,
@@ -95,6 +94,7 @@
void WriteGroup(const cmSourceGroup *sg, cmTarget target,
std::ostream &fout, const char *libName);
std::string CreateTargetRules(cmTarget &target,
+ const char* configName,
const char *libName);
void ComputeLinkOptions(cmTarget& target, const char* configName,
const std::string extraOptions,
Index: cmMakefileUtilityTargetGenerator.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmMakefileUtilityTargetGenerator.cxx,v
retrieving revision 1.5
retrieving revision 1.5.2.1
diff -u -d -r1.5 -r1.5.2.1
--- cmMakefileUtilityTargetGenerator.cxx 2 Mar 2007 19:31:04 -0000 1.5
+++ cmMakefileUtilityTargetGenerator.cxx 17 May 2007 14:24:36 -0000 1.5.2.1
@@ -26,10 +26,9 @@
//----------------------------------------------------------------------------
cmMakefileUtilityTargetGenerator::cmMakefileUtilityTargetGenerator()
{
- this->DriveCustomCommandsOnDepends = true;
+ this->CustomCommandDriver = OnUtility;
}
-
//----------------------------------------------------------------------------
void cmMakefileUtilityTargetGenerator::WriteRuleFiles()
{
@@ -49,39 +48,24 @@
this->LocalGenerator->AppendCustomDepends
(depends, this->Target->GetPreBuildCommands());
- // Build list of dependencies.
- std::string relPath = this->LocalGenerator->GetHomeRelativeOutputPath();
- std::string objTarget;
-
this->LocalGenerator->AppendCustomDepends
(depends, this->Target->GetPostBuildCommands());
this->LocalGenerator->AppendCustomCommands
(commands, this->Target->GetPreBuildCommands());
-
+
// Depend on all custom command outputs for sources
- const std::vector<cmSourceFile*>& sources =
- this->Target->GetSourceFiles();
- for(std::vector<cmSourceFile*>::const_iterator source = sources.begin();
- source != sources.end(); ++source)
- {
- if(cmCustomCommand* cc = (*source)->GetCustomCommand())
- {
- this->LocalGenerator->AppendCustomCommand(commands, *cc);
- this->LocalGenerator->AppendCustomDepend(depends, *cc);
- }
- }
+ this->DriveCustomCommands(depends);
this->LocalGenerator->AppendCustomCommands
(commands, this->Target->GetPostBuildCommands());
// Add dependencies on targets that must be built first.
this->AppendTargetDepends(depends);
-
+
// Add a dependency on the rule file itself.
- objTarget = relPath;
- objTarget += this->BuildFileName;
- this->LocalGenerator->AppendRuleDepend(depends, objTarget.c_str());
+ this->LocalGenerator->AppendRuleDepend(depends,
+ this->BuildFileNameFull.c_str());
// If the rule is empty add the special empty rule dependency needed
// by some make tools.
Index: cmGlobalGenerator.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmGlobalGenerator.cxx,v
retrieving revision 1.173.2.1
retrieving revision 1.173.2.2
diff -u -d -r1.173.2.1 -r1.173.2.2
--- cmGlobalGenerator.cxx 14 May 2007 20:28:07 -0000 1.173.2.1
+++ cmGlobalGenerator.cxx 17 May 2007 14:24:36 -0000 1.173.2.2
@@ -717,7 +717,12 @@
}
// at this point this->LocalGenerators has been filled,
// so create the map from project name to vector of local generators
- this->FillProjectMap();
+ this->FillProjectMap();
+ // now create project to target map
+ // This will make sure that targets have all the
+ // targets they depend on as part of the build.
+ this->FillProjectToTargetMap();
+
if ( !this->CMakeInstance->GetScriptMode() )
{
this->CMakeInstance->UpdateProgress("Configuring done", -1);
@@ -728,6 +733,19 @@
{
// For each existing cmLocalGenerator
unsigned int i;
+
+ // Add generator specific helper commands
+ for (i = 0; i < this->LocalGenerators.size(); ++i)
+ {
+ this->LocalGenerators[i]->AddHelperCommands();
+ }
+
+ // Trace the dependencies, after that no custom commands should be added
+ // because their dependencies might not be handled correctly
+ for (i = 0; i < this->LocalGenerators.size(); ++i)
+ {
+ this->LocalGenerators[i]->TraceDependencies();
+ }
// Consolidate global targets
cmTargets globalTargets;
@@ -1036,7 +1054,6 @@
return "None";
}
-
void cmGlobalGenerator::FillProjectMap()
{
this->ProjectMap.clear(); // make sure we start with a clean map
@@ -1057,10 +1074,6 @@
}
while (lg);
}
- // now create project to target map
- // This will make sure that targets have all the
- // targets they depend on as part of the build.
- this->FillProjectToTargetMap();
}
@@ -1416,10 +1429,6 @@
cfgArg += mf->GetDefinition("CMAKE_CFG_INTDIR");
singleLine.push_back(cfgArg);
}
- if(mf->IsOn("CMAKE_INSTALL_DO_STRIP"))
- {
- singleLine.push_back("-DCMAKE_INSTALL_DO_STRIP=1");
- }
singleLine.push_back("-P");
singleLine.push_back("cmake_install.cmake");
cpackCommandLines.push_back(singleLine);
Index: cmGlobalWatcomWMakeGenerator.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmGlobalWatcomWMakeGenerator.cxx,v
retrieving revision 1.11
retrieving revision 1.11.2.1
diff -u -d -r1.11 -r1.11.2.1
--- cmGlobalWatcomWMakeGenerator.cxx 21 Feb 2007 17:19:51 -0000 1.11
+++ cmGlobalWatcomWMakeGenerator.cxx 17 May 2007 14:24:36 -0000 1.11.2.1
@@ -24,7 +24,7 @@
this->ForceUnixPaths = false;
this->ToolSupportsColor = true;
this->NeedSymbolicMark = true;
- this->EmptyCommandsHack = "@cd .";
+ this->EmptyRuleHackCommand = "@cd .";
}
void cmGlobalWatcomWMakeGenerator
Index: cmFindBase.h
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmFindBase.h,v
retrieving revision 1.9.2.1
retrieving revision 1.9.2.2
diff -u -d -r1.9.2.1 -r1.9.2.2
--- cmFindBase.h 1 May 2007 20:25:03 -0000 1.9.2.1
+++ cmFindBase.h 17 May 2007 14:24:36 -0000 1.9.2.2
@@ -39,12 +39,12 @@
virtual const char* GetFullDocumentation()
{return this->GenericDocumentation.c_str();}
- enum PrefixMode { PrefixModeBoth, PrefixModeOnlyPrefix, PrefixModeNoPrefix };
+ enum RootPathMode { RootPathModeBoth, RootPathModeOnlyRootPath, RootPathModeNoRootPath };
protected:
void PrintFindStuff();
void ExpandPaths(std::vector<std::string> userPaths);
- void HandleCMakeFindPrefix();
+ void HandleCMakeFindRootPath();
// add to the SearchPaths
void AddPaths(std::vector<std::string>& paths);
@@ -79,7 +79,7 @@
bool NoCMakeEnvironmentPath;
bool NoSystemEnvironmentPath;
bool NoCMakeSystemPath;
- PrefixMode FindPrefixMode;
+ RootPathMode FindRootPathMode;
bool SearchFrameworkFirst;
bool SearchFrameworkOnly;
Index: cmGlobalVisualStudio7Generator.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmGlobalVisualStudio7Generator.cxx,v
retrieving revision 1.85
retrieving revision 1.85.2.1
diff -u -d -r1.85 -r1.85.2.1
--- cmGlobalVisualStudio7Generator.cxx 10 Apr 2007 17:09:03 -0000 1.85
+++ cmGlobalVisualStudio7Generator.cxx 17 May 2007 14:24:36 -0000 1.85.2.1
@@ -294,8 +294,7 @@
// than one dsp could have been created per input CMakeLists.txt file
// for each target
cmTargets &tgts = generators[i]->GetMakefile()->GetTargets();
- cmTargets::iterator l = tgts.begin();
- for(; l != tgts.end(); ++l)
+ for (cmTargets::iterator l = tgts.begin(); l != tgts.end(); ++l)
{
// special handling for the current makefile
if(mf == generators[0]->GetMakefile())
Index: cmCommands.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmCommands.cxx,v
retrieving revision 1.110
retrieving revision 1.110.2.1
diff -u -d -r1.110 -r1.110.2.1
--- cmCommands.cxx 11 Apr 2007 19:13:05 -0000 1.110
+++ cmCommands.cxx 17 May 2007 14:24:36 -0000 1.110.2.1
@@ -16,7 +16,6 @@
=========================================================================*/
#include "cmCommands.h"
#if defined(CMAKE_BUILD_WITH_CMAKE)
-#include "cmAddSubDirectoryCommand.cxx"
#include "cmAuxSourceDirectoryCommand.cxx"
#include "cmBuildNameCommand.cxx"
#include "cmDefinePropertyCommand.cxx"
@@ -70,7 +69,6 @@
)
{
#if defined(CMAKE_BUILD_WITH_CMAKE)
- commands.push_back(new cmAddSubDirectoryCommand);
commands.push_back(new cmAuxSourceDirectoryCommand);
commands.push_back(new cmBuildNameCommand);
commands.push_back(new cmDefinePropertyCommand);
Index: cmLocalGenerator.h
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmLocalGenerator.h,v
retrieving revision 1.78.2.2
retrieving revision 1.78.2.3
diff -u -d -r1.78.2.2 -r1.78.2.3
--- cmLocalGenerator.h 15 May 2007 17:30:39 -0000 1.78.2.2
+++ cmLocalGenerator.h 17 May 2007 14:24:36 -0000 1.78.2.3
@@ -42,7 +42,7 @@
/**
* Generate the makefile for this directory.
*/
- virtual void Generate() {};
+ virtual void Generate() {}
/**
* Process the CMakeLists files for this directory to fill in the
@@ -50,6 +50,13 @@
*/
virtual void Configure();
+ /**
+ * Calls TraceVSDependencies() on all targets of this generator.
+ */
+ virtual void TraceDependencies();
+
+ virtual void AddHelperCommands() {}
+
/**
* Perform any final calculations prior to generation
*/
@@ -124,7 +131,7 @@
void AddSharedFlags(std::string& flags, const char* lang, bool shared);
void AddConfigVariableFlags(std::string& flags, const char* var,
const char* config);
- void AppendFlags(std::string& flags, const char* newFlags);
+ virtual void AppendFlags(std::string& flags, const char* newFlags);
///! Get the include flags for the current makefile and language
const char* GetIncludeFlags(const char* lang);
@@ -137,6 +144,11 @@
the source directory of this generator. This should only be
used for dependencies of custom commands. */
std::string GetRealDependency(const char* name, const char* config);
+
+ /** Translate a command as given in CMake code to the location of the
+ executable if the command is the name of a CMake executable target.
+ If that's not the case, just return the original name. */
+ std::string GetRealLocation(const char* inName, const char* config);
///! for existing files convert to output path and short path if spaces
std::string ConvertToOutputForExisting(const char* p);
@@ -241,11 +253,10 @@
// Expand rule variables in CMake of the type found in language rules
void ExpandRuleVariables(std::string& string,
const RuleVariables& replaceValues);
-
// Expand rule variables in a single string
std::string ExpandRuleVariable(std::string const& variable,
const RuleVariables& replaceValues);
-
+
/** Convert a target to a utility target for unsupported
* languages of a generator */
void AddBuildTargetRule(const char* llang, cmTarget& target);
@@ -299,6 +310,8 @@
bool IgnoreLibPrefix;
bool Configured;
bool EmitUniversalBinaryFlags;
+ // A type flag is not nice. It's used only in TraceDependencies().
+ bool IsMakefileGenerator;
// Hack for ExpandRuleVariable until object-oriented version is
// committed.
std::string TargetImplib;
Index: cmBootstrapCommands.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmBootstrapCommands.cxx,v
retrieving revision 1.9
retrieving revision 1.9.2.1
diff -u -d -r1.9 -r1.9.2.1
--- cmBootstrapCommands.cxx 3 Mar 2007 17:16:35 -0000 1.9
+++ cmBootstrapCommands.cxx 17 May 2007 14:24:36 -0000 1.9.2.1
@@ -25,6 +25,7 @@
#include "cmAddDependenciesCommand.cxx"
#include "cmAddExecutableCommand.cxx"
#include "cmAddLibraryCommand.cxx"
+#include "cmAddSubDirectoryCommand.cxx"
#include "cmAddTestCommand.cxx"
#include "cmBuildCommand.cxx"
#include "cmCMakeMinimumRequired.cxx"
@@ -76,6 +77,7 @@
commands.push_back(new cmAddDependenciesCommand);
commands.push_back(new cmAddExecutableCommand);
commands.push_back(new cmAddLibraryCommand);
+ commands.push_back(new cmAddSubDirectoryCommand);
commands.push_back(new cmAddTestCommand);
commands.push_back(new cmBuildCommand);
commands.push_back(new cmCMakeMinimumRequired);
Index: cmMakefileTargetGenerator.h
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmMakefileTargetGenerator.h,v
retrieving revision 1.14
retrieving revision 1.14.2.1
diff -u -d -r1.14 -r1.14.2.1
--- cmMakefileTargetGenerator.h 9 Mar 2007 16:29:15 -0000 1.14
+++ cmMakefileTargetGenerator.h 17 May 2007 14:24:36 -0000 1.14.2.1
@@ -129,7 +129,8 @@
cmGlobalUnixMakefileGenerator3 *GlobalGenerator;
cmMakefile *Makefile;
- bool DriveCustomCommandsOnDepends;
+ enum CustomCommandDriveType { OnBuild, OnDepends, OnUtility };
+ CustomCommandDriveType CustomCommandDriver;
// the full path to the build file
std::string BuildFileName;
Index: cmLocalUnixMakefileGenerator3.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmLocalUnixMakefileGenerator3.cxx,v
retrieving revision 1.204
retrieving revision 1.204.2.1
diff -u -d -r1.204 -r1.204.2.1
--- cmLocalUnixMakefileGenerator3.cxx 19 Mar 2007 14:00:35 -0000 1.204
+++ cmLocalUnixMakefileGenerator3.cxx 17 May 2007 14:24:36 -0000 1.204.2.1
@@ -54,6 +54,7 @@
this->NativeEchoCommand = "@echo ";
this->NativeEchoWindows = true;
this->MakeCommandEscapeTargetTwice = false;
+ this->IsMakefileGenerator = true;
}
//----------------------------------------------------------------------------
@@ -112,7 +113,7 @@
if (tg)
{
this->TargetGenerators.push_back(tg);
- t->second.TraceVSDependencies(empty, this->Makefile);
+// t->second.TraceVSDependencies(empty, this->Makefile);
tg->WriteRuleFiles();
}
}
@@ -713,6 +714,11 @@
{
no_depends.push_back(hack);
}
+ std::string hack_cmd = gg->GetEmptyRuleHackCommand();
+ if(!hack_cmd.empty())
+ {
+ no_commands.push_back(hack_cmd);
+ }
// Special symbolic target that never exists to force dependers to
// run their rules.
@@ -805,6 +811,23 @@
//----------------------------------------------------------------------------
+void cmLocalUnixMakefileGenerator3::AppendFlags(std::string& flags,
+ const char* newFlags)
+{
+ if(this->WatcomWMake && newFlags && *newFlags)
+ {
+ std::string newf = newFlags;
+ if(newf.find("\\\"") != newf.npos)
+ {
+ cmSystemTools::ReplaceString(newf, "\\\"", "\"");
+ this->cmLocalGenerator::AppendFlags(flags, newf.c_str());
+ return;
+ }
+ }
+ this->cmLocalGenerator::AppendFlags(flags, newFlags);
+}
+
+//----------------------------------------------------------------------------
void
cmLocalUnixMakefileGenerator3
::AppendRuleDepend(std::vector<std::string>& depends,
@@ -885,7 +908,8 @@
{
// Build the command line in a single string.
const cmCustomCommandLine& commandLine = *cl;
- std::string cmd = commandLine[0];
+ std::string cmd = GetRealLocation(commandLine[0].c_str(),
+ this->ConfigurationName.c_str());
if (cmd.size())
{
cmSystemTools::ReplaceString(cmd, "/./", "/");
Index: cmIncludeCommand.h
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmIncludeCommand.h,v
retrieving revision 1.14.4.2
retrieving revision 1.14.4.3
diff -u -d -r1.14.4.2 -r1.14.4.3
--- cmIncludeCommand.h 15 May 2007 17:30:39 -0000 1.14.4.2
+++ cmIncludeCommand.h 17 May 2007 14:24:36 -0000 1.14.4.3
@@ -68,13 +68,13 @@
virtual const char* GetFullDocumentation()
{
return
- " INCLUDE(file1 [OPTIONAL] [<VAR>])\n"
- " INCLUDE(module [OPTIONAL] [<VAR>])\n"
+ " INCLUDE(file1 [OPTIONAL] [RESULT_VARIABLE <VAR>])\n"
+ " INCLUDE(module [OPTIONAL] [RESULT_VARIABLE <VAR>])\n"
"Reads CMake listfile code from the given file. Commands in the file "
"are processed immediately as if they were written in place of the "
"INCLUDE command. If OPTIONAL is present, then no error "
- "is raised if the file does not exist. If additionally "
- "a variable is given, it will be set to the full filename which "
+ "is raised if the file does not exist. If RESULT_VARIABLE is given "
+ "the variable will be set to the full filename which "
"has been included or NOTFOUND if it failed.\n"
"If a module is specified instead of a file, the file with name "
"<modulename>.cmake is searched in the CMAKE_MODULE_PATH.";
More information about the Cmake-commits
mailing list