Generate modern-style cmake code.

The commits 9db31162 (Remove CMake-language block-end command
arguments, 2012-08-13) and 77543bde (Convert CMake-language
commands to lower case, 2012-08-13) changed most cmake code
to use lowercase commands and no parameters in termination
commands. However, those changes excluded cmake code generated
in c++ by cmake.

Make a similar style change to code generated by cmake.
This commit is contained in:
Stephen Kelly 2013-08-22 11:30:19 +02:00
parent 7324eb896e
commit 33055c405e
15 changed files with 137 additions and 136 deletions

View File

@ -249,7 +249,7 @@ public:
/** /**
* The name of the command as specified in CMakeList.txt. * The name of the command as specified in CMakeList.txt.
*/ */
virtual const char* GetName() const { return "ADD_TEST";} virtual const char* GetName() const { return "add_test";}
// Unused methods // Unused methods
virtual const char* GetTerseDocumentation() const { return ""; } virtual const char* GetTerseDocumentation() const { return ""; }
@ -297,7 +297,7 @@ public:
/** /**
* The name of the command as specified in CMakeList.txt. * The name of the command as specified in CMakeList.txt.
*/ */
virtual const char* GetName() const { return "SET_TESTS_PROPERTIES";} virtual const char* GetName() const { return "set_tests_properties";}
// Unused methods // Unused methods
virtual const char* GetTerseDocumentation() const { return ""; } virtual const char* GetTerseDocumentation() const { return ""; }

View File

@ -294,7 +294,7 @@ int cmCoreTryCompile::TryCompileCode(std::vector<std::string> const& argv)
cmVersion::GetPatchVersion(), cmVersion::GetTweakVersion()); cmVersion::GetPatchVersion(), cmVersion::GetTweakVersion());
if(def) if(def)
{ {
fprintf(fout, "SET(CMAKE_MODULE_PATH %s)\n", def); fprintf(fout, "set(CMAKE_MODULE_PATH %s)\n", def);
} }
std::string projectLangs; std::string projectLangs;
@ -307,35 +307,35 @@ int cmCoreTryCompile::TryCompileCode(std::vector<std::string> const& argv)
if(const char* rulesOverridePath = if(const char* rulesOverridePath =
this->Makefile->GetDefinition(rulesOverrideLang.c_str())) this->Makefile->GetDefinition(rulesOverrideLang.c_str()))
{ {
fprintf(fout, "SET(%s \"%s\")\n", fprintf(fout, "set(%s \"%s\")\n",
rulesOverrideLang.c_str(), rulesOverridePath); rulesOverrideLang.c_str(), rulesOverridePath);
} }
else if(const char* rulesOverridePath2 = else if(const char* rulesOverridePath2 =
this->Makefile->GetDefinition(rulesOverrideBase.c_str())) this->Makefile->GetDefinition(rulesOverrideBase.c_str()))
{ {
fprintf(fout, "SET(%s \"%s\")\n", fprintf(fout, "set(%s \"%s\")\n",
rulesOverrideBase.c_str(), rulesOverridePath2); rulesOverrideBase.c_str(), rulesOverridePath2);
} }
} }
fprintf(fout, "PROJECT(CMAKE_TRY_COMPILE%s)\n", projectLangs.c_str()); fprintf(fout, "project(CMAKE_TRY_COMPILE%s)\n", projectLangs.c_str());
fprintf(fout, "SET(CMAKE_VERBOSE_MAKEFILE 1)\n"); fprintf(fout, "set(CMAKE_VERBOSE_MAKEFILE 1)\n");
for(std::set<std::string>::iterator li = testLangs.begin(); for(std::set<std::string>::iterator li = testLangs.begin();
li != testLangs.end(); ++li) li != testLangs.end(); ++li)
{ {
std::string langFlags = "CMAKE_" + *li + "_FLAGS"; std::string langFlags = "CMAKE_" + *li + "_FLAGS";
const char* flags = this->Makefile->GetDefinition(langFlags.c_str()); const char* flags = this->Makefile->GetDefinition(langFlags.c_str());
fprintf(fout, "SET(CMAKE_%s_FLAGS %s)\n", li->c_str(), fprintf(fout, "set(CMAKE_%s_FLAGS %s)\n", li->c_str(),
lg->EscapeForCMake(flags?flags:"").c_str()); lg->EscapeForCMake(flags?flags:"").c_str());
fprintf(fout, "SET(CMAKE_%s_FLAGS \"${CMAKE_%s_FLAGS}" fprintf(fout, "set(CMAKE_%s_FLAGS \"${CMAKE_%s_FLAGS}"
" ${COMPILE_DEFINITIONS}\")\n", li->c_str(), li->c_str()); " ${COMPILE_DEFINITIONS}\")\n", li->c_str(), li->c_str());
} }
fprintf(fout, "INCLUDE_DIRECTORIES(${INCLUDE_DIRECTORIES})\n"); fprintf(fout, "include_directories(${INCLUDE_DIRECTORIES})\n");
fprintf(fout, "SET(CMAKE_SUPPRESS_REGENERATION 1)\n"); fprintf(fout, "set(CMAKE_SUPPRESS_REGENERATION 1)\n");
fprintf(fout, "LINK_DIRECTORIES(${LINK_DIRECTORIES})\n"); fprintf(fout, "link_directories(${LINK_DIRECTORIES})\n");
// handle any compile flags we need to pass on // handle any compile flags we need to pass on
if (compileDefs.size()) if (compileDefs.size())
{ {
fprintf(fout, "ADD_DEFINITIONS( "); fprintf(fout, "add_definitions( ");
for (size_t i = 0; i < compileDefs.size(); ++i) for (size_t i = 0; i < compileDefs.size(); ++i)
{ {
fprintf(fout,"%s ",compileDefs[i].c_str()); fprintf(fout,"%s ",compileDefs[i].c_str());
@ -406,14 +406,14 @@ int cmCoreTryCompile::TryCompileCode(std::vector<std::string> const& argv)
} }
if(this->Makefile->GetDefinition("CMAKE_POSITION_INDEPENDENT_CODE")!=0) if(this->Makefile->GetDefinition("CMAKE_POSITION_INDEPENDENT_CODE")!=0)
{ {
fprintf(fout, "SET(CMAKE_POSITION_INDEPENDENT_CODE \"ON\")\n"); fprintf(fout, "set(CMAKE_POSITION_INDEPENDENT_CODE \"ON\")\n");
} }
/* Put the executable at a known location (for COPY_FILE). */ /* Put the executable at a known location (for COPY_FILE). */
fprintf(fout, "SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY \"%s\")\n", fprintf(fout, "set(CMAKE_RUNTIME_OUTPUT_DIRECTORY \"%s\")\n",
this->BinaryDirectory.c_str()); this->BinaryDirectory.c_str());
/* Create the actual executable. */ /* Create the actual executable. */
fprintf(fout, "ADD_EXECUTABLE(%s", targetName); fprintf(fout, "add_executable(%s", targetName);
for(std::vector<std::string>::iterator si = sources.begin(); for(std::vector<std::string>::iterator si = sources.begin();
si != sources.end(); ++si) si != sources.end(); ++si)
{ {
@ -429,11 +429,11 @@ int cmCoreTryCompile::TryCompileCode(std::vector<std::string> const& argv)
if (useOldLinkLibs) if (useOldLinkLibs)
{ {
fprintf(fout, fprintf(fout,
"TARGET_LINK_LIBRARIES(%s ${LINK_LIBRARIES})\n",targetName); "target_link_libraries(%s ${LINK_LIBRARIES})\n",targetName);
} }
else else
{ {
fprintf(fout, "TARGET_LINK_LIBRARIES(%s %s)\n", fprintf(fout, "target_link_libraries(%s %s)\n",
targetName, targetName,
libsToLink.c_str()); libsToLink.c_str());
} }

View File

@ -169,7 +169,7 @@ void cmExportLibraryDependenciesCommand::ConstFinalPass() const
const char* vertest = const char* vertest =
"\"${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}\" GREATER 2.4"; "\"${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}\" GREATER 2.4";
fout << "# Generated by CMake " << cmVersion::GetCMakeVersion() << "\n\n"; fout << "# Generated by CMake " << cmVersion::GetCMakeVersion() << "\n\n";
fout << "IF(" << vertest << ")\n"; fout << "if(" << vertest << ")\n";
fout << " # Information for CMake 2.6 and above.\n"; fout << " # Information for CMake 2.6 and above.\n";
for(std::map<cmStdString, cmStdString>::const_iterator for(std::map<cmStdString, cmStdString>::const_iterator
i = libDepsNew.begin(); i = libDepsNew.begin();
@ -177,10 +177,10 @@ void cmExportLibraryDependenciesCommand::ConstFinalPass() const
{ {
if(!i->second.empty()) if(!i->second.empty())
{ {
fout << " SET(\"" << i->first << "\" \"" << i->second << "\")\n"; fout << " set(\"" << i->first << "\" \"" << i->second << "\")\n";
} }
} }
fout << "ELSE(" << vertest << ")\n"; fout << "else()\n";
fout << " # Information for CMake 2.4 and lower.\n"; fout << " # Information for CMake 2.4 and lower.\n";
for(std::map<cmStdString, cmStdString>::const_iterator for(std::map<cmStdString, cmStdString>::const_iterator
i = libDepsOld.begin(); i = libDepsOld.begin();
@ -188,7 +188,7 @@ void cmExportLibraryDependenciesCommand::ConstFinalPass() const
{ {
if(!i->second.empty()) if(!i->second.empty())
{ {
fout << " SET(\"" << i->first << "\" \"" << i->second << "\")\n"; fout << " set(\"" << i->first << "\" \"" << i->second << "\")\n";
} }
} }
for(std::map<cmStdString, cmStdString>::const_iterator i = libTypes.begin(); for(std::map<cmStdString, cmStdString>::const_iterator i = libTypes.begin();
@ -196,9 +196,9 @@ void cmExportLibraryDependenciesCommand::ConstFinalPass() const
{ {
if(i->second != "general") if(i->second != "general")
{ {
fout << " SET(\"" << i->first << "\" \"" << i->second << "\")\n"; fout << " set(\"" << i->first << "\" \"" << i->second << "\")\n";
} }
} }
fout << "ENDIF(" << vertest << ")\n"; fout << "endif()\n";
return; return;
} }

View File

@ -281,7 +281,7 @@ void cmGlobalUnixMakefileGenerator3::WriteMainCMakefile()
// Save the generator name // Save the generator name
cmakefileStream cmakefileStream
<< "# The generator used is:\n" << "# The generator used is:\n"
<< "SET(CMAKE_DEPENDS_GENERATOR \"" << this->GetName() << "\")\n\n"; << "set(CMAKE_DEPENDS_GENERATOR \"" << this->GetName() << "\")\n\n";
// for each cmMakefile get its list of dependencies // for each cmMakefile get its list of dependencies
std::vector<std::string> lfiles; std::vector<std::string> lfiles;
@ -312,7 +312,7 @@ void cmGlobalUnixMakefileGenerator3::WriteMainCMakefile()
// Save the list to the cmake file. // Save the list to the cmake file.
cmakefileStream cmakefileStream
<< "# The top level Makefile was generated from the following files:\n" << "# The top level Makefile was generated from the following files:\n"
<< "SET(CMAKE_MAKEFILE_DEPENDS\n" << "set(CMAKE_MAKEFILE_DEPENDS\n"
<< " \"" << " \""
<< lg->Convert(cache.c_str(), << lg->Convert(cache.c_str(),
cmLocalGenerator::START_OUTPUT).c_str() << "\"\n"; cmLocalGenerator::START_OUTPUT).c_str() << "\"\n";
@ -335,7 +335,7 @@ void cmGlobalUnixMakefileGenerator3::WriteMainCMakefile()
// Set the corresponding makefile in the cmake file. // Set the corresponding makefile in the cmake file.
cmakefileStream cmakefileStream
<< "# The corresponding makefile is:\n" << "# The corresponding makefile is:\n"
<< "SET(CMAKE_MAKEFILE_OUTPUTS\n" << "set(CMAKE_MAKEFILE_OUTPUTS\n"
<< " \"" << " \""
<< lg->Convert(makefileName.c_str(), << lg->Convert(makefileName.c_str(),
cmLocalGenerator::START_OUTPUT).c_str() << "\"\n" cmLocalGenerator::START_OUTPUT).c_str() << "\"\n"
@ -348,7 +348,7 @@ void cmGlobalUnixMakefileGenerator3::WriteMainCMakefile()
{ {
cmakefileStream cmakefileStream
<< "# Byproducts of CMake generate step:\n" << "# Byproducts of CMake generate step:\n"
<< "SET(CMAKE_MAKEFILE_PRODUCTS\n"; << "set(CMAKE_MAKEFILE_PRODUCTS\n";
const std::vector<std::string>& outfiles = const std::vector<std::string>& outfiles =
lg->GetMakefile()->GetOutputFiles(); lg->GetMakefile()->GetOutputFiles();
for(std::vector<std::string>::const_iterator k = outfiles.begin(); for(std::vector<std::string>::const_iterator k = outfiles.begin();
@ -390,7 +390,7 @@ void cmGlobalUnixMakefileGenerator3
cmakefileStream cmakefileStream
<< "# Dependency information for all targets:\n"; << "# Dependency information for all targets:\n";
cmakefileStream cmakefileStream
<< "SET(CMAKE_DEPEND_INFO_FILES\n"; << "set(CMAKE_DEPEND_INFO_FILES\n";
for (unsigned int i = 0; i < lGenerators.size(); ++i) for (unsigned int i = 0; i < lGenerators.size(); ++i)
{ {
lg = static_cast<cmLocalUnixMakefileGenerator3 *>(lGenerators[i]); lg = static_cast<cmLocalUnixMakefileGenerator3 *>(lGenerators[i]);

View File

@ -183,11 +183,11 @@ cmInstallExportGenerator::GenerateScriptConfigs(std::ostream& os,
{ {
files.push_back(i->second); files.push_back(i->second);
std::string config_test = this->CreateConfigTest(i->first.c_str()); std::string config_test = this->CreateConfigTest(i->first.c_str());
os << indent << "IF(" << config_test << ")\n"; os << indent << "if(" << config_test << ")\n";
this->AddInstallRule(os, cmInstallType_FILES, files, false, this->AddInstallRule(os, cmInstallType_FILES, files, false,
this->FilePermissions.c_str(), 0, 0, 0, this->FilePermissions.c_str(), 0, 0, 0,
indent.Next()); indent.Next());
os << indent << "ENDIF(" << config_test << ")\n"; os << indent << "endif()\n";
files.clear(); files.clear();
} }
} }
@ -202,23 +202,23 @@ void cmInstallExportGenerator::GenerateScriptActions(std::ostream& os,
installedDir += "/"; installedDir += "/";
std::string installedFile = installedDir; std::string installedFile = installedDir;
installedFile += this->FileName; installedFile += this->FileName;
os << indent << "IF(EXISTS \"" << installedFile << "\")\n"; os << indent << "if(EXISTS \"" << installedFile << "\")\n";
Indent indentN = indent.Next(); Indent indentN = indent.Next();
Indent indentNN = indentN.Next(); Indent indentNN = indentN.Next();
Indent indentNNN = indentNN.Next(); Indent indentNNN = indentNN.Next();
os << indentN << "FILE(DIFFERENT EXPORT_FILE_CHANGED FILES\n" os << indentN << "file(DIFFERENT EXPORT_FILE_CHANGED FILES\n"
<< indentN << " \"" << installedFile << "\"\n" << indentN << " \"" << installedFile << "\"\n"
<< indentN << " \"" << this->MainImportFile << "\")\n"; << indentN << " \"" << this->MainImportFile << "\")\n";
os << indentN << "IF(EXPORT_FILE_CHANGED)\n"; os << indentN << "if(EXPORT_FILE_CHANGED)\n";
os << indentNN << "FILE(GLOB OLD_CONFIG_FILES \"" << installedDir os << indentNN << "file(GLOB OLD_CONFIG_FILES \"" << installedDir
<< this->EFGen->GetConfigImportFileGlob() << "\")\n"; << this->EFGen->GetConfigImportFileGlob() << "\")\n";
os << indentNN << "IF(OLD_CONFIG_FILES)\n"; os << indentNN << "if(OLD_CONFIG_FILES)\n";
os << indentNNN << "MESSAGE(STATUS \"Old export file \\\"" << installedFile os << indentNNN << "message(STATUS \"Old export file \\\"" << installedFile
<< "\\\" will be replaced. Removing files [${OLD_CONFIG_FILES}].\")\n"; << "\\\" will be replaced. Removing files [${OLD_CONFIG_FILES}].\")\n";
os << indentNNN << "FILE(REMOVE ${OLD_CONFIG_FILES})\n"; os << indentNNN << "file(REMOVE ${OLD_CONFIG_FILES})\n";
os << indentNN << "ENDIF(OLD_CONFIG_FILES)\n"; os << indentNN << "endif()\n";
os << indentN << "ENDIF(EXPORT_FILE_CHANGED)\n"; os << indentN << "endif()\n";
os << indent << "ENDIF()\n"; os << indent << "endif()\n";
// Install the main export file. // Install the main export file.
std::vector<std::string> files; std::vector<std::string> files;

View File

@ -80,18 +80,18 @@ void cmInstallGenerator
} }
} }
os << "\")\n"; os << "\")\n";
os << indent << "IF (CMAKE_WARN_ON_ABSOLUTE_INSTALL_DESTINATION)\n"; os << indent << "if(CMAKE_WARN_ON_ABSOLUTE_INSTALL_DESTINATION)\n";
os << indent << indent << "message(WARNING \"ABSOLUTE path INSTALL " os << indent << indent << "message(WARNING \"ABSOLUTE path INSTALL "
<< "DESTINATION : ${CMAKE_ABSOLUTE_DESTINATION_FILES}\")\n"; << "DESTINATION : ${CMAKE_ABSOLUTE_DESTINATION_FILES}\")\n";
os << indent << "ENDIF (CMAKE_WARN_ON_ABSOLUTE_INSTALL_DESTINATION)\n"; os << indent << "endif()\n";
os << indent << "IF (CMAKE_ERROR_ON_ABSOLUTE_INSTALL_DESTINATION)\n"; os << indent << "if(CMAKE_ERROR_ON_ABSOLUTE_INSTALL_DESTINATION)\n";
os << indent << indent << "message(FATAL_ERROR \"ABSOLUTE path INSTALL " os << indent << indent << "message(FATAL_ERROR \"ABSOLUTE path INSTALL "
<< "DESTINATION forbidden (by caller): " << "DESTINATION forbidden (by caller): "
<< "${CMAKE_ABSOLUTE_DESTINATION_FILES}\")\n"; << "${CMAKE_ABSOLUTE_DESTINATION_FILES}\")\n";
os << indent << "ENDIF (CMAKE_ERROR_ON_ABSOLUTE_INSTALL_DESTINATION)\n"; os << indent << "endif()\n";
} }
os << "FILE(INSTALL DESTINATION \"" << dest << "\" TYPE " << stype.c_str(); os << "file(INSTALL DESTINATION \"" << dest << "\" TYPE " << stype.c_str();
if(optional) if(optional)
{ {
os << " OPTIONAL"; os << " OPTIONAL";
@ -153,13 +153,13 @@ void cmInstallGenerator::GenerateScript(std::ostream& os)
// Begin this block of installation. // Begin this block of installation.
std::string component_test = std::string component_test =
this->CreateComponentTest(this->Component.c_str()); this->CreateComponentTest(this->Component.c_str());
os << indent << "IF(" << component_test << ")\n"; os << indent << "if(" << component_test << ")\n";
// Generate the script possibly with per-configuration code. // Generate the script possibly with per-configuration code.
this->GenerateScriptConfigs(os, indent.Next()); this->GenerateScriptConfigs(os, indent.Next());
// End this block of installation. // End this block of installation.
os << indent << "ENDIF(" << component_test << ")\n\n"; os << indent << "endif()\n\n";
} }
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------

View File

@ -32,7 +32,7 @@ void cmInstallScriptGenerator::GenerateScript(std::ostream& os)
Indent indent; Indent indent;
std::string component_test = std::string component_test =
this->CreateComponentTest(this->Component.c_str()); this->CreateComponentTest(this->Component.c_str());
os << indent << "IF(" << component_test << ")\n"; os << indent << "if(" << component_test << ")\n";
if(this->Code) if(this->Code)
{ {
@ -40,8 +40,8 @@ void cmInstallScriptGenerator::GenerateScript(std::ostream& os)
} }
else else
{ {
os << indent.Next() << "INCLUDE(\"" << this->Script << "\")\n"; os << indent.Next() << "include(\"" << this->Script << "\")\n";
} }
os << indent << "ENDIF(" << component_test << ")\n\n"; os << indent << "endif()\n\n";
} }

View File

@ -407,10 +407,10 @@ cmInstallTargetGenerator
std::string tws = tw.str(); std::string tws = tw.str();
if(!tws.empty()) if(!tws.empty())
{ {
os << indent << "IF(EXISTS \"" << file << "\" AND\n" os << indent << "if(EXISTS \"" << file << "\" AND\n"
<< indent << " NOT IS_SYMLINK \"" << file << "\")\n"; << indent << " NOT IS_SYMLINK \"" << file << "\")\n";
os << tws; os << tws;
os << indent << "ENDIF()\n"; os << indent << "endif()\n";
} }
} }
@ -434,7 +434,7 @@ cmInstallTargetGenerator
if(!tws.empty()) if(!tws.empty())
{ {
Indent indent2 = indent.Next().Next(); Indent indent2 = indent.Next().Next();
os << indent << "FOREACH(file\n"; os << indent << "foreach(file\n";
for(std::vector<std::string>::const_iterator i = files.begin(); for(std::vector<std::string>::const_iterator i = files.begin();
i != files.end(); ++i) i != files.end(); ++i)
{ {
@ -442,7 +442,7 @@ cmInstallTargetGenerator
} }
os << indent2 << ")\n"; os << indent2 << ")\n";
os << tws; os << tws;
os << indent << "ENDFOREACH()\n"; os << indent << "endforeach()\n";
} }
} }
} }
@ -577,7 +577,7 @@ cmInstallTargetGenerator
// install_name value and references. // install_name value and references.
if(!new_id.empty() || !install_name_remap.empty()) if(!new_id.empty() || !install_name_remap.empty())
{ {
os << indent << "EXECUTE_PROCESS(COMMAND \"" << installNameTool; os << indent << "execute_process(COMMAND \"" << installNameTool;
os << "\""; os << "\"";
if(!new_id.empty()) if(!new_id.empty())
{ {
@ -626,7 +626,7 @@ cmInstallTargetGenerator
// Write a rule to remove the installed file if its rpath is not the // Write a rule to remove the installed file if its rpath is not the
// new rpath. This is needed for existing build/install trees when // new rpath. This is needed for existing build/install trees when
// the installed rpath changes but the file is not rebuilt. // the installed rpath changes but the file is not rebuilt.
os << indent << "FILE(RPATH_CHECK\n" os << indent << "file(RPATH_CHECK\n"
<< indent << " FILE \"" << toDestDirPath << "\"\n" << indent << " FILE \"" << toDestDirPath << "\"\n"
<< indent << " RPATH \"" << newRpath << "\")\n"; << indent << " RPATH \"" << newRpath << "\")\n";
} }
@ -697,12 +697,12 @@ cmInstallTargetGenerator
// Write a rule to run chrpath to set the install-tree RPATH // Write a rule to run chrpath to set the install-tree RPATH
if(newRpath.empty()) if(newRpath.empty())
{ {
os << indent << "FILE(RPATH_REMOVE\n" os << indent << "file(RPATH_REMOVE\n"
<< indent << " FILE \"" << toDestDirPath << "\")\n"; << indent << " FILE \"" << toDestDirPath << "\")\n";
} }
else else
{ {
os << indent << "FILE(RPATH_CHANGE\n" os << indent << "file(RPATH_CHANGE\n"
<< indent << " FILE \"" << toDestDirPath << "\"\n" << indent << " FILE \"" << toDestDirPath << "\"\n"
<< indent << " OLD_RPATH \"" << oldRpath << "\"\n" << indent << " OLD_RPATH \"" << oldRpath << "\"\n"
<< indent << " NEW_RPATH \"" << newRpath << "\")\n"; << indent << " NEW_RPATH \"" << newRpath << "\")\n";
@ -736,11 +736,11 @@ cmInstallTargetGenerator::AddStripRule(std::ostream& os,
return; return;
} }
os << indent << "IF(CMAKE_INSTALL_DO_STRIP)\n"; os << indent << "if(CMAKE_INSTALL_DO_STRIP)\n";
os << indent << " EXECUTE_PROCESS(COMMAND \"" os << indent << " execute_process(COMMAND \""
<< this->Target->GetMakefile()->GetDefinition("CMAKE_STRIP") << this->Target->GetMakefile()->GetDefinition("CMAKE_STRIP")
<< "\" \"" << toDestDirPath << "\")\n"; << "\" \"" << toDestDirPath << "\")\n";
os << indent << "ENDIF(CMAKE_INSTALL_DO_STRIP)\n"; os << indent << "endif()\n";
} }
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
@ -769,6 +769,6 @@ cmInstallTargetGenerator::AddRanlibRule(std::ostream& os,
return; return;
} }
os << indent << "EXECUTE_PROCESS(COMMAND \"" os << indent << "execute_process(COMMAND \""
<< ranlib << "\" \"" << toDestDirPath << "\")\n"; << ranlib << "\" \"" << toDestDirPath << "\")\n";
} }

View File

@ -297,7 +297,7 @@ void cmLocalGenerator::GenerateTestFiles()
this->Makefile->GetProperty("TEST_INCLUDE_FILE"); this->Makefile->GetProperty("TEST_INCLUDE_FILE");
if ( testIncludeFile ) if ( testIncludeFile )
{ {
fout << "INCLUDE(\"" << testIncludeFile << "\")" << std::endl; fout << "include(\"" << testIncludeFile << "\")" << std::endl;
} }
// Ask each test generator to write its code. // Ask each test generator to write its code.
@ -313,7 +313,8 @@ void cmLocalGenerator::GenerateTestFiles()
size_t i; size_t i;
for(i = 0; i < this->Children.size(); ++i) for(i = 0; i < this->Children.size(); ++i)
{ {
fout << "SUBDIRS("; // TODO: Use add_subdirectory instead?
fout << "subdirs(";
std::string outP = std::string outP =
this->Children[i]->GetMakefile()->GetStartOutputDirectory(); this->Children[i]->GetMakefile()->GetStartOutputDirectory();
fout << this->Convert(outP.c_str(),START_OUTPUT); fout << this->Convert(outP.c_str(),START_OUTPUT);
@ -416,39 +417,39 @@ void cmLocalGenerator::GenerateInstallRules()
fout << "# Install script for directory: " fout << "# Install script for directory: "
<< this->Makefile->GetCurrentDirectory() << std::endl << std::endl; << this->Makefile->GetCurrentDirectory() << std::endl << std::endl;
fout << "# Set the install prefix" << std::endl fout << "# Set the install prefix" << std::endl
<< "IF(NOT DEFINED CMAKE_INSTALL_PREFIX)" << std::endl << "if(NOT DEFINED CMAKE_INSTALL_PREFIX)" << std::endl
<< " SET(CMAKE_INSTALL_PREFIX \"" << prefix << "\")" << std::endl << " set(CMAKE_INSTALL_PREFIX \"" << prefix << "\")" << std::endl
<< "ENDIF(NOT DEFINED CMAKE_INSTALL_PREFIX)" << std::endl << "endif()" << std::endl
<< "STRING(REGEX REPLACE \"/$\" \"\" CMAKE_INSTALL_PREFIX " << "string(REGEX REPLACE \"/$\" \"\" CMAKE_INSTALL_PREFIX "
<< "\"${CMAKE_INSTALL_PREFIX}\")" << std::endl << "\"${CMAKE_INSTALL_PREFIX}\")" << std::endl
<< std::endl; << std::endl;
// Write support code for generating per-configuration install rules. // Write support code for generating per-configuration install rules.
fout << fout <<
"# Set the install configuration name.\n" "# Set the install configuration name.\n"
"IF(NOT DEFINED CMAKE_INSTALL_CONFIG_NAME)\n" "if(NOT DEFINED CMAKE_INSTALL_CONFIG_NAME)\n"
" IF(BUILD_TYPE)\n" " if(BUILD_TYPE)\n"
" STRING(REGEX REPLACE \"^[^A-Za-z0-9_]+\" \"\"\n" " string(REGEX REPLACE \"^[^A-Za-z0-9_]+\" \"\"\n"
" CMAKE_INSTALL_CONFIG_NAME \"${BUILD_TYPE}\")\n" " CMAKE_INSTALL_CONFIG_NAME \"${BUILD_TYPE}\")\n"
" ELSE(BUILD_TYPE)\n" " else()\n"
" SET(CMAKE_INSTALL_CONFIG_NAME \"" << default_config << "\")\n" " set(CMAKE_INSTALL_CONFIG_NAME \"" << default_config << "\")\n"
" ENDIF(BUILD_TYPE)\n" " endif()\n"
" MESSAGE(STATUS \"Install configuration: " " message(STATUS \"Install configuration: "
"\\\"${CMAKE_INSTALL_CONFIG_NAME}\\\"\")\n" "\\\"${CMAKE_INSTALL_CONFIG_NAME}\\\"\")\n"
"ENDIF(NOT DEFINED CMAKE_INSTALL_CONFIG_NAME)\n" "endif()\n"
"\n"; "\n";
// Write support code for dealing with component-specific installs. // Write support code for dealing with component-specific installs.
fout << fout <<
"# Set the component getting installed.\n" "# Set the component getting installed.\n"
"IF(NOT CMAKE_INSTALL_COMPONENT)\n" "if(NOT CMAKE_INSTALL_COMPONENT)\n"
" IF(COMPONENT)\n" " if(COMPONENT)\n"
" MESSAGE(STATUS \"Install component: \\\"${COMPONENT}\\\"\")\n" " message(STATUS \"Install component: \\\"${COMPONENT}\\\"\")\n"
" SET(CMAKE_INSTALL_COMPONENT \"${COMPONENT}\")\n" " set(CMAKE_INSTALL_COMPONENT \"${COMPONENT}\")\n"
" ELSE(COMPONENT)\n" " else()\n"
" SET(CMAKE_INSTALL_COMPONENT)\n" " set(CMAKE_INSTALL_COMPONENT)\n"
" ENDIF(COMPONENT)\n" " endif()\n"
"ENDIF(NOT CMAKE_INSTALL_COMPONENT)\n" "endif()\n"
"\n"; "\n";
// Copy user-specified install options to the install code. // Copy user-specified install options to the install code.
@ -457,9 +458,9 @@ void cmLocalGenerator::GenerateInstallRules()
{ {
fout << fout <<
"# Install shared libraries without execute permission?\n" "# Install shared libraries without execute permission?\n"
"IF(NOT DEFINED CMAKE_INSTALL_SO_NO_EXE)\n" "if(NOT DEFINED CMAKE_INSTALL_SO_NO_EXE)\n"
" SET(CMAKE_INSTALL_SO_NO_EXE \"" << so_no_exe << "\")\n" " set(CMAKE_INSTALL_SO_NO_EXE \"" << so_no_exe << "\")\n"
"ENDIF(NOT DEFINED CMAKE_INSTALL_SO_NO_EXE)\n" "endif()\n"
"\n"; "\n";
} }
@ -479,7 +480,7 @@ void cmLocalGenerator::GenerateInstallRules()
// Include install scripts from subdirectories. // Include install scripts from subdirectories.
if(!this->Children.empty()) if(!this->Children.empty())
{ {
fout << "IF(NOT CMAKE_INSTALL_LOCAL_ONLY)\n"; fout << "if(NOT CMAKE_INSTALL_LOCAL_ONLY)\n";
fout << " # Include the install script for each subdirectory.\n"; fout << " # Include the install script for each subdirectory.\n";
for(std::vector<cmLocalGenerator*>::const_iterator for(std::vector<cmLocalGenerator*>::const_iterator
ci = this->Children.begin(); ci != this->Children.end(); ++ci) ci = this->Children.begin(); ci != this->Children.end(); ++ci)
@ -488,34 +489,34 @@ void cmLocalGenerator::GenerateInstallRules()
{ {
std::string odir = (*ci)->GetMakefile()->GetStartOutputDirectory(); std::string odir = (*ci)->GetMakefile()->GetStartOutputDirectory();
cmSystemTools::ConvertToUnixSlashes(odir); cmSystemTools::ConvertToUnixSlashes(odir);
fout << " INCLUDE(\"" << odir.c_str() fout << " include(\"" << odir.c_str()
<< "/cmake_install.cmake\")" << std::endl; << "/cmake_install.cmake\")" << std::endl;
} }
} }
fout << "\n"; fout << "\n";
fout << "ENDIF(NOT CMAKE_INSTALL_LOCAL_ONLY)\n\n"; fout << "endif()\n\n";
} }
// Record the install manifest. // Record the install manifest.
if ( toplevel_install ) if ( toplevel_install )
{ {
fout << fout <<
"IF(CMAKE_INSTALL_COMPONENT)\n" "if(CMAKE_INSTALL_COMPONENT)\n"
" SET(CMAKE_INSTALL_MANIFEST \"install_manifest_" " set(CMAKE_INSTALL_MANIFEST \"install_manifest_"
"${CMAKE_INSTALL_COMPONENT}.txt\")\n" "${CMAKE_INSTALL_COMPONENT}.txt\")\n"
"ELSE(CMAKE_INSTALL_COMPONENT)\n" "else()\n"
" SET(CMAKE_INSTALL_MANIFEST \"install_manifest.txt\")\n" " set(CMAKE_INSTALL_MANIFEST \"install_manifest.txt\")\n"
"ENDIF(CMAKE_INSTALL_COMPONENT)\n\n"; "endif()\n\n";
fout fout
<< "FILE(WRITE \"" << "file(WRITE \""
<< homedir.c_str() << "/${CMAKE_INSTALL_MANIFEST}\" " << homedir.c_str() << "/${CMAKE_INSTALL_MANIFEST}\" "
<< "\"\")" << std::endl; << "\"\")" << std::endl;
fout fout
<< "FOREACH(file ${CMAKE_INSTALL_MANIFEST_FILES})" << std::endl << "foreach(file ${CMAKE_INSTALL_MANIFEST_FILES})" << std::endl
<< " FILE(APPEND \"" << " file(APPEND \""
<< homedir.c_str() << "/${CMAKE_INSTALL_MANIFEST}\" " << homedir.c_str() << "/${CMAKE_INSTALL_MANIFEST}\" "
<< "\"${file}\\n\")" << std::endl << "\"${file}\\n\")" << std::endl
<< "ENDFOREACH(file)" << std::endl; << "endforeach()" << std::endl;
} }
} }

View File

@ -474,9 +474,9 @@ void cmLocalUnixMakefileGenerator3::WriteDirectoryInformationFile()
// Setup relative path conversion tops. // Setup relative path conversion tops.
infoFileStream infoFileStream
<< "# Relative path conversion top directories.\n" << "# Relative path conversion top directories.\n"
<< "SET(CMAKE_RELATIVE_PATH_TOP_SOURCE \"" << this->RelativePathTopSource << "set(CMAKE_RELATIVE_PATH_TOP_SOURCE \"" << this->RelativePathTopSource
<< "\")\n" << "\")\n"
<< "SET(CMAKE_RELATIVE_PATH_TOP_BINARY \"" << this->RelativePathTopBinary << "set(CMAKE_RELATIVE_PATH_TOP_BINARY \"" << this->RelativePathTopBinary
<< "\")\n" << "\")\n"
<< "\n"; << "\n";
@ -485,7 +485,7 @@ void cmLocalUnixMakefileGenerator3::WriteDirectoryInformationFile()
{ {
infoFileStream infoFileStream
<< "# Force unix paths in dependencies.\n" << "# Force unix paths in dependencies.\n"
<< "SET(CMAKE_FORCE_UNIX_PATHS 1)\n" << "set(CMAKE_FORCE_UNIX_PATHS 1)\n"
<< "\n"; << "\n";
} }
@ -495,21 +495,21 @@ void cmLocalUnixMakefileGenerator3::WriteDirectoryInformationFile()
<< "# The C and CXX include file regular expressions for " << "# The C and CXX include file regular expressions for "
<< "this directory.\n"; << "this directory.\n";
infoFileStream infoFileStream
<< "SET(CMAKE_C_INCLUDE_REGEX_SCAN "; << "set(CMAKE_C_INCLUDE_REGEX_SCAN ";
this->WriteCMakeArgument(infoFileStream, this->WriteCMakeArgument(infoFileStream,
this->Makefile->GetIncludeRegularExpression()); this->Makefile->GetIncludeRegularExpression());
infoFileStream infoFileStream
<< ")\n"; << ")\n";
infoFileStream infoFileStream
<< "SET(CMAKE_C_INCLUDE_REGEX_COMPLAIN "; << "set(CMAKE_C_INCLUDE_REGEX_COMPLAIN ";
this->WriteCMakeArgument(infoFileStream, this->WriteCMakeArgument(infoFileStream,
this->Makefile->GetComplainRegularExpression()); this->Makefile->GetComplainRegularExpression());
infoFileStream infoFileStream
<< ")\n"; << ")\n";
infoFileStream infoFileStream
<< "SET(CMAKE_CXX_INCLUDE_REGEX_SCAN ${CMAKE_C_INCLUDE_REGEX_SCAN})\n"; << "set(CMAKE_CXX_INCLUDE_REGEX_SCAN ${CMAKE_C_INCLUDE_REGEX_SCAN})\n";
infoFileStream infoFileStream
<< "SET(CMAKE_CXX_INCLUDE_REGEX_COMPLAIN " << "set(CMAKE_CXX_INCLUDE_REGEX_COMPLAIN "
"${CMAKE_C_INCLUDE_REGEX_COMPLAIN})\n"; "${CMAKE_C_INCLUDE_REGEX_COMPLAIN})\n";
} }
@ -1176,7 +1176,7 @@ cmLocalUnixMakefileGenerator3
{ {
cmSystemTools::Error("Could not create ", cleanfilePath.c_str()); cmSystemTools::Error("Could not create ", cleanfilePath.c_str());
} }
fout << "FILE(REMOVE_RECURSE\n"; fout << "file(REMOVE_RECURSE\n";
std::string remove = "$(CMAKE_COMMAND) -P "; std::string remove = "$(CMAKE_COMMAND) -P ";
remove += this->Convert(cleanfile.c_str(), START_OUTPUT, SHELL); remove += this->Convert(cleanfile.c_str(), START_OUTPUT, SHELL);
for(std::vector<std::string>::const_iterator f = files.begin(); for(std::vector<std::string>::const_iterator f = files.begin();
@ -1196,16 +1196,16 @@ cmLocalUnixMakefileGenerator3
target.GetLanguages(languages); target.GetLanguages(languages);
fout << "\n" fout << "\n"
<< "# Per-language clean rules from dependency scanning.\n" << "# Per-language clean rules from dependency scanning.\n"
<< "FOREACH(lang"; << "foreach(lang";
for(std::set<cmStdString>::const_iterator l = languages.begin(); for(std::set<cmStdString>::const_iterator l = languages.begin();
l != languages.end(); ++l) l != languages.end(); ++l)
{ {
fout << " " << *l; fout << " " << *l;
} }
fout << ")\n" fout << ")\n"
<< " INCLUDE(" << this->GetTargetDirectory(target) << " include(" << this->GetTargetDirectory(target)
<< "/cmake_clean_${lang}.cmake OPTIONAL)\n" << "/cmake_clean_${lang}.cmake OPTIONAL)\n"
<< "ENDFOREACH(lang)\n"; << "endforeach()\n";
} }
} }
} }
@ -1915,7 +1915,7 @@ void cmLocalUnixMakefileGenerator3
cmakefileStream cmakefileStream
<< "# The set of languages for which implicit dependencies are needed:\n"; << "# The set of languages for which implicit dependencies are needed:\n";
cmakefileStream cmakefileStream
<< "SET(CMAKE_DEPENDS_LANGUAGES\n"; << "set(CMAKE_DEPENDS_LANGUAGES\n";
for(ImplicitDependLanguageMap::const_iterator for(ImplicitDependLanguageMap::const_iterator
l = implicitLangs.begin(); l != implicitLangs.end(); ++l) l = implicitLangs.begin(); l != implicitLangs.end(); ++l)
{ {
@ -1930,7 +1930,7 @@ void cmLocalUnixMakefileGenerator3
l = implicitLangs.begin(); l != implicitLangs.end(); ++l) l = implicitLangs.begin(); l != implicitLangs.end(); ++l)
{ {
cmakefileStream cmakefileStream
<< "SET(CMAKE_DEPENDS_CHECK_" << l->first.c_str() << "\n"; << "set(CMAKE_DEPENDS_CHECK_" << l->first.c_str() << "\n";
ImplicitDependFileMap const& implicitPairs = l->second; ImplicitDependFileMap const& implicitPairs = l->second;
// for each file pair // for each file pair
@ -1954,7 +1954,7 @@ void cmLocalUnixMakefileGenerator3
if(cid && *cid) if(cid && *cid)
{ {
cmakefileStream cmakefileStream
<< "SET(CMAKE_" << l->first.c_str() << "_COMPILER_ID \"" << "set(CMAKE_" << l->first.c_str() << "_COMPILER_ID \""
<< cid << "\")\n"; << cid << "\")\n";
} }
} }
@ -1968,7 +1968,7 @@ void cmLocalUnixMakefileGenerator3
cmakefileStream cmakefileStream
<< "\n" << "\n"
<< "# Preprocessor definitions for this target.\n" << "# Preprocessor definitions for this target.\n"
<< "SET(CMAKE_TARGET_DEFINITIONS\n"; << "set(CMAKE_TARGET_DEFINITIONS\n";
for(std::set<std::string>::const_iterator di = defines.begin(); for(std::set<std::string>::const_iterator di = defines.begin();
di != defines.end(); ++di) di != defines.end(); ++di)
{ {
@ -1995,7 +1995,7 @@ void cmLocalUnixMakefileGenerator3
if(!transformRules.empty()) if(!transformRules.empty())
{ {
cmakefileStream cmakefileStream
<< "SET(CMAKE_INCLUDE_TRANSFORMS\n"; << "set(CMAKE_INCLUDE_TRANSFORMS\n";
for(std::vector<std::string>::const_iterator tri = transformRules.begin(); for(std::vector<std::string>::const_iterator tri = transformRules.begin();
tri != transformRules.end(); ++tri) tri != transformRules.end(); ++tri)
{ {

View File

@ -968,7 +968,7 @@ void cmMakefileTargetGenerator::WriteTargetDependRules()
*this->InfoFileStream *this->InfoFileStream
<< "\n" << "\n"
<< "# Pairs of files generated by the same build rule.\n" << "# Pairs of files generated by the same build rule.\n"
<< "SET(CMAKE_MULTIPLE_OUTPUT_PAIRS\n"; << "set(CMAKE_MULTIPLE_OUTPUT_PAIRS\n";
for(MultipleOutputPairsType::const_iterator pi = for(MultipleOutputPairsType::const_iterator pi =
this->MultipleOutputPairs.begin(); this->MultipleOutputPairs.begin();
pi != this->MultipleOutputPairs.end(); ++pi) pi != this->MultipleOutputPairs.end(); ++pi)
@ -986,7 +986,7 @@ void cmMakefileTargetGenerator::WriteTargetDependRules()
*this->InfoFileStream *this->InfoFileStream
<< "\n" << "\n"
<< "# Targets to which this target links.\n" << "# Targets to which this target links.\n"
<< "SET(CMAKE_TARGET_LINKED_INFO_FILES\n"; << "set(CMAKE_TARGET_LINKED_INFO_FILES\n";
std::set<cmTarget const*> emitted; std::set<cmTarget const*> emitted;
const char* cfg = this->LocalGenerator->ConfigurationName.c_str(); const char* cfg = this->LocalGenerator->ConfigurationName.c_str();
if(cmComputeLinkInformation* cli = this->Target->GetLinkInformation(cfg)) if(cmComputeLinkInformation* cli = this->Target->GetLinkInformation(cfg))
@ -1018,7 +1018,7 @@ void cmMakefileTargetGenerator::WriteTargetDependRules()
*this->InfoFileStream *this->InfoFileStream
<< "\n" << "\n"
<< "# Fortran module output directory.\n" << "# Fortran module output directory.\n"
<< "SET(CMAKE_Fortran_TARGET_MODULE_DIR \"" << mdir << "\")\n"; << "set(CMAKE_Fortran_TARGET_MODULE_DIR \"" << mdir << "\")\n";
} }
// Target-specific include directories: // Target-specific include directories:
@ -1026,7 +1026,7 @@ void cmMakefileTargetGenerator::WriteTargetDependRules()
<< "\n" << "\n"
<< "# The include file search paths:\n"; << "# The include file search paths:\n";
*this->InfoFileStream *this->InfoFileStream
<< "SET(CMAKE_C_TARGET_INCLUDE_PATH\n"; << "set(CMAKE_C_TARGET_INCLUDE_PATH\n";
std::vector<std::string> includes; std::vector<std::string> includes;
const char *config = this->Makefile->GetDefinition("CMAKE_BUILD_TYPE"); const char *config = this->Makefile->GetDefinition("CMAKE_BUILD_TYPE");
@ -1045,13 +1045,13 @@ void cmMakefileTargetGenerator::WriteTargetDependRules()
*this->InfoFileStream *this->InfoFileStream
<< " )\n"; << " )\n";
*this->InfoFileStream *this->InfoFileStream
<< "SET(CMAKE_CXX_TARGET_INCLUDE_PATH " << "set(CMAKE_CXX_TARGET_INCLUDE_PATH "
<< "${CMAKE_C_TARGET_INCLUDE_PATH})\n"; << "${CMAKE_C_TARGET_INCLUDE_PATH})\n";
*this->InfoFileStream *this->InfoFileStream
<< "SET(CMAKE_Fortran_TARGET_INCLUDE_PATH " << "set(CMAKE_Fortran_TARGET_INCLUDE_PATH "
<< "${CMAKE_C_TARGET_INCLUDE_PATH})\n"; << "${CMAKE_C_TARGET_INCLUDE_PATH})\n";
*this->InfoFileStream *this->InfoFileStream
<< "SET(CMAKE_ASM_TARGET_INCLUDE_PATH " << "set(CMAKE_ASM_TARGET_INCLUDE_PATH "
<< "${CMAKE_C_TARGET_INCLUDE_PATH})\n"; << "${CMAKE_C_TARGET_INCLUDE_PATH})\n";
// and now write the rule to use it // and now write the rule to use it

View File

@ -436,7 +436,7 @@ void cmQtAutomoc::SetupAutomocTarget(cmTarget* target)
it = configDefines.begin(), end = configDefines.end(); it = configDefines.begin(), end = configDefines.end();
it != end; ++it) it != end; ++it)
{ {
infoFile << "SET(AM_MOC_COMPILE_DEFINITIONS_" << it->first << infoFile << "set(AM_MOC_COMPILE_DEFINITIONS_" << it->first <<
" " << it->second << ")\n"; " " << it->second << ")\n";
} }
} }
@ -446,7 +446,7 @@ void cmQtAutomoc::SetupAutomocTarget(cmTarget* target)
it = configIncludes.begin(), end = configIncludes.end(); it = configIncludes.begin(), end = configIncludes.end();
it != end; ++it) it != end; ++it)
{ {
infoFile << "SET(AM_MOC_INCLUDES_" << it->first << infoFile << "set(AM_MOC_INCLUDES_" << it->first <<
" " << it->second << ")\n"; " " << it->second << ")\n";
} }
} }

View File

@ -185,9 +185,9 @@ void cmScriptGenerator::GenerateScriptActionsOnce(std::ostream& os,
{ {
// Generate a per-configuration block. // Generate a per-configuration block.
std::string config_test = this->CreateConfigTest(this->Configurations); std::string config_test = this->CreateConfigTest(this->Configurations);
os << indent << "IF(" << config_test << ")\n"; os << indent << "if(" << config_test << ")\n";
this->GenerateScriptActions(os, indent.Next()); this->GenerateScriptActions(os, indent.Next());
os << indent << "ENDIF(" << config_test << ")\n"; os << indent << "endif(" << config_test << ")\n";
} }
} }
@ -219,7 +219,7 @@ void cmScriptGenerator::GenerateScriptActionsPerConfig(std::ostream& os,
{ {
// Generate a per-configuration block. // Generate a per-configuration block.
std::string config_test = this->CreateConfigTest(config); std::string config_test = this->CreateConfigTest(config);
os << indent << (first? "IF(" : "ELSEIF(") << config_test << ")\n"; os << indent << (first? "if(" : "elseif(") << config_test << ")\n";
this->GenerateScriptForConfig(os, config, indent.Next()); this->GenerateScriptForConfig(os, config, indent.Next());
first = false; first = false;
} }
@ -228,10 +228,10 @@ void cmScriptGenerator::GenerateScriptActionsPerConfig(std::ostream& os,
{ {
if(this->NeedsScriptNoConfig()) if(this->NeedsScriptNoConfig())
{ {
os << indent << "ELSE()\n"; os << indent << "else()\n";
this->GenerateScriptNoConfig(os, indent.Next()); this->GenerateScriptNoConfig(os, indent.Next());
} }
os << indent << "ENDIF()\n"; os << indent << "endif()\n";
} }
} }
} }

View File

@ -53,7 +53,7 @@ void cmTestGenerator::GenerateScriptConfigs(std::ostream& os,
cmPropertyMap* mpit = &test->GetProperties(); cmPropertyMap* mpit = &test->GetProperties();
if ( mpit->size() ) if ( mpit->size() )
{ {
fout << "SET_TESTS_PROPERTIES(" << test->GetName() << " PROPERTIES "; fout << "set_tests_properties(" << test->GetName() << " PROPERTIES ";
for ( pit = mpit->begin(); pit != mpit->end(); ++ pit ) for ( pit = mpit->begin(); pit != mpit->end(); ++ pit )
{ {
fout << " " << pit->first fout << " " << pit->first
@ -94,7 +94,7 @@ void cmTestGenerator::GenerateScriptForConfig(std::ostream& os,
cmGeneratorExpression ge(this->Test->GetBacktrace()); cmGeneratorExpression ge(this->Test->GetBacktrace());
// Start the test command. // Start the test command.
os << indent << "ADD_TEST(" << this->Test->GetName() << " "; os << indent << "add_test(" << this->Test->GetName() << " ";
// Get the test command line to be executed. // Get the test command line to be executed.
std::vector<std::string> const& command = this->Test->GetCommand(); std::vector<std::string> const& command = this->Test->GetCommand();
@ -133,7 +133,7 @@ void cmTestGenerator::GenerateScriptForConfig(std::ostream& os,
void cmTestGenerator::GenerateScriptNoConfig(std::ostream& os, void cmTestGenerator::GenerateScriptNoConfig(std::ostream& os,
Indent const& indent) Indent const& indent)
{ {
os << indent << "ADD_TEST(" << this->Test->GetName() << " NOT_AVAILABLE)\n"; os << indent << "add_test(" << this->Test->GetName() << " NOT_AVAILABLE)\n";
} }
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
@ -157,7 +157,7 @@ void cmTestGenerator::GenerateOldStyle(std::ostream& fout,
std::string exe = command[0]; std::string exe = command[0];
cmSystemTools::ConvertToUnixSlashes(exe); cmSystemTools::ConvertToUnixSlashes(exe);
fout << indent; fout << indent;
fout << "ADD_TEST("; fout << "add_test(";
fout << this->Test->GetName() << " \"" << exe << "\""; fout << this->Test->GetName() << " \"" << exe << "\"";
for(std::vector<std::string>::const_iterator argit = command.begin()+1; for(std::vector<std::string>::const_iterator argit = command.begin()+1;

View File

@ -353,13 +353,13 @@ void cmTryRunCommand::DoNotRunExecutable(const std::string& runArgs,
cmsys::SystemTools::ReplaceString(comment, "\n", "\n# "); cmsys::SystemTools::ReplaceString(comment, "\n", "\n# ");
file << comment << "\n\n"; file << comment << "\n\n";
file << "SET( " << this->RunResultVariable << " \n \"" file << "set( " << this->RunResultVariable << " \n \""
<< this->Makefile->GetDefinition(this->RunResultVariable.c_str()) << this->Makefile->GetDefinition(this->RunResultVariable.c_str())
<< "\"\n CACHE STRING \"Result from TRY_RUN\" FORCE)\n\n"; << "\"\n CACHE STRING \"Result from TRY_RUN\" FORCE)\n\n";
if (out!=0) if (out!=0)
{ {
file << "SET( " << internalRunOutputName << " \n \"" file << "set( " << internalRunOutputName << " \n \""
<< this->Makefile->GetDefinition(internalRunOutputName.c_str()) << this->Makefile->GetDefinition(internalRunOutputName.c_str())
<< "\"\n CACHE STRING \"Output from TRY_RUN\" FORCE)\n\n"; << "\"\n CACHE STRING \"Output from TRY_RUN\" FORCE)\n\n";
} }