From 3f064efe40cdf9d2eac955581b171e0c723e92a2 Mon Sep 17 00:00:00 2001 From: Manuel Klimek Date: Wed, 12 Jan 2011 20:06:25 -0800 Subject: refactor flags and defines --- Source/cmMakefileTargetGenerator.cxx | 120 +++++++++++++++++++---------------- Source/cmMakefileTargetGenerator.h | 3 + 2 files changed, 68 insertions(+), 55 deletions(-) diff --git a/Source/cmMakefileTargetGenerator.cxx b/Source/cmMakefileTargetGenerator.cxx index 69320da..01545fc 100644 --- a/Source/cmMakefileTargetGenerator.cxx +++ b/Source/cmMakefileTargetGenerator.cxx @@ -249,6 +249,66 @@ void cmMakefileTargetGenerator::WriteCommonCodeRules() } //---------------------------------------------------------------------------- +std::string cmMakefileTargetGenerator::GetFlags(const std::string &l) { + std::string flags; + const char *lang = l.c_str(); + + bool shared = ((this->Target->GetType() == cmTarget::SHARED_LIBRARY) || + (this->Target->GetType() == cmTarget::MODULE_LIBRARY)); + + // Add language feature flags. + this->AddFeatureFlags(flags, lang); + + this->LocalGenerator->AddArchitectureFlags(flags, this->Target, + lang, this->ConfigName); + + // Fortran-specific flags computed for this target. + if(l == "Fortran") + { + this->AddFortranFlags(flags); + } + + // Add shared-library flags if needed. + this->LocalGenerator->AddSharedFlags(flags, lang, shared); + + // Add include directory flags. + this->AddIncludeFlags(flags, lang); + + // Append old-style preprocessor definition flags. + this->LocalGenerator-> + AppendFlags(flags, this->Makefile->GetDefineFlags()); + + // Add include directory flags. + this->LocalGenerator-> + AppendFlags(flags,this->GetFrameworkFlags().c_str()); + + return flags; +} + +std::string cmMakefileTargetGenerator::GetDefines(const std::string &l) { + std::string defines; + const char *lang = l.c_str(); + // Add the export symbol definition for shared library objects. + if(const char* exportMacro = this->Target->GetExportMacro()) + { + this->LocalGenerator->AppendDefines(defines, exportMacro, lang); + } + + // Add preprocessor definitions for this target and configuration. + this->LocalGenerator->AppendDefines + (defines, this->Makefile->GetProperty("COMPILE_DEFINITIONS"), lang); + this->LocalGenerator->AppendDefines + (defines, this->Target->GetProperty("COMPILE_DEFINITIONS"), lang); + std::string defPropName = "COMPILE_DEFINITIONS_"; + defPropName += + cmSystemTools::UpperCase(this->LocalGenerator->ConfigurationName); + this->LocalGenerator->AppendDefines + (defines, this->Makefile->GetProperty(defPropName.c_str()), lang); + this->LocalGenerator->AppendDefines + (defines, this->Target->GetProperty(defPropName.c_str()), lang); + return defines; +} + void cmMakefileTargetGenerator::WriteTargetLanguageFlags() { // write language flags for target @@ -262,72 +322,22 @@ void cmMakefileTargetGenerator::WriteTargetLanguageFlags() cmStdString compiler = "CMAKE_"; compiler += *l; compiler += "_COMPILER"; - *this->FlagFileStream << "# compile " << l->c_str() << " with " << + *this->FlagFileStream << "# compile " << l->c_str() << " with " << this->Makefile->GetSafeDefinition(compiler.c_str()) << "\n"; } for(std::set::const_iterator l = languages.begin(); l != languages.end(); ++l) { - const char *lang = l->c_str(); - std::string flags; - std::string defines; - bool shared = ((this->Target->GetType() == cmTarget::SHARED_LIBRARY) || - (this->Target->GetType() == cmTarget::MODULE_LIBRARY)); - - // Add the export symbol definition for shared library objects. - if(const char* exportMacro = this->Target->GetExportMacro()) - { - this->LocalGenerator->AppendDefines(defines, exportMacro, lang); - } - - // Add preprocessor definitions for this target and configuration. - this->LocalGenerator->AppendDefines - (defines, this->Makefile->GetProperty("COMPILE_DEFINITIONS"), lang); - this->LocalGenerator->AppendDefines - (defines, this->Target->GetProperty("COMPILE_DEFINITIONS"), lang); - std::string defPropName = "COMPILE_DEFINITIONS_"; - defPropName += - cmSystemTools::UpperCase(this->LocalGenerator->ConfigurationName); - this->LocalGenerator->AppendDefines - (defines, this->Makefile->GetProperty(defPropName.c_str()), lang); - this->LocalGenerator->AppendDefines - (defines, this->Target->GetProperty(defPropName.c_str()), lang); - - // Add language feature flags. - this->AddFeatureFlags(flags, lang); - - this->LocalGenerator->AddArchitectureFlags(flags, this->Target, - lang, this->ConfigName); - - // Fortran-specific flags computed for this target. - if(*l == "Fortran") - { - this->AddFortranFlags(flags); - } - - // Add shared-library flags if needed. - this->LocalGenerator->AddSharedFlags(flags, lang, shared); - - // Add include directory flags. - this->AddIncludeFlags(flags, lang); - - // Append old-style preprocessor definition flags. - this->LocalGenerator-> - AppendFlags(flags, this->Makefile->GetDefineFlags()); - - // Add include directory flags. - this->LocalGenerator-> - AppendFlags(flags,this->GetFrameworkFlags().c_str()); - - *this->FlagFileStream << lang << "_FLAGS = " << flags << "\n\n"; - *this->FlagFileStream << lang << "_DEFINES = " << defines << "\n\n"; + *this->FlagFileStream << *l << "_FLAGS = " << this->GetFlags(*l) << "\n\n"; + *this->FlagFileStream << *l << "_DEFINES = " << this->GetDefines(*l) << + "\n\n"; } // Add target-specific flags. if(this->Target->GetProperty("COMPILE_FLAGS")) { - std::string flags; + std::string flags; this->LocalGenerator->AppendFlags (flags, this->Target->GetProperty("COMPILE_FLAGS")); *this->FlagFileStream << "# TARGET_FLAGS = " << flags << "\n\n"; diff --git a/Source/cmMakefileTargetGenerator.h b/Source/cmMakefileTargetGenerator.h index bd26795..0005b48 100644 --- a/Source/cmMakefileTargetGenerator.h +++ b/Source/cmMakefileTargetGenerator.h @@ -216,6 +216,9 @@ protected: std::string MacContentDirectory; std::set MacContentFolders; + std::string GetFlags(const std::string &l); + std::string GetDefines(const std::string &l); + // Target-wide Fortran module output directory. bool FortranModuleDirectoryComputed; std::string FortranModuleDirectory; -- cgit v0.12 From 65c0c24a296c12c8037361cc5c53d884c4cde5f0 Mon Sep 17 00:00:00 2001 From: Manuel Klimek Date: Fri, 14 Jan 2011 14:28:38 -0800 Subject: cache flags and defines --- Source/cmMakefileTargetGenerator.cxx | 97 +++++++++++++++++++----------------- Source/cmMakefileTargetGenerator.h | 2 + 2 files changed, 54 insertions(+), 45 deletions(-) diff --git a/Source/cmMakefileTargetGenerator.cxx b/Source/cmMakefileTargetGenerator.cxx index 01545fc..1c45f18 100644 --- a/Source/cmMakefileTargetGenerator.cxx +++ b/Source/cmMakefileTargetGenerator.cxx @@ -250,63 +250,70 @@ void cmMakefileTargetGenerator::WriteCommonCodeRules() //---------------------------------------------------------------------------- std::string cmMakefileTargetGenerator::GetFlags(const std::string &l) { - std::string flags; - const char *lang = l.c_str(); + std::pair::iterator, bool> + insert_result = this->FlagsByLanguage.insert(std::make_pair(l, "")); + if (insert_result.second) { + std::string& flags = insert_result.first->second; + const char *lang = l.c_str(); - bool shared = ((this->Target->GetType() == cmTarget::SHARED_LIBRARY) || - (this->Target->GetType() == cmTarget::MODULE_LIBRARY)); + bool shared = ((this->Target->GetType() == cmTarget::SHARED_LIBRARY) || + (this->Target->GetType() == cmTarget::MODULE_LIBRARY)); - // Add language feature flags. - this->AddFeatureFlags(flags, lang); + // Add language feature flags. + this->AddFeatureFlags(flags, lang); - this->LocalGenerator->AddArchitectureFlags(flags, this->Target, - lang, this->ConfigName); + this->LocalGenerator->AddArchitectureFlags(flags, this->Target, + lang, this->ConfigName); - // Fortran-specific flags computed for this target. - if(l == "Fortran") - { - this->AddFortranFlags(flags); - } - - // Add shared-library flags if needed. - this->LocalGenerator->AddSharedFlags(flags, lang, shared); + // Fortran-specific flags computed for this target. + if(l == "Fortran") + { + this->AddFortranFlags(flags); + } - // Add include directory flags. - this->AddIncludeFlags(flags, lang); + // Add shared-library flags if needed. + this->LocalGenerator->AddSharedFlags(flags, lang, shared); - // Append old-style preprocessor definition flags. - this->LocalGenerator-> - AppendFlags(flags, this->Makefile->GetDefineFlags()); + // Add include directory flags. + this->AddIncludeFlags(flags, lang); - // Add include directory flags. - this->LocalGenerator-> - AppendFlags(flags,this->GetFrameworkFlags().c_str()); + // Append old-style preprocessor definition flags. + this->LocalGenerator-> + AppendFlags(flags, this->Makefile->GetDefineFlags()); - return flags; + // Add include directory flags. + this->LocalGenerator-> + AppendFlags(flags,this->GetFrameworkFlags().c_str()); + } + return insert_result.first->second; } std::string cmMakefileTargetGenerator::GetDefines(const std::string &l) { - std::string defines; - const char *lang = l.c_str(); - // Add the export symbol definition for shared library objects. - if(const char* exportMacro = this->Target->GetExportMacro()) - { - this->LocalGenerator->AppendDefines(defines, exportMacro, lang); - } + std::pair::iterator, bool> + insert_result = this->DefinesByLanguage.insert(std::make_pair(l, "")); + if (insert_result.second) { + std::string &defines = insert_result.first->second; + const char *lang = l.c_str(); + // Add the export symbol definition for shared library objects. + if(const char* exportMacro = this->Target->GetExportMacro()) + { + this->LocalGenerator->AppendDefines(defines, exportMacro, lang); + } - // Add preprocessor definitions for this target and configuration. - this->LocalGenerator->AppendDefines - (defines, this->Makefile->GetProperty("COMPILE_DEFINITIONS"), lang); - this->LocalGenerator->AppendDefines - (defines, this->Target->GetProperty("COMPILE_DEFINITIONS"), lang); - std::string defPropName = "COMPILE_DEFINITIONS_"; - defPropName += - cmSystemTools::UpperCase(this->LocalGenerator->ConfigurationName); - this->LocalGenerator->AppendDefines - (defines, this->Makefile->GetProperty(defPropName.c_str()), lang); - this->LocalGenerator->AppendDefines - (defines, this->Target->GetProperty(defPropName.c_str()), lang); - return defines; + // Add preprocessor definitions for this target and configuration. + this->LocalGenerator->AppendDefines + (defines, this->Makefile->GetProperty("COMPILE_DEFINITIONS"), lang); + this->LocalGenerator->AppendDefines + (defines, this->Target->GetProperty("COMPILE_DEFINITIONS"), lang); + std::string defPropName = "COMPILE_DEFINITIONS_"; + defPropName += + cmSystemTools::UpperCase(this->LocalGenerator->ConfigurationName); + this->LocalGenerator->AppendDefines + (defines, this->Makefile->GetProperty(defPropName.c_str()), lang); + this->LocalGenerator->AppendDefines + (defines, this->Target->GetProperty(defPropName.c_str()), lang); + } + return insert_result.first->second; } void cmMakefileTargetGenerator::WriteTargetLanguageFlags() diff --git a/Source/cmMakefileTargetGenerator.h b/Source/cmMakefileTargetGenerator.h index 0005b48..db87ebc 100644 --- a/Source/cmMakefileTargetGenerator.h +++ b/Source/cmMakefileTargetGenerator.h @@ -217,7 +217,9 @@ protected: std::set MacContentFolders; std::string GetFlags(const std::string &l); + std::map FlagsByLanguage; std::string GetDefines(const std::string &l); + std::map DefinesByLanguage; // Target-wide Fortran module output directory. bool FortranModuleDirectoryComputed; -- cgit v0.12 From fe07b0557b0b6cc47c29547d9c1d30a2b440fcd8 Mon Sep 17 00:00:00 2001 From: Manuel Klimek Date: Wed, 12 Jan 2011 20:39:13 -0800 Subject: implement cxx command output --- Source/cmGlobalUnixMakefileGenerator3.cxx | 41 +++++++++++++++++++++++++++++++ Source/cmGlobalUnixMakefileGenerator3.h | 6 +++++ Source/cmMakefileTargetGenerator.cxx | 21 ++++++++++++++-- 3 files changed, 66 insertions(+), 2 deletions(-) diff --git a/Source/cmGlobalUnixMakefileGenerator3.cxx b/Source/cmGlobalUnixMakefileGenerator3.cxx index d9a341c..92f87c9 100644 --- a/Source/cmGlobalUnixMakefileGenerator3.cxx +++ b/Source/cmGlobalUnixMakefileGenerator3.cxx @@ -31,6 +31,7 @@ cmGlobalUnixMakefileGenerator3::cmGlobalUnixMakefileGenerator3() #else this->UseLinkScript = true; #endif + this->CommandDatabase = NULL; } void cmGlobalUnixMakefileGenerator3 @@ -139,6 +140,17 @@ void cmGlobalUnixMakefileGenerator3 } //---------------------------------------------------------------------------- +std::string EscapeJSON(const std::string& s) { + std::string result; + for (int i = 0; i < s.size(); ++i) { + if (s[i] == '"' || s[i] == '\\') { + result += '\\'; + } + result += s[i]; + } + return result; +} + void cmGlobalUnixMakefileGenerator3::Generate() { // first do superclass method @@ -189,6 +201,35 @@ void cmGlobalUnixMakefileGenerator3::Generate() // write the main makefile this->WriteMainMakefile2(); this->WriteMainCMakefile(); + + if (this->CommandDatabase != NULL) { + *this->CommandDatabase << std::endl << "]"; + delete this->CommandDatabase; + this->CommandDatabase = NULL; + } +} + +void cmGlobalUnixMakefileGenerator3::AddCXXCompileCommand( + const std::string &sourceFile, const std::string &workingDirectory, + const std::string &compileCommand) { + if (this->CommandDatabase == NULL) + { + std::string commandDatabaseName = + std::string(this->GetCMakeInstance()->GetHomeOutputDirectory()) + + "/cxx_commands.json"; + this->CommandDatabase = + new cmGeneratedFileStream(commandDatabaseName.c_str()); + *this->CommandDatabase << "[" << std::endl; + } else { + *this->CommandDatabase << "," << std::endl; + } + *this->CommandDatabase << "{" << std::endl + << " \"directory\": \"" << EscapeJSON(workingDirectory) << "\"," + << std::endl + << " \"command\": \"" << EscapeJSON(compileCommand) << "\"," + << std::endl + << " \"file\": \"" << EscapeJSON(sourceFile) << "\"" + << std::endl << "}"; } void cmGlobalUnixMakefileGenerator3::WriteMainMakefile2() diff --git a/Source/cmGlobalUnixMakefileGenerator3.h b/Source/cmGlobalUnixMakefileGenerator3.h index cdc9460..a152e01 100644 --- a/Source/cmGlobalUnixMakefileGenerator3.h +++ b/Source/cmGlobalUnixMakefileGenerator3.h @@ -112,6 +112,10 @@ public: /** Record per-target progress information. */ void RecordTargetProgress(cmMakefileTargetGenerator* tg); + void AddCXXCompileCommand(const std::string &sourceFile, + const std::string &workingDirectory, + const std::string &compileCommand); + protected: void WriteMainMakefile2(); void WriteMainCMakefile(); @@ -178,6 +182,8 @@ protected: size_t CountProgressMarksInTarget(cmTarget* target, std::set& emitted); size_t CountProgressMarksInAll(cmLocalUnixMakefileGenerator3* lg); + + cmGeneratedFileStream *CommandDatabase; }; #endif diff --git a/Source/cmMakefileTargetGenerator.cxx b/Source/cmMakefileTargetGenerator.cxx index 1c45f18..e5df2f4 100644 --- a/Source/cmMakefileTargetGenerator.cxx +++ b/Source/cmMakefileTargetGenerator.cxx @@ -658,6 +658,9 @@ cmMakefileTargetGenerator vars.Flags = flags.c_str(); vars.Defines = defines.c_str(); + bool lang_is_c_or_cxx = ((strcmp(lang, "C") == 0) || + (strcmp(lang, "CXX") == 0)); + // Construct the compile rules. { std::string compileRuleVar = "CMAKE_"; @@ -668,6 +671,22 @@ cmMakefileTargetGenerator std::vector compileCommands; cmSystemTools::ExpandListArgument(compileRule, compileCommands); + if (lang_is_c_or_cxx && compileCommands.size() == 1) + { + std::string compileCommand = compileCommands[0]; + this->LocalGenerator->ExpandRuleVariables(compileCommand, vars); + std::string workingDirectory = + this->LocalGenerator->Convert( + this->Makefile->GetStartOutputDirectory(), cmLocalGenerator::FULL); + compileCommand.replace(compileCommand.find(langFlags), + langFlags.size(), this->GetFlags(lang)); + std::string langDefines = std::string("$(") + lang + "_DEFINES)"; + compileCommand.replace(compileCommand.find(langDefines), + langDefines.size(), this->GetDefines(lang)); + this->GlobalGenerator->AddCXXCompileCommand( + source.GetFullPath(), workingDirectory, compileCommand); + } + // Expand placeholders in the commands. for(std::vector::iterator i = compileCommands.begin(); i != compileCommands.end(); ++i) @@ -708,8 +727,6 @@ cmMakefileTargetGenerator } } - bool lang_is_c_or_cxx = ((strcmp(lang, "C") == 0) || - (strcmp(lang, "CXX") == 0)); bool do_preprocess_rules = lang_is_c_or_cxx && this->LocalGenerator->GetCreatePreprocessedSourceRules(); bool do_assembly_rules = lang_is_c_or_cxx && -- cgit v0.12 From 5674844de4b74d0b66cfc6b8237e631702c43637 Mon Sep 17 00:00:00 2001 From: Manuel Klimek Date: Fri, 14 Jan 2011 15:16:11 -0800 Subject: make compile command output optional --- Modules/CMakeGenericSystem.cmake | 3 +++ Source/cmGlobalUnixMakefileGenerator3.cxx | 2 +- Source/cmMakefileTargetGenerator.cxx | 3 ++- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/Modules/CMakeGenericSystem.cmake b/Modules/CMakeGenericSystem.cmake index b5d3072..e64d0ba 100644 --- a/Modules/CMakeGenericSystem.cmake +++ b/Modules/CMakeGenericSystem.cmake @@ -50,6 +50,9 @@ IF(CMAKE_GENERATOR MATCHES "Makefiles") IF(DEFINED CMAKE_RULE_MESSAGES) SET_PROPERTY(GLOBAL PROPERTY RULE_MESSAGES ${CMAKE_RULE_MESSAGES}) ENDIF(DEFINED CMAKE_RULE_MESSAGES) + SET(CMAKE_EXPORT_COMPILE_COMMANDS OFF CACHE BOOL + "Enable/Disable output of compile commands during generation." + ) ENDIF(CMAKE_GENERATOR MATCHES "Makefiles") diff --git a/Source/cmGlobalUnixMakefileGenerator3.cxx b/Source/cmGlobalUnixMakefileGenerator3.cxx index 92f87c9..54f2b03 100644 --- a/Source/cmGlobalUnixMakefileGenerator3.cxx +++ b/Source/cmGlobalUnixMakefileGenerator3.cxx @@ -216,7 +216,7 @@ void cmGlobalUnixMakefileGenerator3::AddCXXCompileCommand( { std::string commandDatabaseName = std::string(this->GetCMakeInstance()->GetHomeOutputDirectory()) - + "/cxx_commands.json"; + + "/compile_commands.json"; this->CommandDatabase = new cmGeneratedFileStream(commandDatabaseName.c_str()); *this->CommandDatabase << "[" << std::endl; diff --git a/Source/cmMakefileTargetGenerator.cxx b/Source/cmMakefileTargetGenerator.cxx index e5df2f4..6d3fbe0 100644 --- a/Source/cmMakefileTargetGenerator.cxx +++ b/Source/cmMakefileTargetGenerator.cxx @@ -671,7 +671,8 @@ cmMakefileTargetGenerator std::vector compileCommands; cmSystemTools::ExpandListArgument(compileRule, compileCommands); - if (lang_is_c_or_cxx && compileCommands.size() == 1) + if (this->Makefile->IsOn("CMAKE_EXPORT_COMPILE_COMMANDS") && + lang_is_c_or_cxx && compileCommands.size() == 1) { std::string compileCommand = compileCommands[0]; this->LocalGenerator->ExpandRuleVariables(compileCommand, vars); -- cgit v0.12 From 0e6b05fcba61a1b113b841dd2b3e1e5060866d0e Mon Sep 17 00:00:00 2001 From: Manuel Klimek Date: Thu, 31 Mar 2011 16:55:00 -0700 Subject: Adds a test for the compile command line output. --- Tests/CMakeLib/CMakeLists.txt | 3 + Tests/CMakeLib/run_compile_commands.cxx | 132 +++++++++++++++++++++ Tests/CMakeLists.txt | 3 + Tests/CompileCommandOutput/CMakeLists.txt | 11 ++ .../compile_command_output.cxx | 9 ++ Tests/CompileCommandOutput/file with spaces.cxx | 3 + Tests/CompileCommandOutput/file with spaces.h | 1 + Tests/CompileCommandOutput/relative.cxx | 3 + Tests/CompileCommandOutput/relative.h | 1 + 9 files changed, 166 insertions(+) create mode 100644 Tests/CMakeLib/run_compile_commands.cxx create mode 100644 Tests/CompileCommandOutput/CMakeLists.txt create mode 100644 Tests/CompileCommandOutput/compile_command_output.cxx create mode 100644 Tests/CompileCommandOutput/file with spaces.cxx create mode 100644 Tests/CompileCommandOutput/file with spaces.h create mode 100644 Tests/CompileCommandOutput/relative.cxx create mode 100644 Tests/CompileCommandOutput/relative.h diff --git a/Tests/CMakeLib/CMakeLists.txt b/Tests/CMakeLib/CMakeLists.txt index bda2fa5..7815545 100644 --- a/Tests/CMakeLib/CMakeLists.txt +++ b/Tests/CMakeLib/CMakeLists.txt @@ -30,3 +30,6 @@ endif() foreach(test ${CMakeLib_TESTS}) add_test(CMakeLib.${test} CMakeLibTests ${test}) endforeach() + +ADD_EXECUTABLE(runcompilecommands run_compile_commands.cxx) +TARGET_LINK_LIBRARIES(runcompilecommands CMakeLib) diff --git a/Tests/CMakeLib/run_compile_commands.cxx b/Tests/CMakeLib/run_compile_commands.cxx new file mode 100644 index 0000000..c925167 --- /dev/null +++ b/Tests/CMakeLib/run_compile_commands.cxx @@ -0,0 +1,132 @@ +#include "cmSystemTools.h" + +class CompileCommandParser { +public: + typedef std::map CommandType; + typedef std::vector TranslationUnitsType; + + CompileCommandParser(std::ifstream *input) + { + this->Input = input; + } + + void Parse() + { + NextNonWhitespace(); + ParseTranslationUnits(); + } + + const TranslationUnitsType& GetTranslationUnits() + { + return this->TranslationUnits; + } + +private: + void ParseTranslationUnits() + { + this->TranslationUnits = TranslationUnitsType(); + ExpectOrDie('[', "at start of compile command file"); + do + { + ParseTranslationUnit(); + this->TranslationUnits.push_back(this->Command); + } while(Expect(',')); + ExpectOrDie(']', "at end of array"); + } + + void ParseTranslationUnit() + { + this->Command = CommandType(); + if(!Expect('{')) return; + if(Expect('}')) return; + do + { + ParseString(); + std::string name = this->String; + ExpectOrDie(':', "between name and value"); + ParseString(); + std::string value = this->String; + this->Command[name] = value; + } while(Expect(',')); + ExpectOrDie('}', "at end of object"); + } + + void ParseString() + { + this->String.clear(); + if(!Expect('"')) return; + while (!Expect('"')) + { + Expect('\\'); + this->String.push_back(C); + Next(); + } + } + + bool Expect(char c) + { + if(this->C == c) + { + NextNonWhitespace(); + return true; + } + return false; + } + + void ExpectOrDie(char c, const std::string & message) + { + if (!Expect(c)) + ErrorExit(std::string("'") + c + "' expected " + message + "."); + } + + void NextNonWhitespace() + { + do { Next(); } while (IsWhitespace()); + } + + void Next() + { + this->C = Input->get(); + if (this->Input->bad()) ErrorExit("Unexpected end of file."); + } + + void ErrorExit(const std::string &message) { + std::cout << "ERROR: " << message; + exit(1); + } + + bool IsWhitespace() + { + return (this->C == ' ' || this->C == '\t' || + this->C == '\n' || this->C == '\r'); + } + + char C; + TranslationUnitsType TranslationUnits; + CommandType Command; + std::string String; + std::ifstream *Input; +}; + +int main () +{ + std::ifstream file("compile_commands.json"); + CompileCommandParser parser(&file); + parser.Parse(); + for(CompileCommandParser::TranslationUnitsType::const_iterator + it = parser.GetTranslationUnits().begin(), + end = parser.GetTranslationUnits().end(); it != end; ++it) + { + std::vector std_command; + cmSystemTools::ParseUnixCommandLine(it->at("command").c_str(), std_command); + std::vector command(std_command.begin(), std_command.end()); + if (!cmSystemTools::RunSingleCommand( + command, 0, 0, it->at("directory").c_str())) + { + std::cout << "ERROR: Failed to run command \"" + << command[0] << "\"" << std::endl; + exit(1); + } + } + return 0; +} diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt index 157814e..126eadd 100644 --- a/Tests/CMakeLists.txt +++ b/Tests/CMakeLists.txt @@ -2031,6 +2031,9 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ ENDIF() SET_TESTS_PROPERTIES(Contracts.${project} PROPERTIES TIMEOUT ${timeout}) ENDFOREACH() + + ADD_TEST_MACRO(CompileCommandOutput + "${CMake_BINARY_DIR}/Tests/CMakeLib/runcompilecommands") ENDIF(BUILD_TESTING) SUBDIRS(CMakeTests) diff --git a/Tests/CompileCommandOutput/CMakeLists.txt b/Tests/CompileCommandOutput/CMakeLists.txt new file mode 100644 index 0000000..ac39b8b --- /dev/null +++ b/Tests/CompileCommandOutput/CMakeLists.txt @@ -0,0 +1,11 @@ +# a simple C only test case +cmake_minimum_required (VERSION 2.6) +project (CompileCommandOutput CXX) + +SET(CMAKE_EXPORT_COMPILE_COMMANDS ON) +set(CMAKE_DEBUG_POSTFIX "_test_debug_postfix") +ADD_LIBRARY(test1 STATIC "file with spaces.cxx") +ADD_LIBRARY(test2 SHARED "../CompileCommandOutput/relative.cxx") +INCLUDE_DIRECTORIES(${CompileCommandOutput_SOURCE_DIR}/../../Source) +ADD_EXECUTABLE(CompileCommandOutput compile_command_output.cxx) +TARGET_LINK_LIBRARIES(CompileCommandOutput test1 test2) diff --git a/Tests/CompileCommandOutput/compile_command_output.cxx b/Tests/CompileCommandOutput/compile_command_output.cxx new file mode 100644 index 0000000..9487c89 --- /dev/null +++ b/Tests/CompileCommandOutput/compile_command_output.cxx @@ -0,0 +1,9 @@ +#include "file with spaces.h" +#include "relative.h" + +int main (int argc, char** argv) +{ + file_with_spaces(); + relative(); + return 0; +} diff --git a/Tests/CompileCommandOutput/file with spaces.cxx b/Tests/CompileCommandOutput/file with spaces.cxx new file mode 100644 index 0000000..5759319 --- /dev/null +++ b/Tests/CompileCommandOutput/file with spaces.cxx @@ -0,0 +1,3 @@ +#include "file with spaces.h" + +void file_with_spaces() {} diff --git a/Tests/CompileCommandOutput/file with spaces.h b/Tests/CompileCommandOutput/file with spaces.h new file mode 100644 index 0000000..49b686c --- /dev/null +++ b/Tests/CompileCommandOutput/file with spaces.h @@ -0,0 +1 @@ +void file_with_spaces(); diff --git a/Tests/CompileCommandOutput/relative.cxx b/Tests/CompileCommandOutput/relative.cxx new file mode 100644 index 0000000..eae11e2 --- /dev/null +++ b/Tests/CompileCommandOutput/relative.cxx @@ -0,0 +1,3 @@ +#include "relative.h" + +void relative() {} diff --git a/Tests/CompileCommandOutput/relative.h b/Tests/CompileCommandOutput/relative.h new file mode 100644 index 0000000..2168035 --- /dev/null +++ b/Tests/CompileCommandOutput/relative.h @@ -0,0 +1 @@ +void relative(); -- cgit v0.12 From 0bfabf967fa6efdcac40f3f2e3731795eaab9256 Mon Sep 17 00:00:00 2001 From: Brad King Date: Mon, 2 May 2011 10:33:18 -0400 Subject: OpenBSD: Use 'arch -s' for host processor (#12143) On OpenBSD 'uname -p' returns a long descriptive name for the processor. Use 'arch -s' instead to get a short cpu name. Suggested-by: Stuart Henderson --- Modules/CMakeDetermineSystem.cmake | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Modules/CMakeDetermineSystem.cmake b/Modules/CMakeDetermineSystem.cmake index 0e65bce..7ae3775 100644 --- a/Modules/CMakeDetermineSystem.cmake +++ b/Modules/CMakeDetermineSystem.cmake @@ -50,14 +50,17 @@ IF(CMAKE_HOST_UNIX) IF(CMAKE_HOST_SYSTEM_NAME MATCHES "Linux|CYGWIN.*") EXEC_PROGRAM(uname ARGS -m OUTPUT_VARIABLE CMAKE_HOST_SYSTEM_PROCESSOR RETURN_VALUE val) - ELSE(CMAKE_HOST_SYSTEM_NAME MATCHES "Linux|CYGWIN.*") + ELSEIF(CMAKE_HOST_SYSTEM_NAME MATCHES "OpenBSD") + EXEC_PROGRAM(arch ARGS -s OUTPUT_VARIABLE CMAKE_HOST_SYSTEM_PROCESSOR + RETURN_VALUE val) + ELSE() EXEC_PROGRAM(uname ARGS -p OUTPUT_VARIABLE CMAKE_HOST_SYSTEM_PROCESSOR RETURN_VALUE val) IF("${val}" GREATER 0) EXEC_PROGRAM(uname ARGS -m OUTPUT_VARIABLE CMAKE_HOST_SYSTEM_PROCESSOR RETURN_VALUE val) ENDIF("${val}" GREATER 0) - ENDIF(CMAKE_HOST_SYSTEM_NAME MATCHES "Linux|CYGWIN.*") + ENDIF() # check the return of the last uname -m or -p IF("${val}" GREATER 0) SET(CMAKE_HOST_SYSTEM_PROCESSOR "unknown") -- cgit v0.12 From c71f5806d2724d40ad2dcd5e4cad0872050aa340 Mon Sep 17 00:00:00 2001 From: KWSys Robot Date: Tue, 3 May 2011 09:03:54 -0400 Subject: KWSys Nightly Date Stamp --- Source/kwsys/kwsysDateStamp.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/kwsys/kwsysDateStamp.cmake b/Source/kwsys/kwsysDateStamp.cmake index 6938e3c..22824f8 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 05) # KWSys version date day component. Format is DD. -SET(KWSYS_DATE_STAMP_DAY 01) +SET(KWSYS_DATE_STAMP_DAY 02) -- cgit v0.12 From 9c84f747c30ff706f27e250ef67a6889ef6ab794 Mon Sep 17 00:00:00 2001 From: KWSys Robot Date: Tue, 3 May 2011 09:08:14 -0400 Subject: KWSys Nightly Date Stamp --- Source/kwsys/kwsysDateStamp.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/kwsys/kwsysDateStamp.cmake b/Source/kwsys/kwsysDateStamp.cmake index 22824f8..b835143 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 05) # KWSys version date day component. Format is DD. -SET(KWSYS_DATE_STAMP_DAY 02) +SET(KWSYS_DATE_STAMP_DAY 03) -- cgit v0.12 From d7d71ebda3dad355770c51a735b1bf68f5f50d0d Mon Sep 17 00:00:00 2001 From: Brad King Date: Tue, 3 May 2011 12:49:41 -0400 Subject: Fix case typo in CMAKE_BUILD_TYPE docs (#12148) Reported-by: Stephen Kelly --- Source/cmDocumentVariables.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/cmDocumentVariables.cxx b/Source/cmDocumentVariables.cxx index f2431e6..994445d 100644 --- a/Source/cmDocumentVariables.cxx +++ b/Source/cmDocumentVariables.cxx @@ -546,7 +546,7 @@ void cmDocumentVariables::DefineVariables(cmake* cm) "make based generators. If this variable is supported, " "then CMake will also provide initial values for the " "variables with the name " - " CMAKE_C_FLAGS_[Debug|Release|RelWithDebInfo|MinSizeRel]." + " CMAKE_C_FLAGS_[DEBUG|RELEASE|RELWITHDEBINFO|MINSIZEREL]." " For example, if CMAKE_BUILD_TYPE is Debug, then " "CMAKE_C_FLAGS_DEBUG will be added to the CMAKE_C_FLAGS.",false, "Variables That Change Behavior"); -- cgit v0.12 From aad6c4481d91db65e876c151a98f554b9c1bf7f6 Mon Sep 17 00:00:00 2001 From: KWSys Robot Date: Wed, 4 May 2011 00:01:07 -0400 Subject: KWSys Nightly Date Stamp --- Source/kwsys/kwsysDateStamp.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/kwsys/kwsysDateStamp.cmake b/Source/kwsys/kwsysDateStamp.cmake index b835143..79faeb7 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 05) # KWSys version date day component. Format is DD. -SET(KWSYS_DATE_STAMP_DAY 03) +SET(KWSYS_DATE_STAMP_DAY 04) -- cgit v0.12 From 19e3397942e176cfc44aa925396725d99bc49db4 Mon Sep 17 00:00:00 2001 From: KWSys Robot Date: Thu, 5 May 2011 00:01:06 -0400 Subject: KWSys Nightly Date Stamp --- Source/kwsys/kwsysDateStamp.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/kwsys/kwsysDateStamp.cmake b/Source/kwsys/kwsysDateStamp.cmake index 79faeb7..5342129 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 05) # KWSys version date day component. Format is DD. -SET(KWSYS_DATE_STAMP_DAY 04) +SET(KWSYS_DATE_STAMP_DAY 05) -- cgit v0.12 From 303c7e8f4087c9096e7544c327f83557582821f3 Mon Sep 17 00:00:00 2001 From: KWSys Robot Date: Fri, 6 May 2011 00:01:03 -0400 Subject: KWSys Nightly Date Stamp --- Source/kwsys/kwsysDateStamp.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/kwsys/kwsysDateStamp.cmake b/Source/kwsys/kwsysDateStamp.cmake index 5342129..467329a 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 05) # KWSys version date day component. Format is DD. -SET(KWSYS_DATE_STAMP_DAY 05) +SET(KWSYS_DATE_STAMP_DAY 06) -- cgit v0.12 From a7d8d49b8fc829e76686cbc4cc808db4a8542994 Mon Sep 17 00:00:00 2001 From: Alex Neundorf Date: Fri, 6 May 2011 22:44:45 +0200 Subject: -fix VirtualFolders in Eclipse under Windows Under Windows "locationURI" must be used for virtual folders, while "location" must be used only for linked folders. Under Linux it doesn't seem to matter. Alex --- Source/cmExtraEclipseCDT4Generator.cxx | 15 +++++++++++---- Source/cmExtraEclipseCDT4Generator.h | 3 ++- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/Source/cmExtraEclipseCDT4Generator.cxx b/Source/cmExtraEclipseCDT4Generator.cxx index c4ea425..8e26b8e 100644 --- a/Source/cmExtraEclipseCDT4Generator.cxx +++ b/Source/cmExtraEclipseCDT4Generator.cxx @@ -403,7 +403,7 @@ void cmExtraEclipseCDT4Generator::CreateProjectFile() // for each sub project create a linked resource to the source dir // - only if it is an out-of-source build this->AppendLinkedResource(fout, "[Subprojects]", - "virtual:/virtual"); + "virtual:/virtual", true); for (std::map >::const_iterator it = this->GlobalGenerator->GetProjectMap().begin(); @@ -1082,17 +1082,24 @@ void cmExtraEclipseCDT4Generator void cmExtraEclipseCDT4Generator ::AppendLinkedResource (cmGeneratedFileStream& fout, const std::string& name, - const std::string& path) + const std::string& path, + bool isVirtualFolder) { + const char* locationTag = "location"; + if (isVirtualFolder) // ... and not a linked folder + { + locationTag = "locationURI"; + } + fout << "\t\t\n" "\t\t\t" << cmExtraEclipseCDT4Generator::EscapeForXML(name) << "\n" "\t\t\t2\n" - "\t\t\t" + "\t\t\t<" << locationTag << ">" << cmExtraEclipseCDT4Generator::EscapeForXML(path) - << "\n" + << "\n" "\t\t\n" ; } diff --git a/Source/cmExtraEclipseCDT4Generator.h b/Source/cmExtraEclipseCDT4Generator.h index 99e69c4..a683731 100644 --- a/Source/cmExtraEclipseCDT4Generator.h +++ b/Source/cmExtraEclipseCDT4Generator.h @@ -87,7 +87,8 @@ private: static void AppendLinkedResource (cmGeneratedFileStream& fout, const std::string& name, - const std::string& path); + const std::string& path, + bool isVirtualFolder = false); bool AppendOutLinkedResource(cmGeneratedFileStream& fout, const std::string& defname, -- cgit v0.12 From d3e09bba6a6203635ce04b2b7f52506336eedd5d Mon Sep 17 00:00:00 2001 From: KWSys Robot Date: Sat, 7 May 2011 00:01:07 -0400 Subject: KWSys Nightly Date Stamp --- Source/kwsys/kwsysDateStamp.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/kwsys/kwsysDateStamp.cmake b/Source/kwsys/kwsysDateStamp.cmake index 467329a..524c7db 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 05) # KWSys version date day component. Format is DD. -SET(KWSYS_DATE_STAMP_DAY 06) +SET(KWSYS_DATE_STAMP_DAY 07) -- cgit v0.12 From 6aa45ac2eedb4a4bd16892c7a416dc4b029da57f Mon Sep 17 00:00:00 2001 From: KWSys Robot Date: Sun, 8 May 2011 00:01:03 -0400 Subject: KWSys Nightly Date Stamp --- Source/kwsys/kwsysDateStamp.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/kwsys/kwsysDateStamp.cmake b/Source/kwsys/kwsysDateStamp.cmake index 524c7db..c38fe66 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 05) # KWSys version date day component. Format is DD. -SET(KWSYS_DATE_STAMP_DAY 07) +SET(KWSYS_DATE_STAMP_DAY 08) -- cgit v0.12 From afa83eb4cfb19f4019e4199f17907d6c27f36cbf Mon Sep 17 00:00:00 2001 From: KWSys Robot Date: Mon, 9 May 2011 08:36:40 -0400 Subject: KWSys Nightly Date Stamp --- Source/kwsys/kwsysDateStamp.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/kwsys/kwsysDateStamp.cmake b/Source/kwsys/kwsysDateStamp.cmake index c38fe66..9d3a823 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 05) # KWSys version date day component. Format is DD. -SET(KWSYS_DATE_STAMP_DAY 08) +SET(KWSYS_DATE_STAMP_DAY 09) -- cgit v0.12 From ee9fc4b1d314d2c1804fec1286d9f317e9ed5a1b Mon Sep 17 00:00:00 2001 From: Brad King Date: Mon, 9 May 2011 08:36:59 -0400 Subject: KWSys: Fix leaked FILE in EncodeExecutable error case This leak was detected by cppcheck static analysis. Author: Hans Johnson Change-Id: I1b81cb245acb9a6033f24ecc8d1452ca4df8371a --- Source/kwsys/EncodeExecutable.c | 1 + 1 file changed, 1 insertion(+) diff --git a/Source/kwsys/EncodeExecutable.c b/Source/kwsys/EncodeExecutable.c index ba474b8..bc30568 100644 --- a/Source/kwsys/EncodeExecutable.c +++ b/Source/kwsys/EncodeExecutable.c @@ -41,6 +41,7 @@ int main(int argc, char* argv[]) if(!ofp) { fprintf(stderr, "Cannot open output file: \"%s\"\n", argv[2]); + fclose(ifp); return 2; } -- cgit v0.12 From c32262bc040837d7abe80a1f003887485ad43261 Mon Sep 17 00:00:00 2001 From: KWSys Robot Date: Tue, 10 May 2011 00:01:09 -0400 Subject: KWSys Nightly Date Stamp --- Source/kwsys/kwsysDateStamp.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/kwsys/kwsysDateStamp.cmake b/Source/kwsys/kwsysDateStamp.cmake index 9d3a823..0dd966e 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 05) # KWSys version date day component. Format is DD. -SET(KWSYS_DATE_STAMP_DAY 09) +SET(KWSYS_DATE_STAMP_DAY 10) -- cgit v0.12 From 692f62fc3ea1cbc0ec440bf7eb79dba83fa64623 Mon Sep 17 00:00:00 2001 From: KWSys Robot Date: Wed, 11 May 2011 00:01:04 -0400 Subject: KWSys Nightly Date Stamp --- Source/kwsys/kwsysDateStamp.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/kwsys/kwsysDateStamp.cmake b/Source/kwsys/kwsysDateStamp.cmake index 0dd966e..f581e97 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 05) # KWSys version date day component. Format is DD. -SET(KWSYS_DATE_STAMP_DAY 10) +SET(KWSYS_DATE_STAMP_DAY 11) -- cgit v0.12 From da9ba5726fbb89e3e909ce5e1fcd2e0814ef9460 Mon Sep 17 00:00:00 2001 From: KWSys Robot Date: Thu, 12 May 2011 00:01:04 -0400 Subject: KWSys Nightly Date Stamp --- Source/kwsys/kwsysDateStamp.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/kwsys/kwsysDateStamp.cmake b/Source/kwsys/kwsysDateStamp.cmake index f581e97..e9097a1 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 05) # KWSys version date day component. Format is DD. -SET(KWSYS_DATE_STAMP_DAY 11) +SET(KWSYS_DATE_STAMP_DAY 12) -- cgit v0.12 From 69677ca4714de3dd349f3356e63ee33942f93d7e Mon Sep 17 00:00:00 2001 From: KWSys Robot Date: Fri, 13 May 2011 00:01:05 -0400 Subject: KWSys Nightly Date Stamp --- Source/kwsys/kwsysDateStamp.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/kwsys/kwsysDateStamp.cmake b/Source/kwsys/kwsysDateStamp.cmake index e9097a1..0e01607 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 05) # KWSys version date day component. Format is DD. -SET(KWSYS_DATE_STAMP_DAY 12) +SET(KWSYS_DATE_STAMP_DAY 13) -- cgit v0.12 From 30bf6162bec787dbe6a07f18e2d56d9c6ef2a05f Mon Sep 17 00:00:00 2001 From: KWSys Robot Date: Sat, 14 May 2011 00:01:04 -0400 Subject: KWSys Nightly Date Stamp --- Source/kwsys/kwsysDateStamp.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/kwsys/kwsysDateStamp.cmake b/Source/kwsys/kwsysDateStamp.cmake index 0e01607..5d0596c 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 05) # KWSys version date day component. Format is DD. -SET(KWSYS_DATE_STAMP_DAY 13) +SET(KWSYS_DATE_STAMP_DAY 14) -- cgit v0.12 From 41ce1ea2d43d87bb6102f7f116ae276b828777bf Mon Sep 17 00:00:00 2001 From: KWSys Robot Date: Sun, 15 May 2011 00:01:06 -0400 Subject: KWSys Nightly Date Stamp --- Source/kwsys/kwsysDateStamp.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/kwsys/kwsysDateStamp.cmake b/Source/kwsys/kwsysDateStamp.cmake index 5d0596c..4376a49 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 05) # KWSys version date day component. Format is DD. -SET(KWSYS_DATE_STAMP_DAY 14) +SET(KWSYS_DATE_STAMP_DAY 15) -- cgit v0.12 From a77dfb6d64b24737167e4a0312fb842544f27961 Mon Sep 17 00:00:00 2001 From: KWSys Robot Date: Mon, 16 May 2011 00:01:03 -0400 Subject: KWSys Nightly Date Stamp --- Source/kwsys/kwsysDateStamp.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/kwsys/kwsysDateStamp.cmake b/Source/kwsys/kwsysDateStamp.cmake index 4376a49..0d880d5 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 05) # KWSys version date day component. Format is DD. -SET(KWSYS_DATE_STAMP_DAY 15) +SET(KWSYS_DATE_STAMP_DAY 16) -- cgit v0.12 From 3a8add058b09bc88fabb0ebe5bf59da95d7ebff2 Mon Sep 17 00:00:00 2001 From: Brad King Date: Mon, 16 May 2011 10:13:04 -0400 Subject: ENH: Fix Intel 12 plugin project generation for VS < 10 Suggested-by: Dick Munroe --- Source/cmLocalVisualStudio7Generator.cxx | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/Source/cmLocalVisualStudio7Generator.cxx b/Source/cmLocalVisualStudio7Generator.cxx index b9ffe62..7a62b9c 100644 --- a/Source/cmLocalVisualStudio7Generator.cxx +++ b/Source/cmLocalVisualStudio7Generator.cxx @@ -1770,10 +1770,14 @@ cmLocalVisualStudio7Generator vskey += "\\Packages\\" CM_INTEL_PLUGIN_GUID ";ProductVersion"; cmSystemTools::ReadRegistryValue(vskey.c_str(), intelVersion, cmSystemTools::KeyWOW64_32); - - // Version 10.1 actually uses 9.10 in project files! - if(intelVersion == "10.1") + if (intelVersion == "12.0") + { + // Version 12 actually uses 11.0 in project files! + intelVersion = "11.0" ; + } + else if(intelVersion == "10.1") { + // Version 10.1 actually uses 9.10 in project files! intelVersion = "9.10"; } -- cgit v0.12 From 8346a28a0a6587382a30d06a998ae83caa574f4b Mon Sep 17 00:00:00 2001 From: Manuel Klimek Date: Mon, 25 Apr 2011 10:16:01 -0700 Subject: Only offer the compile command output feature on unix systems --- Modules/CMakeGenericSystem.cmake | 9 ++++++--- Tests/CMakeLib/CMakeLists.txt | 6 ++++-- Tests/CMakeLists.txt | 10 ++++++++-- 3 files changed, 18 insertions(+), 7 deletions(-) diff --git a/Modules/CMakeGenericSystem.cmake b/Modules/CMakeGenericSystem.cmake index e64d0ba..6615849 100644 --- a/Modules/CMakeGenericSystem.cmake +++ b/Modules/CMakeGenericSystem.cmake @@ -50,9 +50,12 @@ IF(CMAKE_GENERATOR MATCHES "Makefiles") IF(DEFINED CMAKE_RULE_MESSAGES) SET_PROPERTY(GLOBAL PROPERTY RULE_MESSAGES ${CMAKE_RULE_MESSAGES}) ENDIF(DEFINED CMAKE_RULE_MESSAGES) - SET(CMAKE_EXPORT_COMPILE_COMMANDS OFF CACHE BOOL - "Enable/Disable output of compile commands during generation." - ) + IF(CMAKE_GENERATOR MATCHES "Unix Makefiles") + SET(CMAKE_EXPORT_COMPILE_COMMANDS OFF CACHE BOOL + "Enable/Disable output of compile commands during generation." + ) + MARK_AS_ADVANCED(CMAKE_EXPORT_COMPILE_COMMANDS) + ENDIF(CMAKE_GENERATOR MATCHES "Unix Makefiles") ENDIF(CMAKE_GENERATOR MATCHES "Makefiles") diff --git a/Tests/CMakeLib/CMakeLists.txt b/Tests/CMakeLib/CMakeLists.txt index 7815545..41bf034 100644 --- a/Tests/CMakeLib/CMakeLists.txt +++ b/Tests/CMakeLib/CMakeLists.txt @@ -31,5 +31,7 @@ foreach(test ${CMakeLib_TESTS}) add_test(CMakeLib.${test} CMakeLibTests ${test}) endforeach() -ADD_EXECUTABLE(runcompilecommands run_compile_commands.cxx) -TARGET_LINK_LIBRARIES(runcompilecommands CMakeLib) +if(TEST_CompileCommandOutput) + add_executable(runcompilecommands run_compile_commands.cxx) + target_link_libraries(runcompilecommands CMakeLib) +endif() diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt index 126eadd..2344af7 100644 --- a/Tests/CMakeLists.txt +++ b/Tests/CMakeLists.txt @@ -39,6 +39,10 @@ CONFIGURE_FILE(${CMake_SOURCE_DIR}/Tests/EnforceConfig.cmake.in # Testing IF(BUILD_TESTING) + IF("${CMAKE_TEST_GENERATOR}" MATCHES "Unix Makefiles") + SET(TEST_CompileCommandOutput 1) + ENDIF() + ADD_SUBDIRECTORY(CMakeLib) # Collect a list of all test build directories. @@ -2032,8 +2036,10 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ SET_TESTS_PROPERTIES(Contracts.${project} PROPERTIES TIMEOUT ${timeout}) ENDFOREACH() - ADD_TEST_MACRO(CompileCommandOutput - "${CMake_BINARY_DIR}/Tests/CMakeLib/runcompilecommands") + IF(TEST_CompileCommandOutput) + ADD_TEST_MACRO(CompileCommandOutput + "${CMake_BINARY_DIR}/Tests/CMakeLib/runcompilecommands") + ENDIF() ENDIF(BUILD_TESTING) SUBDIRS(CMakeTests) -- cgit v0.12 From 051cee0096df31d8808549f6200745180f3cc191 Mon Sep 17 00:00:00 2001 From: Brad King Date: Mon, 16 May 2011 11:18:39 -0400 Subject: Revert "Honor RULE_MESSAGES property for build target messages" (#12190) This reverts commit dc36b3499403bad323d7300139fbf459c31f7a2c. It broke dependency logic instead of only silencing messages. Revert to previous behavior. --- Source/cmGlobalUnixMakefileGenerator3.cxx | 164 +++++++++++++----------------- Source/cmGlobalUnixMakefileGenerator3.h | 1 - 2 files changed, 73 insertions(+), 92 deletions(-) diff --git a/Source/cmGlobalUnixMakefileGenerator3.cxx b/Source/cmGlobalUnixMakefileGenerator3.cxx index 08eb391..5a3eb02 100644 --- a/Source/cmGlobalUnixMakefileGenerator3.cxx +++ b/Source/cmGlobalUnixMakefileGenerator3.cxx @@ -25,7 +25,6 @@ cmGlobalUnixMakefileGenerator3::cmGlobalUnixMakefileGenerator3() this->FindMakeProgramFile = "CMakeUnixFindMake.cmake"; this->ToolSupportsColor = true; this->ForceVerboseMakefiles = false; - this->NoRuleMessages = false; #if defined(_WIN32) || defined(__VMS) this->UseLinkScript = false; @@ -145,46 +144,37 @@ void cmGlobalUnixMakefileGenerator3::Generate() // first do superclass method this->cmGlobalGenerator::Generate(); - cmake* cm = this->GetCMakeInstance(); - if(const char* ruleStatus = cm->GetProperty("RULE_MESSAGES")) + // initialize progress + unsigned long total = 0; + for(ProgressMapType::const_iterator pmi = this->ProgressMap.begin(); + pmi != this->ProgressMap.end(); ++pmi) { - this->NoRuleMessages = cmSystemTools::IsOff(ruleStatus); + total += pmi->second.NumberOfActions; } - if(!this->NoRuleMessages) + // write each target's progress.make this loop is done twice. Bascially the + // Generate pass counts all the actions, the first loop below determines + // how many actions have progress updates for each target and writes to + // corrrect variable values for everything except the all targets. The + // second loop actually writes out correct values for the all targets as + // well. This is because the all targets require more information that is + // computed in the first loop. + unsigned long current = 0; + for(ProgressMapType::iterator pmi = this->ProgressMap.begin(); + pmi != this->ProgressMap.end(); ++pmi) { - // initialize progress - unsigned long total = 0; - for(ProgressMapType::const_iterator pmi = this->ProgressMap.begin(); - pmi != this->ProgressMap.end(); ++pmi) - { - total += pmi->second.NumberOfActions; - } - - // write each target's progress.make this loop is done twice. Bascially the - // Generate pass counts all the actions, the first loop below determines - // how many actions have progress updates for each target and writes to - // corrrect variable values for everything except the all targets. The - // second loop actually writes out correct values for the all targets as - // well. This is because the all targets require more information that is - // computed in the first loop. - unsigned long current = 0; - for(ProgressMapType::iterator pmi = this->ProgressMap.begin(); - pmi != this->ProgressMap.end(); ++pmi) - { - pmi->second.WriteProgressVariables(total, current); - } - for(unsigned int i = 0; i < this->LocalGenerators.size(); ++i) - { - cmLocalUnixMakefileGenerator3 *lg = - static_cast(this->LocalGenerators[i]); - std::string markFileName = lg->GetMakefile()->GetStartOutputDirectory(); - markFileName += "/"; - markFileName += cmake::GetCMakeFilesDirectory(); - markFileName += "/progress.marks"; - cmGeneratedFileStream markFile(markFileName.c_str()); - markFile << this->CountProgressMarksInAll(lg) << "\n"; - } + pmi->second.WriteProgressVariables(total, current); + } + for(unsigned int i = 0; i < this->LocalGenerators.size(); ++i) + { + cmLocalUnixMakefileGenerator3 *lg = + static_cast(this->LocalGenerators[i]); + std::string markFileName = lg->GetMakefile()->GetStartOutputDirectory(); + markFileName += "/"; + markFileName += cmake::GetCMakeFilesDirectory(); + markFileName += "/progress.marks"; + cmGeneratedFileStream markFile(markFileName.c_str()); + markFile << this->CountProgressMarksInAll(lg) << "\n"; } // write the main makefile @@ -748,34 +738,30 @@ cmGlobalUnixMakefileGenerator3 // Write the rule. localName += "/all"; depends.clear(); - std::string progressDir; - if(!this->NoRuleMessages) + std::string progressDir = + lg->GetMakefile()->GetHomeOutputDirectory(); + progressDir += cmake::GetCMakeFilesDirectory(); { - progressDir = - lg->GetMakefile()->GetHomeOutputDirectory(); - progressDir += cmake::GetCMakeFilesDirectory(); + cmOStringStream progCmd; + progCmd << "$(CMAKE_COMMAND) -E cmake_progress_report "; + // all target counts + progCmd << lg->Convert(progressDir.c_str(), + cmLocalGenerator::FULL, + cmLocalGenerator::SHELL); + progCmd << " "; + std::vector& progFiles = + this->ProgressMap[&t->second].Marks; + for (std::vector::iterator i = progFiles.begin(); + i != progFiles.end(); ++i) { - cmOStringStream progCmd; - progCmd << "$(CMAKE_COMMAND) -E cmake_progress_report "; - // all target counts - progCmd << lg->Convert(progressDir.c_str(), - cmLocalGenerator::FULL, - cmLocalGenerator::SHELL); - progCmd << " "; - std::vector& progFiles = - this->ProgressMap[&t->second].Marks; - for (std::vector::iterator i = progFiles.begin(); - i != progFiles.end(); ++i) - { - progCmd << " " << *i; - } - commands.push_back(progCmd.str()); + progCmd << " " << *i; } - progressDir = "Built target "; - progressDir += t->first; - lg->AppendEcho(commands,progressDir.c_str()); + commands.push_back(progCmd.str()); } + progressDir = "Built target "; + progressDir += t->first; + lg->AppendEcho(commands,progressDir.c_str()); this->AppendGlobalTargetDepends(depends,t->second); lg->WriteMakeRule(ruleFileStream, "All Build rule for target.", @@ -791,42 +777,38 @@ cmGlobalUnixMakefileGenerator3 "all", depends, commands, true); } - if(!this->NoRuleMessages) - { - // Write the rule. - commands.clear(); - progressDir = lg->GetMakefile()->GetHomeOutputDirectory(); - progressDir += cmake::GetCMakeFilesDirectory(); + // Write the rule. + commands.clear(); + progressDir = lg->GetMakefile()->GetHomeOutputDirectory(); + progressDir += cmake::GetCMakeFilesDirectory(); - { - // TODO: Convert the total progress count to a make variable. - cmOStringStream progCmd; - progCmd << "$(CMAKE_COMMAND) -E cmake_progress_start "; - // # in target - progCmd << lg->Convert(progressDir.c_str(), - cmLocalGenerator::FULL, - cmLocalGenerator::SHELL); - // - std::set emitted; - progCmd << " " - << this->CountProgressMarksInTarget(&t->second, emitted); - commands.push_back(progCmd.str()); - } - } + { + // TODO: Convert the total progress count to a make variable. + cmOStringStream progCmd; + progCmd << "$(CMAKE_COMMAND) -E cmake_progress_start "; + // # in target + progCmd << lg->Convert(progressDir.c_str(), + cmLocalGenerator::FULL, + cmLocalGenerator::SHELL); + // + std::set emitted; + progCmd << " " + << this->CountProgressMarksInTarget(&t->second, emitted); + commands.push_back(progCmd.str()); + } std::string tmp = cmake::GetCMakeFilesDirectoryPostSlash(); tmp += "Makefile2"; commands.push_back(lg->GetRecursiveMakeCall (tmp.c_str(),localName.c_str())); - if(!this->NoRuleMessages) - { - cmOStringStream progCmd; - progCmd << "$(CMAKE_COMMAND) -E cmake_progress_start "; // # 0 - progCmd << lg->Convert(progressDir.c_str(), - cmLocalGenerator::FULL, - cmLocalGenerator::SHELL); - progCmd << " 0"; - commands.push_back(progCmd.str()); - } + { + cmOStringStream progCmd; + progCmd << "$(CMAKE_COMMAND) -E cmake_progress_start "; // # 0 + progCmd << lg->Convert(progressDir.c_str(), + cmLocalGenerator::FULL, + cmLocalGenerator::SHELL); + progCmd << " 0"; + commands.push_back(progCmd.str()); + } depends.clear(); depends.push_back("cmake_check_build_system"); localName = lg->GetRelativeTargetDirectory(t->second); diff --git a/Source/cmGlobalUnixMakefileGenerator3.h b/Source/cmGlobalUnixMakefileGenerator3.h index 01f5fac..f499536 100644 --- a/Source/cmGlobalUnixMakefileGenerator3.h +++ b/Source/cmGlobalUnixMakefileGenerator3.h @@ -170,7 +170,6 @@ protected: std::string EmptyRuleHackCommand; bool ForceVerboseMakefiles; - bool NoRuleMessages; // Store per-target progress counters. struct TargetProgress -- cgit v0.12 From c9174c0e4b3605895ff15a2c4102dfdfec011c8c Mon Sep 17 00:00:00 2001 From: Brad King Date: Mon, 16 May 2011 11:55:56 -0400 Subject: Fix signed/unsigned comparison in EscapeJSON --- Source/cmGlobalUnixMakefileGenerator3.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/cmGlobalUnixMakefileGenerator3.cxx b/Source/cmGlobalUnixMakefileGenerator3.cxx index 54f2b03..c6dbdb1 100644 --- a/Source/cmGlobalUnixMakefileGenerator3.cxx +++ b/Source/cmGlobalUnixMakefileGenerator3.cxx @@ -142,7 +142,7 @@ void cmGlobalUnixMakefileGenerator3 //---------------------------------------------------------------------------- std::string EscapeJSON(const std::string& s) { std::string result; - for (int i = 0; i < s.size(); ++i) { + for (std::string::size_type i = 0; i < s.size(); ++i) { if (s[i] == '"' || s[i] == '\\') { result += '\\'; } -- cgit v0.12 From a7e7a04aafdcb91e13180f421df550418041d9bf Mon Sep 17 00:00:00 2001 From: Brad King Date: Mon, 16 May 2011 12:05:49 -0400 Subject: Fix run_compile_commands build on Apple GCC 3.3 This compiler does not provide the "at" method of std::map. Approximate it well enough for our needs. --- Tests/CMakeLib/run_compile_commands.cxx | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/Tests/CMakeLib/run_compile_commands.cxx b/Tests/CMakeLib/run_compile_commands.cxx index c925167..31049d3 100644 --- a/Tests/CMakeLib/run_compile_commands.cxx +++ b/Tests/CMakeLib/run_compile_commands.cxx @@ -2,7 +2,19 @@ class CompileCommandParser { public: - typedef std::map CommandType; + class CommandType: public std::map + { + public: +#if defined(__GNUC__) && __GNUC__ == 3 && __GNUC_MINOR__ < 4 + cmStdString const& at(cmStdString const& k) const + { + const_iterator i = this->find(k); + if(i != this->end()) { return i->second; } + static cmStdString empty; + return empty; + } +#endif + }; typedef std::vector TranslationUnitsType; CompileCommandParser(std::ifstream *input) -- cgit v0.12 From 0fb388c733e163e9e271f3f8f8abd386e0d63db1 Mon Sep 17 00:00:00 2001 From: Wesley Turner Date: Mon, 16 May 2011 18:15:32 -0400 Subject: Ensure executable files have executable permissions. Fix the OSX X11 CPack generator to make sure the installer that it generates contains executable files. --- Source/CPack/cmCPackOSXX11Generator.cxx | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/Source/CPack/cmCPackOSXX11Generator.cxx b/Source/CPack/cmCPackOSXX11Generator.cxx index 0e8cbc0..75ad640 100644 --- a/Source/CPack/cmCPackOSXX11Generator.cxx +++ b/Source/CPack/cmCPackOSXX11Generator.cxx @@ -21,6 +21,7 @@ #include #include +#include //---------------------------------------------------------------------- cmCPackOSXX11Generator::cmCPackOSXX11Generator() @@ -135,6 +136,32 @@ int cmCPackOSXX11Generator::PackageFiles() return 0; } + // Two of the files need to have execute permission, so ensure they do: + std::string runTimeScript = dir; + runTimeScript += "/"; + runTimeScript += "RuntimeScript"; + + std::string appScriptName = appdir; + appScriptName += "/"; + appScriptName += this->GetOption("CPACK_PACKAGE_FILE_NAME"); + + mode_t mode; + if (cmsys::SystemTools::GetPermissions(runTimeScript.c_str(), mode)) + { + mode |= (S_IXUSR | S_IXGRP | S_IXOTH); + cmsys::SystemTools::SetPermissions(runTimeScript.c_str(), mode); + cmCPackLogger(cmCPackLog::LOG_OUTPUT, "Setting: " << runTimeScript + << " to permission: " << mode << std::endl); + } + + if (cmsys::SystemTools::GetPermissions(appScriptName.c_str(), mode)) + { + mode |= (S_IXUSR | S_IXGRP | S_IXOTH); + cmsys::SystemTools::SetPermissions(appScriptName.c_str(), mode); + cmCPackLogger(cmCPackLog::LOG_OUTPUT, "Setting: " << appScriptName + << " to permission: " << mode << std::endl); + } + std::string output; std::string tmpFile = this->GetOption("CPACK_TOPLEVEL_DIRECTORY"); tmpFile += "/hdiutilOutput.log"; -- cgit v0.12 From dc2a45fa3ff3e9547e6372174bff6b2197f9d64f Mon Sep 17 00:00:00 2001 From: KWSys Robot Date: Tue, 17 May 2011 00:01:14 -0400 Subject: KWSys Nightly Date Stamp --- Source/kwsys/kwsysDateStamp.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/kwsys/kwsysDateStamp.cmake b/Source/kwsys/kwsysDateStamp.cmake index 0d880d5..5636816 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 05) # KWSys version date day component. Format is DD. -SET(KWSYS_DATE_STAMP_DAY 16) +SET(KWSYS_DATE_STAMP_DAY 17) -- cgit v0.12 From 4e2185cbd0d37dd642eefdc3365e8985d8f688c0 Mon Sep 17 00:00:00 2001 From: Brad King Date: Tue, 17 May 2011 08:50:55 -0400 Subject: Make std::map usage more portable in language=>flags/defines maps Older versions of GCC, the HP compiler, and the SGI MIPSpro compiler do not like the use of make_pair in this case and the conversions it requires: a value of type "const char *" cannot be used to initialize an entity of type "char [1]" /usr/include/g++-3/stl_pair.h:68: assignment of read-only location Instead use a map lookup pattern already used throughout the rest of our source tree. --- Source/cmMakefileTargetGenerator.cxx | 36 ++++++++++++++++++++++-------------- Source/cmMakefileTargetGenerator.h | 5 +++-- 2 files changed, 25 insertions(+), 16 deletions(-) diff --git a/Source/cmMakefileTargetGenerator.cxx b/Source/cmMakefileTargetGenerator.cxx index 6d3fbe0..d0df8f0 100644 --- a/Source/cmMakefileTargetGenerator.cxx +++ b/Source/cmMakefileTargetGenerator.cxx @@ -249,11 +249,12 @@ void cmMakefileTargetGenerator::WriteCommonCodeRules() } //---------------------------------------------------------------------------- -std::string cmMakefileTargetGenerator::GetFlags(const std::string &l) { - std::pair::iterator, bool> - insert_result = this->FlagsByLanguage.insert(std::make_pair(l, "")); - if (insert_result.second) { - std::string& flags = insert_result.first->second; +std::string cmMakefileTargetGenerator::GetFlags(const std::string &l) +{ + ByLanguageMap::iterator i = this->FlagsByLanguage.find(l); + if (i == this->FlagsByLanguage.end()) + { + std::string flags; const char *lang = l.c_str(); bool shared = ((this->Target->GetType() == cmTarget::SHARED_LIBRARY) || @@ -284,15 +285,19 @@ std::string cmMakefileTargetGenerator::GetFlags(const std::string &l) { // Add include directory flags. this->LocalGenerator-> AppendFlags(flags,this->GetFrameworkFlags().c_str()); - } - return insert_result.first->second; + + ByLanguageMap::value_type entry(l, flags); + i = this->FlagsByLanguage.insert(entry).first; + } + return i->second; } -std::string cmMakefileTargetGenerator::GetDefines(const std::string &l) { - std::pair::iterator, bool> - insert_result = this->DefinesByLanguage.insert(std::make_pair(l, "")); - if (insert_result.second) { - std::string &defines = insert_result.first->second; +std::string cmMakefileTargetGenerator::GetDefines(const std::string &l) +{ + ByLanguageMap::iterator i = this->DefinesByLanguage.find(l); + if (i == this->DefinesByLanguage.end()) + { + std::string defines; const char *lang = l.c_str(); // Add the export symbol definition for shared library objects. if(const char* exportMacro = this->Target->GetExportMacro()) @@ -312,8 +317,11 @@ std::string cmMakefileTargetGenerator::GetDefines(const std::string &l) { (defines, this->Makefile->GetProperty(defPropName.c_str()), lang); this->LocalGenerator->AppendDefines (defines, this->Target->GetProperty(defPropName.c_str()), lang); - } - return insert_result.first->second; + + ByLanguageMap::value_type entry(l, defines); + i = this->DefinesByLanguage.insert(entry).first; + } + return i->second; } void cmMakefileTargetGenerator::WriteTargetLanguageFlags() diff --git a/Source/cmMakefileTargetGenerator.h b/Source/cmMakefileTargetGenerator.h index db87ebc..b68f8bf 100644 --- a/Source/cmMakefileTargetGenerator.h +++ b/Source/cmMakefileTargetGenerator.h @@ -216,10 +216,11 @@ protected: std::string MacContentDirectory; std::set MacContentFolders; + typedef std::map ByLanguageMap; std::string GetFlags(const std::string &l); - std::map FlagsByLanguage; + ByLanguageMap FlagsByLanguage; std::string GetDefines(const std::string &l); - std::map DefinesByLanguage; + ByLanguageMap DefinesByLanguage; // Target-wide Fortran module output directory. bool FortranModuleDirectoryComputed; -- cgit v0.12 From 169bb05f90258447a0b93379364374eb03e45bf7 Mon Sep 17 00:00:00 2001 From: Brad King Date: Tue, 17 May 2011 08:56:08 -0400 Subject: Provide std::map<>::at for use in run_compile_commands Many compilers we support do not provide the at() member of std::map. Use the workaround added by commit a7e7a04a (Fix run_compile_commands build on Apple GCC 3.3, 2011-05-16) for all compilers. --- Tests/CMakeLib/run_compile_commands.cxx | 2 -- 1 file changed, 2 deletions(-) diff --git a/Tests/CMakeLib/run_compile_commands.cxx b/Tests/CMakeLib/run_compile_commands.cxx index 31049d3..d7422a8 100644 --- a/Tests/CMakeLib/run_compile_commands.cxx +++ b/Tests/CMakeLib/run_compile_commands.cxx @@ -5,7 +5,6 @@ public: class CommandType: public std::map { public: -#if defined(__GNUC__) && __GNUC__ == 3 && __GNUC_MINOR__ < 4 cmStdString const& at(cmStdString const& k) const { const_iterator i = this->find(k); @@ -13,7 +12,6 @@ public: static cmStdString empty; return empty; } -#endif }; typedef std::vector TranslationUnitsType; -- cgit v0.12 From 7c5be5114c1c1adb26cfe7e8556187bf9bd8bd0a Mon Sep 17 00:00:00 2001 From: Brad King Date: Tue, 17 May 2011 09:25:44 -0400 Subject: run_compile_commands: Avoid shadow in std::map<>::at workaround The map has a member called "empty" so use a different name for the local variable in our approximate at() method. --- Tests/CMakeLib/run_compile_commands.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Tests/CMakeLib/run_compile_commands.cxx b/Tests/CMakeLib/run_compile_commands.cxx index d7422a8..cfb7ece 100644 --- a/Tests/CMakeLib/run_compile_commands.cxx +++ b/Tests/CMakeLib/run_compile_commands.cxx @@ -9,8 +9,8 @@ public: { const_iterator i = this->find(k); if(i != this->end()) { return i->second; } - static cmStdString empty; - return empty; + static cmStdString emptyString; + return emptyString; } }; typedef std::vector TranslationUnitsType; -- cgit v0.12 From e1b0a11dd471e1593ade56897185a9d4dd2e0857 Mon Sep 17 00:00:00 2001 From: Brad King Date: Tue, 17 May 2011 10:07:26 -0400 Subject: Improve string(RANDOM) default seed The naive time(0) seed is unique only within one second. Instead try to read a real source of entropy and otherwise fall back to a combination of the process id and high-resolution time. --- Source/cmStringCommand.cxx | 4 +-- Source/cmSystemTools.cxx | 64 ++++++++++++++++++++++++++++++++++++++++++++++ Source/cmSystemTools.h | 3 +++ 3 files changed, 69 insertions(+), 2 deletions(-) diff --git a/Source/cmStringCommand.cxx b/Source/cmStringCommand.cxx index 19d2369..e3bf08f 100644 --- a/Source/cmStringCommand.cxx +++ b/Source/cmStringCommand.cxx @@ -770,7 +770,7 @@ bool cmStringCommand static bool seeded = false; bool force_seed = false; - int seed = (int) time(NULL); + int seed = 0; int length = 5; const char cmStringCommandDefaultAlphabet[] = "qwertyuiopasdfghjklzxcvbnm" "QWERTYUIOPASDFGHJKLZXCVBNM" @@ -825,7 +825,7 @@ bool cmStringCommand if (!seeded || force_seed) { seeded = true; - srand(seed); + srand(force_seed? seed : cmSystemTools::RandomSeed()); } const char* alphaPtr = alphabet.c_str(); diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx index 7bc89a4..4167355 100644 --- a/Source/cmSystemTools.cxx +++ b/Source/cmSystemTools.cxx @@ -31,7 +31,9 @@ #if defined(_WIN32) # include +# include #else +# include # include # include # include @@ -2233,6 +2235,68 @@ bool cmSystemTools::FileTimeSet(const char* fname, cmSystemToolsFileTime* t) } //---------------------------------------------------------------------------- +#ifdef _WIN32 +static int WinCryptRandom(void* data, size_t size) +{ + int result = 0; + HCRYPTPROV hProvider = 0; + if(CryptAcquireContextW(&hProvider, 0, 0, PROV_RSA_FULL, + CRYPT_VERIFYCONTEXT | CRYPT_SILENT)) + { + result = CryptGenRandom(hProvider, (DWORD)size, (BYTE*)data)? 1:0; + CryptReleaseContext(hProvider, 0); + } + return result; +} +#endif + +//---------------------------------------------------------------------------- +unsigned int cmSystemTools::RandomSeed() +{ +#if defined(_WIN32) && !defined(__CYGWIN__) + unsigned int seed = 0; + + // Try using a real random source. + if(WinCryptRandom(&seed, sizeof(seed))) + { + return seed; + } + + // Fall back to the time and pid. + FILETIME ft; + GetSystemTimeAsFileTime(&ft); + unsigned int t1 = static_cast(ft.dwHighDateTime); + unsigned int t2 = static_cast(ft.dwLowDateTime); + unsigned int pid = static_cast(GetCurrentProcessId()); + return t1 ^ t2 ^ pid; +#else + union + { + unsigned int integer; + char bytes[sizeof(unsigned int)]; + } seed; + + // Try using a real random source. + std::ifstream fin("/dev/urandom"); + if(fin && fin.read(seed.bytes, sizeof(seed)) && + fin.gcount() == sizeof(seed)) + { + return seed.integer; + } + + // Fall back to the time and pid. + struct timeval t; + gettimeofday(&t, 0); + unsigned int pid = static_cast(getpid()); + unsigned int tv_sec = t.tv_sec; + unsigned int tv_usec = t.tv_usec; + // Since tv_usec never fills more than 11 bits we shift it to fill + // in the slow-changing high-order bits of tv_sec. + return tv_sec ^ (tv_usec << 21) ^ pid; +#endif +} + +//---------------------------------------------------------------------------- static std::string cmSystemToolsExecutableDirectory; void cmSystemTools::FindExecutableDirectory(const char* argv0) { diff --git a/Source/cmSystemTools.h b/Source/cmSystemTools.h index 6f9147c..78b9abf 100644 --- a/Source/cmSystemTools.h +++ b/Source/cmSystemTools.h @@ -402,6 +402,9 @@ public: static bool FileTimeGet(const char* fname, cmSystemToolsFileTime* t); static bool FileTimeSet(const char* fname, cmSystemToolsFileTime* t); + /** Random seed generation. */ + static unsigned int RandomSeed(); + /** Find the directory containing the running executable. Save it in a global location to be queried by GetExecutableDirectory later. */ -- cgit v0.12 From c7d4cf1db11551344fedc717406b980862756a5d Mon Sep 17 00:00:00 2001 From: KWSys Robot Date: Wed, 18 May 2011 00:01:04 -0400 Subject: KWSys Nightly Date Stamp --- Source/kwsys/kwsysDateStamp.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/kwsys/kwsysDateStamp.cmake b/Source/kwsys/kwsysDateStamp.cmake index 5636816..c7237e8 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 05) # KWSys version date day component. Format is DD. -SET(KWSYS_DATE_STAMP_DAY 17) +SET(KWSYS_DATE_STAMP_DAY 18) -- cgit v0.12 From c45c60b24ff52d9435ceab0de027fbadac130a1f Mon Sep 17 00:00:00 2001 From: Brad King Date: Wed, 18 May 2011 09:44:28 -0400 Subject: run_compile_commands: Avoid extra stl vector conversion The Sun compiler does not provide the proper vector constructor to initialize it from an iterator pair of a non-matching type. Extend the ParseUnixCommandLine API to provide a vector of the proper type so no conversion is needed. --- Source/cmSystemTools.cxx | 16 ++++++++++++++++ Source/cmSystemTools.h | 2 ++ Tests/CMakeLib/run_compile_commands.cxx | 5 ++--- 3 files changed, 20 insertions(+), 3 deletions(-) diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx index 7bc89a4..df6469f 100644 --- a/Source/cmSystemTools.cxx +++ b/Source/cmSystemTools.cxx @@ -440,6 +440,13 @@ public: args.push_back(*arg); } } + void Store(std::vector& args) const + { + for(char** arg = this->ArgV; arg && *arg; ++arg) + { + args.push_back(*arg); + } + } }; //---------------------------------------------------------------------------- @@ -451,6 +458,15 @@ void cmSystemTools::ParseUnixCommandLine(const char* command, argv.Store(args); } +//---------------------------------------------------------------------------- +void cmSystemTools::ParseUnixCommandLine(const char* command, + std::vector& args) +{ + // Invoke the underlying parser. + cmSystemToolsArgV argv = cmsysSystem_Parse_CommandForUnix(command, 0); + argv.Store(args); +} + std::string cmSystemTools::EscapeWindowsShellArgument(const char* arg, int shell_flags) { diff --git a/Source/cmSystemTools.h b/Source/cmSystemTools.h index 6f9147c..dfc6b7d 100644 --- a/Source/cmSystemTools.h +++ b/Source/cmSystemTools.h @@ -237,6 +237,8 @@ public: /** Parse arguments out of a unix command line string. */ static void ParseUnixCommandLine(const char* command, std::vector& args); + static void ParseUnixCommandLine(const char* command, + std::vector& args); /** Compute an escaped version of the given argument for use in a windows shell. See kwsys/System.h.in for details. */ diff --git a/Tests/CMakeLib/run_compile_commands.cxx b/Tests/CMakeLib/run_compile_commands.cxx index cfb7ece..a0be2eb 100644 --- a/Tests/CMakeLib/run_compile_commands.cxx +++ b/Tests/CMakeLib/run_compile_commands.cxx @@ -127,9 +127,8 @@ int main () it = parser.GetTranslationUnits().begin(), end = parser.GetTranslationUnits().end(); it != end; ++it) { - std::vector std_command; - cmSystemTools::ParseUnixCommandLine(it->at("command").c_str(), std_command); - std::vector command(std_command.begin(), std_command.end()); + std::vector command; + cmSystemTools::ParseUnixCommandLine(it->at("command").c_str(), command); if (!cmSystemTools::RunSingleCommand( command, 0, 0, it->at("directory").c_str())) { -- cgit v0.12 From eb6f461fc1a383c19cc1be62663f682d1ac108ff Mon Sep 17 00:00:00 2001 From: Brad King Date: Wed, 18 May 2011 10:09:23 -0400 Subject: VS 6: Define _WIN32_WINNT to load wincrypt.h correctly --- Source/cmSystemTools.cxx | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx index 4167355..1491a99 100644 --- a/Source/cmSystemTools.cxx +++ b/Source/cmSystemTools.cxx @@ -9,6 +9,9 @@ implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the License for more information. ============================================================================*/ +#if defined(_MSC_VER) && _MSC_VER < 1300 +# define _WIN32_WINNT 0x0400 /* for wincrypt.h */ +#endif #include "cmSystemTools.h" #include #include @@ -2236,6 +2239,9 @@ bool cmSystemTools::FileTimeSet(const char* fname, cmSystemToolsFileTime* t) //---------------------------------------------------------------------------- #ifdef _WIN32 +# ifndef CRYPT_SILENT +# define CRYPT_SILENT 0x40 /* Not defined by VS 6 version of header. */ +# endif static int WinCryptRandom(void* data, size_t size) { int result = 0; -- cgit v0.12 From 14abf9f3d8d42701ad2aa43c2835f092b87b7042 Mon Sep 17 00:00:00 2001 From: KWSys Robot Date: Thu, 19 May 2011 00:01:04 -0400 Subject: KWSys Nightly Date Stamp --- Source/kwsys/kwsysDateStamp.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/kwsys/kwsysDateStamp.cmake b/Source/kwsys/kwsysDateStamp.cmake index c7237e8..b0c1806 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 05) # KWSys version date day component. Format is DD. -SET(KWSYS_DATE_STAMP_DAY 18) +SET(KWSYS_DATE_STAMP_DAY 19) -- cgit v0.12 From 4268e3d7e92eee0871dac1b92f64e18c374c7b43 Mon Sep 17 00:00:00 2001 From: Brad King Date: Thu, 19 May 2011 08:02:21 -0400 Subject: run_compile_commands: Cast istream::get() result to char We perform error checking on the stream after reading so this conversion is safe. --- Tests/CMakeLib/run_compile_commands.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tests/CMakeLib/run_compile_commands.cxx b/Tests/CMakeLib/run_compile_commands.cxx index a0be2eb..3f141c5 100644 --- a/Tests/CMakeLib/run_compile_commands.cxx +++ b/Tests/CMakeLib/run_compile_commands.cxx @@ -96,7 +96,7 @@ private: void Next() { - this->C = Input->get(); + this->C = char(Input->get()); if (this->Input->bad()) ErrorExit("Unexpected end of file."); } -- cgit v0.12 From 7039d1fd9b817a3ab6c81b4ef313a0bd6e19778d Mon Sep 17 00:00:00 2001 From: Brad King Date: Thu, 19 May 2011 08:11:34 -0400 Subject: Fix CompileCommandOutput test for Make tools not supporting spaces Use underscores instead of spaces for such Make tools. --- Tests/CMakeLists.txt | 3 +++ Tests/CompileCommandOutput/CMakeLists.txt | 7 ++++++- Tests/CompileCommandOutput/compile_command_output.cxx | 4 ++-- Tests/CompileCommandOutput/file with spaces.cxx | 4 +--- Tests/CompileCommandOutput/file with spaces.h | 1 - Tests/CompileCommandOutput/file_with_underscores.cxx | 3 +++ Tests/CompileCommandOutput/file_with_underscores.h | 1 + 7 files changed, 16 insertions(+), 7 deletions(-) delete mode 100644 Tests/CompileCommandOutput/file with spaces.h create mode 100644 Tests/CompileCommandOutput/file_with_underscores.cxx create mode 100644 Tests/CompileCommandOutput/file_with_underscores.h diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt index 2344af7..e9aed16 100644 --- a/Tests/CMakeLists.txt +++ b/Tests/CMakeLists.txt @@ -11,6 +11,7 @@ MACRO(ADD_TEST_MACRO NAME COMMAND) --build-generator ${CMAKE_TEST_GENERATOR} --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM} --build-project ${proj} + ${${NAME}_EXTRA_OPTIONS} --test-command ${COMMAND} ${ARGN}) LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/${dir}") ENDMACRO(ADD_TEST_MACRO) @@ -2037,6 +2038,8 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ ENDFOREACH() IF(TEST_CompileCommandOutput) + SET(CompileCommandOutput_EXTRA_OPTIONS + --build-options -DMAKE_SUPPORTS_SPACES=${MAKE_IS_GNU}) ADD_TEST_MACRO(CompileCommandOutput "${CMake_BINARY_DIR}/Tests/CMakeLib/runcompilecommands") ENDIF() diff --git a/Tests/CompileCommandOutput/CMakeLists.txt b/Tests/CompileCommandOutput/CMakeLists.txt index ac39b8b..bd8e305 100644 --- a/Tests/CompileCommandOutput/CMakeLists.txt +++ b/Tests/CompileCommandOutput/CMakeLists.txt @@ -4,7 +4,12 @@ project (CompileCommandOutput CXX) SET(CMAKE_EXPORT_COMPILE_COMMANDS ON) set(CMAKE_DEBUG_POSTFIX "_test_debug_postfix") -ADD_LIBRARY(test1 STATIC "file with spaces.cxx") +IF(MAKE_SUPPORTS_SPACES) + SET(test1_srcs "file with spaces.cxx") +ELSE() + SET(test1_srcs "file_with_underscores.cxx") +ENDIF() +ADD_LIBRARY(test1 STATIC ${test1_srcs}) ADD_LIBRARY(test2 SHARED "../CompileCommandOutput/relative.cxx") INCLUDE_DIRECTORIES(${CompileCommandOutput_SOURCE_DIR}/../../Source) ADD_EXECUTABLE(CompileCommandOutput compile_command_output.cxx) diff --git a/Tests/CompileCommandOutput/compile_command_output.cxx b/Tests/CompileCommandOutput/compile_command_output.cxx index 9487c89..145a064 100644 --- a/Tests/CompileCommandOutput/compile_command_output.cxx +++ b/Tests/CompileCommandOutput/compile_command_output.cxx @@ -1,9 +1,9 @@ -#include "file with spaces.h" +#include "file_with_underscores.h" #include "relative.h" int main (int argc, char** argv) { - file_with_spaces(); + file_with_underscores(); relative(); return 0; } diff --git a/Tests/CompileCommandOutput/file with spaces.cxx b/Tests/CompileCommandOutput/file with spaces.cxx index 5759319..554e176 100644 --- a/Tests/CompileCommandOutput/file with spaces.cxx +++ b/Tests/CompileCommandOutput/file with spaces.cxx @@ -1,3 +1 @@ -#include "file with spaces.h" - -void file_with_spaces() {} +#include "file_with_underscores.cxx" diff --git a/Tests/CompileCommandOutput/file with spaces.h b/Tests/CompileCommandOutput/file with spaces.h deleted file mode 100644 index 49b686c..0000000 --- a/Tests/CompileCommandOutput/file with spaces.h +++ /dev/null @@ -1 +0,0 @@ -void file_with_spaces(); diff --git a/Tests/CompileCommandOutput/file_with_underscores.cxx b/Tests/CompileCommandOutput/file_with_underscores.cxx new file mode 100644 index 0000000..4f42ccf --- /dev/null +++ b/Tests/CompileCommandOutput/file_with_underscores.cxx @@ -0,0 +1,3 @@ +#include "file_with_underscores.h" + +void file_with_underscores() {} diff --git a/Tests/CompileCommandOutput/file_with_underscores.h b/Tests/CompileCommandOutput/file_with_underscores.h new file mode 100644 index 0000000..0d73e31 --- /dev/null +++ b/Tests/CompileCommandOutput/file_with_underscores.h @@ -0,0 +1 @@ +void file_with_underscores(); -- cgit v0.12 From 3d92c8c82746636a85eca2f2d86f7714bde1465c Mon Sep 17 00:00:00 2001 From: Brad King Date: Thu, 19 May 2011 07:56:04 -0400 Subject: Explicitly cast time value in cmSystemTools::RandomSeed MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Use static_cast to avoid warnings like conversion to ‘unsigned int’ from ‘__time_t’ may alter its value conversion to ‘unsigned int’ from ‘__suseconds_t’ may alter its value We do not care if the value is truncated because we are looking for just 32 bits anyway. --- Source/cmSystemTools.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx index 1491a99..b992054 100644 --- a/Source/cmSystemTools.cxx +++ b/Source/cmSystemTools.cxx @@ -2294,8 +2294,8 @@ unsigned int cmSystemTools::RandomSeed() struct timeval t; gettimeofday(&t, 0); unsigned int pid = static_cast(getpid()); - unsigned int tv_sec = t.tv_sec; - unsigned int tv_usec = t.tv_usec; + unsigned int tv_sec = static_cast(t.tv_sec); + unsigned int tv_usec = static_cast(t.tv_usec); // Since tv_usec never fills more than 11 bits we shift it to fill // in the slow-changing high-order bits of tv_sec. return tv_sec ^ (tv_usec << 21) ^ pid; -- cgit v0.12 From c5aae0e625bec60e3a89129501cd8fca726d8dcf Mon Sep 17 00:00:00 2001 From: KWSys Robot Date: Fri, 20 May 2011 00:01:05 -0400 Subject: KWSys Nightly Date Stamp --- Source/kwsys/kwsysDateStamp.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/kwsys/kwsysDateStamp.cmake b/Source/kwsys/kwsysDateStamp.cmake index b0c1806..ad1a770 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 05) # KWSys version date day component. Format is DD. -SET(KWSYS_DATE_STAMP_DAY 19) +SET(KWSYS_DATE_STAMP_DAY 20) -- cgit v0.12 From cdc2b41cc2161b21192460bb92da40c6d4c6107f Mon Sep 17 00:00:00 2001 From: Brad King Date: Fri, 20 May 2011 08:06:35 -0400 Subject: Fix CompileCommandOutput test build on Windows Add dllexport markup for the shared library. --- Tests/CompileCommandOutput/relative.h | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/Tests/CompileCommandOutput/relative.h b/Tests/CompileCommandOutput/relative.h index 2168035..ddfe551 100644 --- a/Tests/CompileCommandOutput/relative.h +++ b/Tests/CompileCommandOutput/relative.h @@ -1 +1,11 @@ -void relative(); +#if defined(_WIN32) +# ifdef test2_EXPORTS +# define TEST2_EXPORT __declspec(dllexport) +# else +# define TEST2_EXPORT __declspec(dllimport) +# endif +#else +# define TEST2_EXPORT +#endif + +TEST2_EXPORT void relative(); -- cgit v0.12 From ac5b999fffc88a1db3d4558e2dd6fd104cf2258a Mon Sep 17 00:00:00 2001 From: Brad King Date: Fri, 21 Jan 2011 13:09:22 -0500 Subject: Add Absoft Fortran compiler id and basic flags Identification at preprocessing time depends on definition of __ABSOFT__ to be added in service pack V11.1.2 of the compiler. --- Modules/CMakeDetermineFortranCompiler.cmake | 3 ++- Modules/CMakeFortranCompilerId.F.in | 2 ++ Modules/Compiler/Absoft-Fortran.cmake | 8 ++++++++ 3 files changed, 12 insertions(+), 1 deletion(-) create mode 100644 Modules/Compiler/Absoft-Fortran.cmake diff --git a/Modules/CMakeDetermineFortranCompiler.cmake b/Modules/CMakeDetermineFortranCompiler.cmake index 5355886..ed4e983 100644 --- a/Modules/CMakeDetermineFortranCompiler.cmake +++ b/Modules/CMakeDetermineFortranCompiler.cmake @@ -64,7 +64,7 @@ IF(NOT CMAKE_Fortran_COMPILER) # then 77 or older compilers, gnu is always last in the group, # so if you paid for a compiler it is picked by default. SET(CMAKE_Fortran_COMPILER_LIST - ifort ifc efc f95 pathf2003 pathf95 pgf95 lf95 xlf95 fort + ifort ifc af95 af90 efc f95 pathf2003 pathf95 pgf95 lf95 xlf95 fort gfortran gfortran-4 g95 f90 pathf90 pgf90 xlf90 epcf90 fort77 frt pgf77 xlf fl32 af77 g77 f77 ) @@ -72,6 +72,7 @@ IF(NOT CMAKE_Fortran_COMPILER) # Vendor-specific compiler names. SET(_Fortran_COMPILER_NAMES_GNU gfortran gfortran-4 g95 g77) SET(_Fortran_COMPILER_NAMES_Intel ifort ifc efc) + SET(_Fortran_COMPILER_NAMES_Absoft af95 af90 af77) SET(_Fortran_COMPILER_NAMES_PGI pgf95 pgf90 pgf77) SET(_Fortran_COMPILER_NAMES_PathScale pathf2003 pathf95 pathf90) SET(_Fortran_COMPILER_NAMES_XL xlf) diff --git a/Modules/CMakeFortranCompilerId.F.in b/Modules/CMakeFortranCompilerId.F.in index 8584731..4d25de0 100644 --- a/Modules/CMakeFortranCompilerId.F.in +++ b/Modules/CMakeFortranCompilerId.F.in @@ -12,6 +12,8 @@ PRINT *, 'INFO:compiler[G95]' #elif defined(__PATHSCALE__) PRINT *, 'INFO:compiler[PathScale]' +#elif defined(__ABSOFT__) + PRINT *, 'INFO:compiler[Absoft]' #elif defined(__GNUC__) PRINT *, 'INFO:compiler[GNU]' #elif defined(__IBMC__) diff --git a/Modules/Compiler/Absoft-Fortran.cmake b/Modules/Compiler/Absoft-Fortran.cmake new file mode 100644 index 0000000..bb7d3dc --- /dev/null +++ b/Modules/Compiler/Absoft-Fortran.cmake @@ -0,0 +1,8 @@ +SET(CMAKE_Fortran_FLAGS_INIT "") +SET(CMAKE_Fortran_FLAGS_DEBUG_INIT "-g") +SET(CMAKE_Fortran_FLAGS_MINSIZEREL_INIT "") +SET(CMAKE_Fortran_FLAGS_RELEASE_INIT "-O3") +SET(CMAKE_Fortran_FLAGS_RELWITHDEBINFO_INIT "-O2 -g") +SET(CMAKE_Fortran_MODDIR_FLAG "-YMOD_OUT_DIR=") +SET(CMAKE_Fortran_MODPATH_FLAG "-p") +SET(CMAKE_Fortran_VERBOSE_FLAG "-v") -- cgit v0.12 From d7b376b3a734c2356a1e5138cf0ae52112612e0c Mon Sep 17 00:00:00 2001 From: Brad King Date: Mon, 24 Jan 2011 11:18:18 -0500 Subject: Absoft: Detect implicit link libraries on Linux and Mac Use the "-X -v" flag to the Absoft front-end to pass "-v" to the gcc it invokes under the hood. Teach CMakeParseImplicitLinkInfo to exclude linker version lines from consideration as link lines. Fix parsing of Sun's linker search path option "-Y..." to avoid conflict with the Mac linker option "-Y". --- Modules/CMakeParseImplicitLinkInfo.cmake | 8 +++++--- Modules/Platform/Darwin-Absoft-Fortran.cmake | 1 + Modules/Platform/Linux-Absoft-Fortran.cmake | 1 + Tests/CMakeTests/ImplicitLinkInfoTest.cmake.in | 15 +++++++++++++++ 4 files changed, 22 insertions(+), 3 deletions(-) create mode 100644 Modules/Platform/Darwin-Absoft-Fortran.cmake create mode 100644 Modules/Platform/Linux-Absoft-Fortran.cmake diff --git a/Modules/CMakeParseImplicitLinkInfo.cmake b/Modules/CMakeParseImplicitLinkInfo.cmake index 5405bda..ecb20dc 100644 --- a/Modules/CMakeParseImplicitLinkInfo.cmake +++ b/Modules/CMakeParseImplicitLinkInfo.cmake @@ -29,11 +29,13 @@ function(CMAKE_PARSE_IMPLICIT_LINK_INFO text lib_var dir_var log_var obj_regex) # Construct a regex to match linker lines. It must match both the # whole line and just the command (argv[0]). set(linker_regex "^( *|.*[/\\])(${linker}|ld|collect2)[^/\\]*( |$)") + set(linker_exclude_regex "collect2 version ") set(log "${log} link line regex: [${linker_regex}]\n") string(REGEX REPLACE "\r?\n" ";" output_lines "${text}") foreach(line IN LISTS output_lines) set(cmd) - if("${line}" MATCHES "${linker_regex}") + if("${line}" MATCHES "${linker_regex}" AND + NOT "${line}" MATCHES "${linker_exclude_regex}") if(UNIX) separate_arguments(args UNIX_COMMAND "${line}") else() @@ -64,8 +66,8 @@ function(CMAKE_PARSE_IMPLICIT_LINK_INFO text lib_var dir_var log_var obj_regex) # Object file full path. list(APPEND implicit_libs_tmp ${arg}) set(log "${log} arg [${arg}] ==> obj [${arg}]\n") - elseif("${arg}" MATCHES "^-Y(P,)?") - # Sun search path. + elseif("${arg}" MATCHES "^-Y(P,)?[^0-9]") + # Sun search path ([^0-9] avoids conflict with Mac -Y). string(REGEX REPLACE "^-Y(P,)?" "" dirs "${arg}") string(REPLACE ":" ";" dirs "${dirs}") list(APPEND implicit_dirs_tmp ${dirs}) diff --git a/Modules/Platform/Darwin-Absoft-Fortran.cmake b/Modules/Platform/Darwin-Absoft-Fortran.cmake new file mode 100644 index 0000000..beb41a3 --- /dev/null +++ b/Modules/Platform/Darwin-Absoft-Fortran.cmake @@ -0,0 +1 @@ +set(CMAKE_Fortran_VERBOSE_FLAG "-X -v") # Runs gcc under the hood. diff --git a/Modules/Platform/Linux-Absoft-Fortran.cmake b/Modules/Platform/Linux-Absoft-Fortran.cmake new file mode 100644 index 0000000..beb41a3 --- /dev/null +++ b/Modules/Platform/Linux-Absoft-Fortran.cmake @@ -0,0 +1 @@ +set(CMAKE_Fortran_VERBOSE_FLAG "-X -v") # Runs gcc under the hood. diff --git a/Tests/CMakeTests/ImplicitLinkInfoTest.cmake.in b/Tests/CMakeTests/ImplicitLinkInfoTest.cmake.in index 3fb4652..dbe9500 100644 --- a/Tests/CMakeTests/ImplicitLinkInfoTest.cmake.in +++ b/Tests/CMakeTests/ImplicitLinkInfoTest.cmake.in @@ -84,6 +84,13 @@ set(linux64_nagfor_dirs "/usr/lib/gcc/x86_64-redhat-linux/4.4.5;/usr/lib64;/lib6 set(linux64_nagfor_obj_regex "^/usr/local/NAG/lib") list(APPEND platforms linux64_nagfor) +# absoft dummy.f -X -v +set(linux64_absoft_text "collect2 version 4.4.5 (x86-64 Linux/ELF) +/usr/bin/ld --build-id --eh-frame-hdr -m elf_x86_64 --hash-style=both -dynamic-linker /lib64/ld-linux-x86-64.so.2 /usr/lib/gcc/x86_64-linux-gnu/4.4.5/../../../../lib/crt1.o /usr/lib/gcc/x86_64-linux-gnu/4.4.5/../../../../lib/crti.o /usr/lib/gcc/x86_64-linux-gnu/4.4.5/crtbegin.o -L/opt/absoft11.1/lib64 -L/usr/lib/gcc/x86_64-linux-gnu/4.4.5 -L/usr/lib/gcc/x86_64-linux-gnu/4.4.5 -L/usr/lib/gcc/x86_64-linux-gnu/4.4.5/../../../../lib -L/lib/../lib -L/usr/lib/../lib -L/usr/lib/gcc/x86_64-linux-gnu/4.4.5/../../.. /tmp/E3Bii1/dummy.o -v -laf90math -lafio -lamisc -labsoftmain -laf77math -lm -lmv -lpthread -lgcc --as-needed -lgcc_s --no-as-needed -lc -lgcc --as-needed -lgcc_s --no-as-needed /usr/lib/gcc/x86_64-linux-gnu/4.4.5/crtend.o /usr/lib/gcc/x86_64-linux-gnu/4.4.5/../../../../lib/crtn.o") +set(linux64_absoft_libs "af90math;afio;amisc;absoftmain;af77math;m;mv;pthread;c") +set(linux64_absoft_dirs "/opt/absoft11.1/lib64;/usr/lib/gcc/x86_64-linux-gnu/4.4.5;/usr/lib;/lib") +list(APPEND platforms linux64_absoft) + # gcc dummy.c -v # in strange path set(linux64_test1_text " /this/might/match/as/a/linker/ld/but/it/is/not because the ld is not the last path component @@ -125,6 +132,14 @@ set(mac_ppc_g++_libs "stdc++") set(mac_ppc_g++_dirs "/usr/lib/powerpc-apple-darwin10/4.2.1;/usr/lib/gcc/powerpc-apple-darwin10/4.2.1;/usr/lib") list(APPEND platforms mac_ppc_g++) +# absoft dummy.f -X -v +set(mac_absoft_text "collect2 version 4.2.1 (Apple Inc. build 5664) (i686 Darwin) +/usr/libexec/gcc/i686-apple-darwin10/4.2.1/ld -dynamic -arch i386 -macosx_version_min 10.6.6 -weak_reference_mismatches non-weak -o a.out -lcrt1.10.6.o -L/Applications/Absoft11.1/lib -L/usr/lib/i686-apple-darwin10/4.2.1 -L/usr/lib/gcc/i686-apple-darwin10/4.2.1 -L/usr/lib/gcc/i686-apple-darwin10/4.2.1 -L/usr/lib/gcc/i686-apple-darwin10/4.2.1/../../../i686-apple-darwin10/4.2.1 -L/usr/lib/gcc/i686-apple-darwin10/4.2.1/../../.. /var/folders/04/04+Djjm8GZWBmuEdp2Gsw++++TM/-Tmp-//bTAoJc/dummy.o -v -Y 10 -laf90math -lafio -lamisc -labsoftmain -laf77math -lm -lmv -lSystem -lgcc -lSystem +") +set(mac_absoft_libs "af90math;afio;amisc;absoftmain;af77math;m;mv") +set(mac_absoft_dirs "/Applications/Absoft11.1/lib;/usr/lib/i686-apple-darwin10/4.2.1;/usr/lib/gcc/i686-apple-darwin10/4.2.1;/usr/lib") +list(APPEND platforms mac_absoft) + #----------------------------------------------------------------------------- # Sun -- cgit v0.12 From 8bd3e51a1cff4785c1dbdab33dd8b2fc286c116a Mon Sep 17 00:00:00 2001 From: Brad King Date: Mon, 24 Jan 2011 11:21:41 -0500 Subject: Absoft: Enable FortranCInterface check in Fortran test Exclude module symbol mangling because Absoft mangles with ".in." so the symbols cannot be referenced from C. --- Tests/Fortran/CMakeLists.txt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Tests/Fortran/CMakeLists.txt b/Tests/Fortran/CMakeLists.txt index 04563ef..90598d6 100644 --- a/Tests/Fortran/CMakeLists.txt +++ b/Tests/Fortran/CMakeLists.txt @@ -34,7 +34,7 @@ function(test_fortran_c_interface_module) FortranCInterface_VERIFY() FortranCInterface_VERIFY(CXX) if(CMAKE_Fortran_COMPILER_SUPPORTS_F90) - if(NOT CMAKE_Fortran_COMPILER_ID MATCHES "SunPro|MIPSpro|PathScale") + if(NOT CMAKE_Fortran_COMPILER_ID MATCHES "SunPro|MIPSpro|PathScale|Absoft") set(module_expected 1) endif() if(FortranCInterface_MODULE_FOUND OR module_expected) @@ -108,6 +108,9 @@ if(("${CMAKE_Fortran_COMPILER_ID}" MATCHES "Intel") ) set(COMPATABLE_COMPILERS TRUE) endif() +if("${CMAKE_Fortran_COMPILER_ID}:${CMAKE_C_COMPILER_ID}" MATCHES "Absoft:GNU") + set(COMPATABLE_COMPILERS TRUE) +endif() if(COMPATABLE_COMPILERS OR ("${CMAKE_Fortran_COMPILER_ID}" MATCHES "${CMAKE_C_COMPILER_ID}" )) test_fortran_c_interface_module() -- cgit v0.12 From 41c83c1bdc1bb09a10258b2403d098eb0440cca1 Mon Sep 17 00:00:00 2001 From: KWSys Robot Date: Sat, 21 May 2011 00:01:07 -0400 Subject: KWSys Nightly Date Stamp --- Source/kwsys/kwsysDateStamp.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/kwsys/kwsysDateStamp.cmake b/Source/kwsys/kwsysDateStamp.cmake index ad1a770..8e1d0e8 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 05) # KWSys version date day component. Format is DD. -SET(KWSYS_DATE_STAMP_DAY 20) +SET(KWSYS_DATE_STAMP_DAY 21) -- cgit v0.12 From db45b10ff7b977569ee0f9a01b790aa67da3f639 Mon Sep 17 00:00:00 2001 From: Eric NOULARD Date: Sat, 21 May 2011 12:34:37 +0200 Subject: CPack make RPM work on AIX. fix #0012183 merge patch from Pasi Valminen --- Modules/CPackRPM.cmake | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Modules/CPackRPM.cmake b/Modules/CPackRPM.cmake index d9d074c..b711bc2 100644 --- a/Modules/CPackRPM.cmake +++ b/Modules/CPackRPM.cmake @@ -489,9 +489,9 @@ ENDIF(CPACK_RPM_PACKAGE_COMPONENT) # file name by enclosing it between double quotes (thus the sed) # Then we must authorize any man pages extension (adding * at the end) # because rpmbuild may automatically compress those files -EXECUTE_PROCESS(COMMAND find -type f -o -type l - COMMAND sed {s:.*/man.*/.*:&*:} - COMMAND sed {s/\\.\\\(.*\\\)/\"\\1\"/} +EXECUTE_PROCESS(COMMAND find . -type f -o -type l + COMMAND sed s:.*/man.*/.*:&*: + COMMAND sed s/\\.\\\(.*\\\)/\"\\1\"/ WORKING_DIRECTORY "${WDIR}" OUTPUT_VARIABLE CPACK_RPM_INSTALL_FILES) -- cgit v0.12 From b3bab3ce034919d5c9743560c9b20825011054a9 Mon Sep 17 00:00:00 2001 From: KWSys Robot Date: Sun, 22 May 2011 00:01:04 -0400 Subject: KWSys Nightly Date Stamp --- Source/kwsys/kwsysDateStamp.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/kwsys/kwsysDateStamp.cmake b/Source/kwsys/kwsysDateStamp.cmake index 8e1d0e8..0fe67ac 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 05) # KWSys version date day component. Format is DD. -SET(KWSYS_DATE_STAMP_DAY 21) +SET(KWSYS_DATE_STAMP_DAY 22) -- cgit v0.12 From cac769f3a7850ad46be660f2c4a1f6928bac488f Mon Sep 17 00:00:00 2001 From: KWSys Robot Date: Mon, 23 May 2011 00:01:03 -0400 Subject: KWSys Nightly Date Stamp --- Source/kwsys/kwsysDateStamp.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/kwsys/kwsysDateStamp.cmake b/Source/kwsys/kwsysDateStamp.cmake index 0fe67ac..54b4c86 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 05) # KWSys version date day component. Format is DD. -SET(KWSYS_DATE_STAMP_DAY 22) +SET(KWSYS_DATE_STAMP_DAY 23) -- cgit v0.12 From 5cf4ff6e1fefe964f19e5f83e7ef68ca64bd2e05 Mon Sep 17 00:00:00 2001 From: Brad King Date: Mon, 23 May 2011 13:21:15 -0400 Subject: Document status of output_required_files command (#12214) This command is barely functional and exists only for historical reasons. State this in the documentation. --- Source/cmOutputRequiredFilesCommand.h | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/Source/cmOutputRequiredFilesCommand.h b/Source/cmOutputRequiredFilesCommand.h index 0da7724..6038472 100644 --- a/Source/cmOutputRequiredFilesCommand.h +++ b/Source/cmOutputRequiredFilesCommand.h @@ -47,8 +47,7 @@ public: */ virtual const char* GetTerseDocumentation() { - return - "Output a list of required source files for a specified source file."; + return "Deprecated. Approximate C preprocessor dependency scanning."; } /** @@ -57,12 +56,22 @@ public: virtual const char* GetFullDocumentation() { return + "This command exists only because ancient CMake versions provided it. " + "CMake handles preprocessor dependency scanning automatically using a " + "more advanced scanner.\n" " output_required_files(srcfile outputfile)\n" "Outputs a list of all the source files that are required by the " "specified srcfile. This list is written into outputfile. This is " "similar to writing out the dependencies for srcfile except that it " "jumps from .h files into .cxx, .c and .cpp files if possible."; } + + /** This command is kept for compatibility with older CMake versions. */ + virtual bool IsDiscouraged() + { + return true; + } + cmTypeMacro(cmOutputRequiredFilesCommand, cmCommand); void ListDependencies(cmDependInformation const *info, -- cgit v0.12 From 7ff98b7a8c097b3ffcc91289c38244c627c7e142 Mon Sep 17 00:00:00 2001 From: Brad King Date: Mon, 23 May 2011 15:57:41 -0400 Subject: Fix forced-seed argument type in string(RANDOM) Clang points out that local variable 'seed' needs to be "unsigned int": Source/cmStringCommand.cxx:828:21: warning: operands of ? are integers of different signs: 'int' and 'unsigned int' [-Wsign-compare] srand(force_seed? seed : cmSystemTools::RandomSeed()); ^ ~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~ --- Source/cmStringCommand.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Source/cmStringCommand.cxx b/Source/cmStringCommand.cxx index e3bf08f..3c74dc9 100644 --- a/Source/cmStringCommand.cxx +++ b/Source/cmStringCommand.cxx @@ -770,7 +770,7 @@ bool cmStringCommand static bool seeded = false; bool force_seed = false; - int seed = 0; + unsigned int seed = 0; int length = 5; const char cmStringCommandDefaultAlphabet[] = "qwertyuiopasdfghjklzxcvbnm" "QWERTYUIOPASDFGHJKLZXCVBNM" @@ -797,7 +797,7 @@ bool cmStringCommand else if ( args[i] == "RANDOM_SEED" ) { ++i; - seed = atoi(args[i].c_str()); + seed = static_cast(atoi(args[i].c_str())); force_seed = true; } } -- cgit v0.12 From a6b52bd8ef82d015231b426ac2d0a1e84ee3a823 Mon Sep 17 00:00:00 2001 From: David Cole Date: Mon, 23 May 2011 17:30:23 -0400 Subject: VS10: Write header-only files in correct xml element (#11925) --- Source/cmVisualStudio10TargetGenerator.cxx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx index b8fef25..6d2338e 100644 --- a/Source/cmVisualStudio10TargetGenerator.cxx +++ b/Source/cmVisualStudio10TargetGenerator.cxx @@ -455,7 +455,11 @@ void cmVisualStudio10TargetGenerator::WriteGroups() { lang = "None"; } - if(lang[0] == 'C') + if(header) + { + headers.push_back(sf); + } + else if(lang[0] == 'C') { clCompile.push_back(sf); } @@ -467,10 +471,6 @@ void cmVisualStudio10TargetGenerator::WriteGroups() { customBuild.push_back(sf); } - else if(header) - { - headers.push_back(sf); - } else if(ext == "idl") { idls.push_back(sf); -- cgit v0.12 From 0c64fcd3097c9aa0c0329cf8c33074aec1cc505e Mon Sep 17 00:00:00 2001 From: KWSys Robot Date: Tue, 24 May 2011 00:01:04 -0400 Subject: KWSys Nightly Date Stamp --- Source/kwsys/kwsysDateStamp.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/kwsys/kwsysDateStamp.cmake b/Source/kwsys/kwsysDateStamp.cmake index 54b4c86..2af01d2 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 05) # KWSys version date day component. Format is DD. -SET(KWSYS_DATE_STAMP_DAY 23) +SET(KWSYS_DATE_STAMP_DAY 24) -- cgit v0.12 From 8b17fd67256d10c86acba9c2b2ce1d0211a90fea Mon Sep 17 00:00:00 2001 From: KWSys Robot Date: Wed, 25 May 2011 00:01:30 -0400 Subject: KWSys Nightly Date Stamp --- Source/kwsys/kwsysDateStamp.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/kwsys/kwsysDateStamp.cmake b/Source/kwsys/kwsysDateStamp.cmake index 2af01d2..064400b 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 05) # KWSys version date day component. Format is DD. -SET(KWSYS_DATE_STAMP_DAY 24) +SET(KWSYS_DATE_STAMP_DAY 25) -- cgit v0.12