summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
Diffstat (limited to 'Source')
-rw-r--r--Source/CPack/cmCPackGenerator.cxx1
-rw-r--r--Source/CTest/cmCTestMemCheckHandler.cxx24
-rw-r--r--Source/CTest/cmCTestRunTest.cxx2
-rw-r--r--Source/CTest/cmParsePHPCoverage.cxx1
-rw-r--r--Source/CursesDialog/cmCursesLongMessageForm.cxx2
-rw-r--r--Source/cmArchiveWrite.cxx3
-rw-r--r--Source/cmCTest.cxx2
-rw-r--r--Source/cmDocumentVariables.cxx9
-rw-r--r--Source/cmFileCommand.cxx6
-rw-r--r--Source/cmGlobalXCodeGenerator.cxx64
-rw-r--r--Source/cmLocalGenerator.cxx25
-rw-r--r--Source/cmLocalGenerator.h8
-rw-r--r--Source/cmLocalVisualStudio7Generator.cxx38
-rw-r--r--Source/cmMakefileTargetGenerator.cxx35
-rw-r--r--Source/cmMakefileTargetGenerator.h2
-rw-r--r--Source/cmSourceFile.cxx9
-rw-r--r--Source/cmTarget.cxx18
-rw-r--r--Source/cmake.cxx8
-rw-r--r--Source/cmakemain.cxx2
-rw-r--r--Source/kwsys/Glob.cxx40
-rw-r--r--Source/kwsys/Glob.hxx.in4
-rw-r--r--Source/kwsys/kwsysDateStamp.cmake2
22 files changed, 253 insertions, 52 deletions
diff --git a/Source/CPack/cmCPackGenerator.cxx b/Source/CPack/cmCPackGenerator.cxx
index 0e4acd5..083279f 100644
--- a/Source/CPack/cmCPackGenerator.cxx
+++ b/Source/CPack/cmCPackGenerator.cxx
@@ -1000,6 +1000,7 @@ int cmCPackGenerator::DoPackage()
std::string findExpr = tempDirectory;
findExpr += "/*";
gl.RecurseOn();
+ gl.SetRecurseThroughSymlinks(false);
if ( !gl.FindFiles(findExpr) )
{
cmCPackLogger(cmCPackLog::LOG_ERROR,
diff --git a/Source/CTest/cmCTestMemCheckHandler.cxx b/Source/CTest/cmCTestMemCheckHandler.cxx
index 0612449..f0a98f9 100644
--- a/Source/CTest/cmCTestMemCheckHandler.cxx
+++ b/Source/CTest/cmCTestMemCheckHandler.cxx
@@ -672,30 +672,30 @@ bool cmCTestMemCheckHandler::ProcessMemCheckValgrindOutput(
cmsys::RegularExpression vgFMM(
"== .*Mismatched free\\(\\) / delete / delete \\[\\]");
cmsys::RegularExpression vgMLK1(
- "== .*[0-9][0-9]* bytes in [0-9][0-9]* blocks are definitely lost"
- " in loss record [0-9][0-9]* of [0-9]");
+ "== .*[0-9,]+ bytes in [0-9,]+ blocks are definitely lost"
+ " in loss record [0-9,]+ of [0-9,]+");
cmsys::RegularExpression vgMLK2(
- "== .*[0-9][0-9]* \\([0-9]*,?[0-9]* direct, [0-9]*,?[0-9]* indirect\\)"
- " bytes in [0-9][0-9]* blocks are definitely lost"
- " in loss record [0-9][0-9]* of [0-9]");
+ "== .*[0-9,]+ \\([0-9,]+ direct, [0-9,]+ indirect\\)"
+ " bytes in [0-9,]+ blocks are definitely lost"
+ " in loss record [0-9,]+ of [0-9,]+");
cmsys::RegularExpression vgPAR(
"== .*Syscall param .* contains unaddressable byte\\(s\\)");
cmsys::RegularExpression vgMPK1(
- "== .*[0-9][0-9]* bytes in [0-9][0-9]* blocks are possibly lost in"
- " loss record [0-9][0-9]* of [0-9]");
+ "== .*[0-9,]+ bytes in [0-9,]+ blocks are possibly lost in"
+ " loss record [0-9,]+ of [0-9,]+");
cmsys::RegularExpression vgMPK2(
- "== .*[0-9][0-9]* bytes in [0-9][0-9]* blocks are still reachable"
- " in loss record [0-9][0-9]* of [0-9]");
+ "== .*[0-9,]+ bytes in [0-9,]+ blocks are still reachable"
+ " in loss record [0-9,]+ of [0-9,]+");
cmsys::RegularExpression vgUMC(
"== .*Conditional jump or move depends on uninitialised value\\(s\\)");
cmsys::RegularExpression vgUMR1(
- "== .*Use of uninitialised value of size [0-9][0-9]*");
- cmsys::RegularExpression vgUMR2("== .*Invalid read of size [0-9][0-9]*");
+ "== .*Use of uninitialised value of size [0-9,]+");
+ cmsys::RegularExpression vgUMR2("== .*Invalid read of size [0-9,]+");
cmsys::RegularExpression vgUMR3("== .*Jump to the invalid address ");
cmsys::RegularExpression vgUMR4("== .*Syscall param .* contains "
"uninitialised or unaddressable byte\\(s\\)");
cmsys::RegularExpression vgUMR5("== .*Syscall param .* uninitialised");
- cmsys::RegularExpression vgIPW("== .*Invalid write of size [0-9]");
+ cmsys::RegularExpression vgIPW("== .*Invalid write of size [0-9,]+");
cmsys::RegularExpression vgABR("== .*pthread_mutex_unlock: mutex is "
"locked by a different thread");
std::vector<std::string::size_type> nonValGrindOutput;
diff --git a/Source/CTest/cmCTestRunTest.cxx b/Source/CTest/cmCTestRunTest.cxx
index 60695da..81f18b0 100644
--- a/Source/CTest/cmCTestRunTest.cxx
+++ b/Source/CTest/cmCTestRunTest.cxx
@@ -93,6 +93,7 @@ void cmCTestRunTest::CompressOutput()
ret = deflateInit(&strm, -1); //default compression level
if (ret != Z_OK)
{
+ delete[] out;
return;
}
@@ -106,6 +107,7 @@ void cmCTestRunTest::CompressOutput()
{
cmCTestLog(this->CTest, ERROR_MESSAGE, "Error during output "
"compression. Sending uncompressed output." << std::endl);
+ delete[] out;
return;
}
diff --git a/Source/CTest/cmParsePHPCoverage.cxx b/Source/CTest/cmParsePHPCoverage.cxx
index 32c1ec1..593b2d1 100644
--- a/Source/CTest/cmParsePHPCoverage.cxx
+++ b/Source/CTest/cmParsePHPCoverage.cxx
@@ -159,6 +159,7 @@ bool cmParsePHPCoverage::ReadFileInformation(std::ifstream& in)
// read open quote
if(in.get(c) && c != '"')
{
+ delete[] s;
return false;
}
// read the string data
diff --git a/Source/CursesDialog/cmCursesLongMessageForm.cxx b/Source/CursesDialog/cmCursesLongMessageForm.cxx
index 1c48d8c..0e2cd22 100644
--- a/Source/CursesDialog/cmCursesLongMessageForm.cxx
+++ b/Source/CursesDialog/cmCursesLongMessageForm.cxx
@@ -68,7 +68,7 @@ void cmCursesLongMessageForm::UpdateStatusBar()
}
else
{
- width = cmCursesMainForm::MAX_WIDTH;
+ width = cmCursesMainForm::MAX_WIDTH-1;
}
bar[width] = '\0';
diff --git a/Source/cmArchiveWrite.cxx b/Source/cmArchiveWrite.cxx
index 25dc8ba..eab8a59 100644
--- a/Source/cmArchiveWrite.cxx
+++ b/Source/cmArchiveWrite.cxx
@@ -180,7 +180,8 @@ bool cmArchiveWrite::AddPath(const char* path,
{
return false;
}
- if(!cmSystemTools::FileIsDirectory(path))
+ if(!cmSystemTools::FileIsDirectory(path) ||
+ cmSystemTools::FileIsSymlink(path))
{
return true;
}
diff --git a/Source/cmCTest.cxx b/Source/cmCTest.cxx
index 75a564e..702ba10 100644
--- a/Source/cmCTest.cxx
+++ b/Source/cmCTest.cxx
@@ -3096,6 +3096,7 @@ bool cmCTest::CompressString(std::string& str)
ret = deflateInit(&strm, -1); //default compression level
if (ret != Z_OK)
{
+ delete[] out;
return false;
}
@@ -3109,6 +3110,7 @@ bool cmCTest::CompressString(std::string& str)
{
cmCTestLog(this, ERROR_MESSAGE, "Error during gzip compression."
<< std::endl);
+ delete[] out;
return false;
}
diff --git a/Source/cmDocumentVariables.cxx b/Source/cmDocumentVariables.cxx
index 26125d9..f2b01f1 100644
--- a/Source/cmDocumentVariables.cxx
+++ b/Source/cmDocumentVariables.cxx
@@ -1049,6 +1049,15 @@ void cmDocumentVariables::DefineVariables(cmake* cm)
"Variables that Control the Build");
cm->DefineProperty
+ ("CMAKE_Fortran_FORMAT", cmProperty::VARIABLE,
+ "Set to FIXED or FREE to indicate the Fortran source layout.",
+ "This variable is used to initialize the Fortran_FORMAT "
+ "property on all the targets. "
+ "See that target property for additional information.",
+ false,
+ "Variables that Control the Build");
+
+ cm->DefineProperty
("CMAKE_Fortran_MODULE_DIRECTORY", cmProperty::VARIABLE,
"Fortran module output directory.",
"This variable is used to initialize the "
diff --git a/Source/cmFileCommand.cxx b/Source/cmFileCommand.cxx
index 9a3de9b..f933666 100644
--- a/Source/cmFileCommand.cxx
+++ b/Source/cmFileCommand.cxx
@@ -2753,6 +2753,10 @@ cmFileCommand::HandleDownloadCommand(std::vector<std::string> const& args)
::CURLcode res = ::curl_easy_setopt(curl, CURLOPT_URL, url.c_str());
check_curl_result(res, "DOWNLOAD cannot set url: ");
+ // enable HTTP ERROR parsing
+ res = ::curl_easy_setopt(curl, CURLOPT_FAILONERROR, 1);
+ check_curl_result(res, "DOWNLOAD cannot set http failure option: ");
+
res = ::curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION,
cmWriteToFileCallback);
check_curl_result(res, "DOWNLOAD cannot set write function: ");
@@ -2982,6 +2986,7 @@ cmFileCommand::HandleUploadCommand(std::vector<std::string> const& args)
std::string errStr = "UPLOAD cannot stat file '";
errStr += filename + "'.";
this->SetError(errStr.c_str());
+ fclose(fin);
return false;
}
@@ -2991,6 +2996,7 @@ cmFileCommand::HandleUploadCommand(std::vector<std::string> const& args)
if(!curl)
{
this->SetError("UPLOAD error initializing curl.");
+ fclose(fin);
return false;
}
diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx
index 02a95fe..09265ae 100644
--- a/Source/cmGlobalXCodeGenerator.cxx
+++ b/Source/cmGlobalXCodeGenerator.cxx
@@ -327,7 +327,9 @@ std::string
cmGlobalXCodeGenerator::PostBuildMakeTarget(std::string const& tName,
std::string const& configName)
{
- std::string out = "PostBuild." + tName;
+ std::string target = tName;
+ cmSystemTools::ReplaceString(target, " ", "_");
+ std::string out = "PostBuild." + target;
if(this->XcodeVersion > 20)
{
out += "." + configName;
@@ -582,6 +584,13 @@ cmGlobalXCodeGenerator::CreateXCodeSourceFile(cmLocalGenerator* lg,
{
lg->AppendFlags(flags, cmtarget.GetProperty("COMPILE_FLAGS"));
}
+ const char* srcfmt = sf->GetProperty("Fortran_FORMAT");
+ switch(this->CurrentLocalGenerator->GetFortranFormat(srcfmt))
+ {
+ case cmLocalGenerator::FortranFormatFixed: flags="-fixed "+flags; break;
+ case cmLocalGenerator::FortranFormatFree: flags="-free "+flags; break;
+ default: break;
+ }
lg->AppendFlags(flags, sf->GetProperty("COMPILE_FLAGS"));
// Add per-source definitions.
@@ -770,7 +779,8 @@ cmGlobalXCodeGenerator::CreateXCodeFileReference(cmSourceFile* sf,
bool cmGlobalXCodeGenerator::SpecialTargetEmitted(std::string const& tname)
{
if(tname == "ALL_BUILD" || tname == "XCODE_DEPEND_HELPER" ||
- tname == "install" || tname == "package" || tname == "RUN_TESTS" )
+ tname == "install" || tname == "package" || tname == "RUN_TESTS" ||
+ tname == CMAKE_CHECK_BUILD_SYSTEM_TARGET )
{
if(this->TargetDoneSet.find(tname) != this->TargetDoneSet.end())
{
@@ -1219,19 +1229,30 @@ void cmGlobalXCodeGenerator::CreateCustomCommands(cmXCodeObject* buildPhases,
}
//----------------------------------------------------------------------------
+// This function removes each occurence of the flag and returns the last one
+// (i.e., the dominant flag in GCC)
std::string cmGlobalXCodeGenerator::ExtractFlag(const char* flag,
std::string& flags)
{
std::string retFlag;
- std::string::size_type pos = flags.find(flag);
- if(pos != flags.npos && (pos ==0 || flags[pos-1]==' '))
+ std::string::size_type pos = flags.rfind(flag);
+ bool saved = false;
+ while(pos != flags.npos)
{
- while(pos < flags.size() && flags[pos] != ' ')
+ if(pos == 0 || flags[pos-1]==' ')
{
- retFlag += flags[pos];
- flags[pos] = ' ';
- pos++;
+ while(pos < flags.size() && flags[pos] != ' ')
+ {
+ if(!saved)
+ {
+ retFlag += flags[pos];
+ }
+ flags[pos] = ' ';
+ pos++;
+ }
}
+ saved = true;
+ pos = flags.rfind(flag);
}
return retFlag;
}
@@ -1870,7 +1891,17 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmTarget& target,
flags += gflag;
}
const char* debugStr = "YES";
- if(gflagc.size() ==0 && gflag.size() == 0)
+ // We can't set the Xcode flag differently depending on the language,
+ // so put them back in this case.
+ if( (lang && strcmp(lang, "CXX") == 0) && gflag != gflagc )
+ {
+ cflags += " ";
+ cflags += gflagc;
+ flags += " ";
+ flags += gflag;
+ debugStr = "NO";
+ }
+ if( gflag == "-g0" || gflag.size() == 0 )
{
debugStr = "NO";
}
@@ -1903,6 +1934,21 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmTarget& target,
this->CreateString(flags.c_str()));
}
+ // Add Fortran source format attribute if property is set.
+ const char* format = 0;
+ const char* tgtfmt = target.GetProperty("Fortran_FORMAT");
+ switch(this->CurrentLocalGenerator->GetFortranFormat(tgtfmt))
+ {
+ case cmLocalGenerator::FortranFormatFixed: format = "fixed"; break;
+ case cmLocalGenerator::FortranFormatFree: format = "free"; break;
+ default: break;
+ }
+ if(format)
+ {
+ buildSettings->AddAttribute("IFORT_LANG_SRCFMT",
+ this->CreateString(format));
+ }
+
// Create the INSTALL_PATH attribute.
std::string install_name_dir;
if(target.GetType() == cmTarget::SHARED_LIBRARY)
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx
index 7da35eb..1d1e8da 100644
--- a/Source/cmLocalGenerator.cxx
+++ b/Source/cmLocalGenerator.cxx
@@ -2917,6 +2917,31 @@ std::string cmLocalGenerator::EscapeForCMake(const char* str)
}
//----------------------------------------------------------------------------
+cmLocalGenerator::FortranFormat
+cmLocalGenerator::GetFortranFormat(const char* value)
+{
+ FortranFormat format = FortranFormatNone;
+ if(value && *value)
+ {
+ std::vector<std::string> fmt;
+ cmSystemTools::ExpandListArgument(value, fmt);
+ for(std::vector<std::string>::iterator fi = fmt.begin();
+ fi != fmt.end(); ++fi)
+ {
+ if(*fi == "FIXED")
+ {
+ format = FortranFormatFixed;
+ }
+ if(*fi == "FREE")
+ {
+ format = FortranFormatFree;
+ }
+ }
+ }
+ return format;
+}
+
+//----------------------------------------------------------------------------
std::string
cmLocalGenerator::GetTargetDirectory(cmTarget const&) const
{
diff --git a/Source/cmLocalGenerator.h b/Source/cmLocalGenerator.h
index a204a73..cfc09dc 100644
--- a/Source/cmLocalGenerator.h
+++ b/Source/cmLocalGenerator.h
@@ -244,6 +244,14 @@ public:
/** Escape the given string as an argument in a CMake script. */
std::string EscapeForCMake(const char* str);
+ enum FortranFormat
+ {
+ FortranFormatNone,
+ FortranFormatFixed,
+ FortranFormatFree
+ };
+ FortranFormat GetFortranFormat(const char* value);
+
/** Return the directories into which object files will be put.
* There maybe more than one for fat binary systems like OSX.
*/
diff --git a/Source/cmLocalVisualStudio7Generator.cxx b/Source/cmLocalVisualStudio7Generator.cxx
index 1f99cba..5417584 100644
--- a/Source/cmLocalVisualStudio7Generator.cxx
+++ b/Source/cmLocalVisualStudio7Generator.cxx
@@ -330,6 +330,8 @@ cmVS7FlagTable cmLocalVisualStudio7GeneratorFortranFlagTable[] =
{
{"Preprocess", "fpp", "Run Preprocessor on files", "preprocessYes", 0},
{"SuppressStartupBanner", "nologo", "SuppressStartupBanner", "true", 0},
+ {"SourceFileFormat", "fixed", "Use Fixed Format", "fileFormatFixed", 0},
+ {"SourceFileFormat", "free", "Use Free Format", "fileFormatFree", 0},
{"DebugInformationFormat", "Zi", "full debug", "debugEnabled", 0},
{"DebugInformationFormat", "debug:full", "full debug", "debugEnabled", 0},
{"DebugInformationFormat", "Z7", "c7 compat", "debugOldStyleInfo", 0},
@@ -687,6 +689,16 @@ void cmLocalVisualStudio7Generator::WriteConfiguration(std::ostream& fout,
}
}
+ if(this->FortranProject)
+ {
+ switch(this->GetFortranFormat(target.GetProperty("Fortran_FORMAT")))
+ {
+ case FortranFormatFixed: flags += " -fixed"; break;
+ case FortranFormatFree: flags += " -free"; break;
+ default: break;
+ }
+ }
+
// Add the target-specific flags.
if(const char* targetFlags = target.GetProperty("COMPILE_FLAGS"))
{
@@ -1361,6 +1373,21 @@ cmLocalVisualStudio7GeneratorFCInfo
fc.CompileFlags = cflags;
needfc = true;
}
+ if(lg->FortranProject)
+ {
+ switch(lg->GetFortranFormat(sf.GetProperty("Fortran_FORMAT")))
+ {
+ case cmLocalGenerator::FortranFormatFixed:
+ fc.CompileFlags = "-fixed " + fc.CompileFlags;
+ needfc = true;
+ break;
+ case cmLocalGenerator::FortranFormatFree:
+ fc.CompileFlags = "-free " + fc.CompileFlags;
+ needfc = true;
+ break;
+ default: break;
+ }
+ }
if(const char* cdefs = sf.GetProperty("COMPILE_DEFINITIONS"))
{
fc.CompileDefs = cdefs;
@@ -1569,8 +1596,15 @@ void cmLocalVisualStudio7Generator
!fc.CompileDefs.empty() ||
!fc.CompileDefsConfig.empty())
{
- Options fileOptions(this, this->Version, Options::Compiler,
- cmLocalVisualStudio7GeneratorFlagTable,
+ Options::Tool tool = Options::Compiler;
+ cmVS7FlagTable const* table =
+ cmLocalVisualStudio7GeneratorFlagTable;
+ if(this->FortranProject)
+ {
+ tool = Options::FortranCompiler;
+ table = cmLocalVisualStudio7GeneratorFortranFlagTable;
+ }
+ Options fileOptions(this, this->Version, tool, table,
this->ExtraFlagTable);
fileOptions.Parse(fc.CompileFlags.c_str());
fileOptions.AddDefines(fc.CompileDefs.c_str());
diff --git a/Source/cmMakefileTargetGenerator.cxx b/Source/cmMakefileTargetGenerator.cxx
index d0df8f0..8b91194 100644
--- a/Source/cmMakefileTargetGenerator.cxx
+++ b/Source/cmMakefileTargetGenerator.cxx
@@ -504,6 +504,35 @@ void cmMakefileTargetGenerator::WriteObjectRuleFiles(cmSourceFile& source)
//----------------------------------------------------------------------------
void
cmMakefileTargetGenerator
+::AppendFortranFormatFlags(std::string& flags, cmSourceFile& source)
+{
+ const char* srcfmt = source.GetProperty("Fortran_FORMAT");
+ cmLocalGenerator::FortranFormat format =
+ this->LocalGenerator->GetFortranFormat(srcfmt);
+ if(format == cmLocalGenerator::FortranFormatNone)
+ {
+ const char* tgtfmt = this->Target->GetProperty("Fortran_FORMAT");
+ format = this->LocalGenerator->GetFortranFormat(tgtfmt);
+ }
+ const char* var = 0;
+ switch (format)
+ {
+ case cmLocalGenerator::FortranFormatFixed:
+ var = "CMAKE_Fortran_FORMAT_FIXED_FLAG"; break;
+ case cmLocalGenerator::FortranFormatFree:
+ var = "CMAKE_Fortran_FORMAT_FREE_FLAG"; break;
+ default: break;
+ }
+ if(var)
+ {
+ this->LocalGenerator->AppendFlags(
+ flags, this->Makefile->GetDefinition(var));
+ }
+}
+
+//----------------------------------------------------------------------------
+void
+cmMakefileTargetGenerator
::WriteObjectBuildFile(std::string &obj,
const char *lang,
cmSourceFile& source,
@@ -562,6 +591,12 @@ cmMakefileTargetGenerator
}
}
+ // Add Fortran format flags.
+ if(strcmp(lang, "Fortran") == 0)
+ {
+ this->AppendFortranFormatFlags(flags, source);
+ }
+
// Add flags from source file properties.
if (source.GetProperty("COMPILE_FLAGS"))
{
diff --git a/Source/cmMakefileTargetGenerator.h b/Source/cmMakefileTargetGenerator.h
index b68f8bf..674cd13 100644
--- a/Source/cmMakefileTargetGenerator.h
+++ b/Source/cmMakefileTargetGenerator.h
@@ -112,6 +112,8 @@ protected:
// Return the a string with -F flags on apple
std::string GetFrameworkFlags();
+ void AppendFortranFormatFlags(std::string& flags, cmSourceFile& source);
+
// append intertarget dependencies
void AppendTargetDepends(std::vector<std::string>& depends);
diff --git a/Source/cmSourceFile.cxx b/Source/cmSourceFile.cxx
index dfa2c0b..cd94753 100644
--- a/Source/cmSourceFile.cxx
+++ b/Source/cmSourceFile.cxx
@@ -437,6 +437,15 @@ void cmSourceFile::DefineProperties(cmake *cm)
"It will still be linked into the target though.");
cm->DefineProperty
+ ("Fortran_FORMAT", cmProperty::SOURCE_FILE,
+ "Set to FIXED or FREE to indicate the Fortran source layout.",
+ "This property tells CMake whether a given Fortran source file "
+ "uses fixed-format or free-format. "
+ "CMake will pass the corresponding format flag to the compiler. "
+ "Consider using the target-wide Fortran_FORMAT property if all "
+ "source files in a target share the same format.");
+
+ cm->DefineProperty
("GENERATED", cmProperty::SOURCE_FILE,
"Is this source file generated as part of the build process.",
"If a source file is generated by the build process CMake will "
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index 4969b65..fb92016 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -919,6 +919,17 @@ void cmTarget::DefineProperties(cmake *cm)
);
cm->DefineProperty
+ ("Fortran_FORMAT", cmProperty::TARGET,
+ "Set to FIXED or FREE to indicate the Fortran source layout.",
+ "This property tells CMake whether the Fortran source files "
+ "in a target use fixed-format or free-format. "
+ "CMake will pass the corresponding format flag to the compiler. "
+ "Use the source-specific Fortran_FORMAT property to change the "
+ "format of a specific source file. "
+ "If the variable CMAKE_Fortran_FORMAT is set when a target "
+ "is created its value is used to initialize this property.");
+
+ cm->DefineProperty
("Fortran_MODULE_DIRECTORY", cmProperty::TARGET,
"Specify output directory for Fortran modules provided by the target.",
"If the target contains Fortran source files that provide modules "
@@ -1138,6 +1149,7 @@ void cmTarget::SetMakefile(cmMakefile* mf)
this->SetPropertyDefault("ARCHIVE_OUTPUT_DIRECTORY", 0);
this->SetPropertyDefault("LIBRARY_OUTPUT_DIRECTORY", 0);
this->SetPropertyDefault("RUNTIME_OUTPUT_DIRECTORY", 0);
+ this->SetPropertyDefault("Fortran_FORMAT", 0);
this->SetPropertyDefault("Fortran_MODULE_DIRECTORY", 0);
this->SetPropertyDefault("OSX_ARCHITECTURES", 0);
this->SetPropertyDefault("AUTOMOC", 0);
@@ -3789,8 +3801,12 @@ bool cmTarget::ComputeOutputDir(const char* config,
// The generator may add the configuration's subdirectory.
if(config && *config)
{
+ const char *platforms = this->Makefile->GetDefinition(
+ "CMAKE_XCODE_EFFECTIVE_PLATFORMS");
+ std::string suffix =
+ usesDefaultOutputDir && platforms ? "$(EFFECTIVE_PLATFORM_NAME)" : "";
this->Makefile->GetLocalGenerator()->GetGlobalGenerator()->
- AppendDirectoryForConfig("/", config, "", out);
+ AppendDirectoryForConfig("/", config, suffix.c_str(), out);
}
return usesDefaultOutputDir;
diff --git a/Source/cmake.cxx b/Source/cmake.cxx
index 2b8c718..41c67e2 100644
--- a/Source/cmake.cxx
+++ b/Source/cmake.cxx
@@ -1112,7 +1112,6 @@ void CMakeCommandUsage(const char* program)
errorStream
<< "Usage: " << program << " -E [command] [arguments ...]\n"
<< "Available commands: \n"
- << " build build_dir - build the project in build_dir.\n"
<< " chdir dir cmd [args]... - run command in a given directory\n"
<< " compare_files file1 file2 - check if file1 is same as file2\n"
<< " copy file destination - copy file to destination (either file "
@@ -2531,6 +2530,13 @@ int cmake::Generate()
this->ReportUndefinedPropertyAccesses
(this->GetProperty("REPORT_UNDEFINED_PROPERTIES"));
}
+ // Save the cache again after a successful Generate so that any internal
+ // variables created during Generate are saved. (Specifically target GUIDs
+ // for the Visual Studio and Xcode generators.)
+ if ( this->GetWorkingMode() == NORMAL_MODE )
+ {
+ this->CacheManager->SaveCache(this->GetHomeOutputDirectory());
+ }
return 0;
}
diff --git a/Source/cmakemain.cxx b/Source/cmakemain.cxx
index 9f213a5..436236d 100644
--- a/Source/cmakemain.cxx
+++ b/Source/cmakemain.cxx
@@ -72,7 +72,7 @@ static const char * cmDocumentationOptions[][3] =
{"-E", "CMake command mode.",
"For true platform independence, CMake provides a list of commands "
"that can be used on all systems. Run with -E help for the usage "
- "information. Commands available are: build, chdir, compare_files, copy, "
+ "information. Commands available are: chdir, compare_files, copy, "
"copy_directory, copy_if_different, echo, echo_append, environment, "
"make_directory, md5sum, remove, remove_directory, rename, tar, time, "
"touch, touch_nocreate. In addition, some platform specific commands "
diff --git a/Source/kwsys/Glob.cxx b/Source/kwsys/Glob.cxx
index c1f5100..513eb64 100644
--- a/Source/kwsys/Glob.cxx
+++ b/Source/kwsys/Glob.cxx
@@ -215,7 +215,7 @@ kwsys_stl::string Glob::PatternToRegex(const kwsys_stl::string& pattern,
//----------------------------------------------------------------------------
void Glob::RecurseDirectory(kwsys_stl::string::size_type start,
- const kwsys_stl::string& dir, bool dir_only)
+ const kwsys_stl::string& dir)
{
kwsys::Directory d;
if ( !d.Load(dir.c_str()) )
@@ -258,25 +258,24 @@ void Glob::RecurseDirectory(kwsys_stl::string::size_type start,
fullname = dir + "/" + fname;
}
- if ( !dir_only || !kwsys::SystemTools::FileIsDirectory(realname.c_str()) )
+ bool isDir = kwsys::SystemTools::FileIsDirectory(realname.c_str());
+ bool isSymLink = kwsys::SystemTools::FileIsSymlink(realname.c_str());
+
+ if ( isDir && (!isSymLink || this->RecurseThroughSymlinks) )
{
- if ( (this->Internals->Expressions.size() > 0) &&
- this->Internals->Expressions[
- this->Internals->Expressions.size()-1].find(fname.c_str()) )
+ if (isSymLink)
{
- this->AddFile(this->Internals->Files, realname.c_str());
+ ++this->FollowedSymlinkCount;
}
+ this->RecurseDirectory(start+1, realname);
}
- if ( kwsys::SystemTools::FileIsDirectory(realname.c_str()) )
+ else
{
- bool isSymLink = kwsys::SystemTools::FileIsSymlink(realname.c_str());
- if (!isSymLink || this->RecurseThroughSymlinks)
+ if ( (this->Internals->Expressions.size() > 0) &&
+ this->Internals->Expressions[
+ this->Internals->Expressions.size()-1].find(fname.c_str()) )
{
- if (isSymLink)
- {
- ++this->FollowedSymlinkCount;
- }
- this->RecurseDirectory(start+1, realname, dir_only);
+ this->AddFile(this->Internals->Files, realname.c_str());
}
}
}
@@ -284,13 +283,13 @@ void Glob::RecurseDirectory(kwsys_stl::string::size_type start,
//----------------------------------------------------------------------------
void Glob::ProcessDirectory(kwsys_stl::string::size_type start,
- const kwsys_stl::string& dir, bool dir_only)
+ const kwsys_stl::string& dir)
{
//kwsys_ios::cout << "ProcessDirectory: " << dir << kwsys_ios::endl;
bool last = ( start == this->Internals->Expressions.size()-1 );
if ( last && this->Recurse )
{
- this->RecurseDirectory(start, dir, dir_only);
+ this->RecurseDirectory(start, dir);
return;
}
@@ -345,7 +344,7 @@ void Glob::ProcessDirectory(kwsys_stl::string::size_type start,
// << this->Internals->TextExpressions[start].c_str() << kwsys_ios::endl;
//kwsys_ios::cout << "Full name: " << fullname << kwsys_ios::endl;
- if ( (!dir_only || !last) &&
+ if ( !last &&
!kwsys::SystemTools::FileIsDirectory(realname.c_str()) )
{
continue;
@@ -359,7 +358,7 @@ void Glob::ProcessDirectory(kwsys_stl::string::size_type start,
}
else
{
- this->ProcessDirectory(start+1, realname + "/", dir_only);
+ this->ProcessDirectory(start+1, realname + "/");
}
}
}
@@ -462,12 +461,11 @@ bool Glob::FindFiles(const kwsys_stl::string& inexpr)
// Handle network paths
if ( skip > 0 )
{
- this->ProcessDirectory(0, fexpr.substr(0, skip) + "/",
- true);
+ this->ProcessDirectory(0, fexpr.substr(0, skip) + "/");
}
else
{
- this->ProcessDirectory(0, "/", true);
+ this->ProcessDirectory(0, "/");
}
return true;
}
diff --git a/Source/kwsys/Glob.hxx.in b/Source/kwsys/Glob.hxx.in
index cb050ee..88c343c 100644
--- a/Source/kwsys/Glob.hxx.in
+++ b/Source/kwsys/Glob.hxx.in
@@ -83,12 +83,12 @@ public:
protected:
//! Process directory
void ProcessDirectory(kwsys_stl::string::size_type start,
- const kwsys_stl::string& dir, bool dir_only);
+ const kwsys_stl::string& dir);
//! Process last directory, but only when recurse flags is on. That is
// effectively like saying: /path/to/file/**/file
void RecurseDirectory(kwsys_stl::string::size_type start,
- const kwsys_stl::string& dir, bool dir_only);
+ const kwsys_stl::string& dir);
//! Add regular expression
void AddExpression(const char* expr);
diff --git a/Source/kwsys/kwsysDateStamp.cmake b/Source/kwsys/kwsysDateStamp.cmake
index 5cb5fc9..fa561b5 100644
--- a/Source/kwsys/kwsysDateStamp.cmake
+++ b/Source/kwsys/kwsysDateStamp.cmake
@@ -18,4 +18,4 @@ SET(KWSYS_DATE_STAMP_YEAR 2011)
SET(KWSYS_DATE_STAMP_MONTH 09)
# KWSys version date day component. Format is DD.
-SET(KWSYS_DATE_STAMP_DAY 05)
+SET(KWSYS_DATE_STAMP_DAY 21)