diff options
53 files changed, 351 insertions, 349 deletions
diff --git a/Help/command/string.rst b/Help/command/string.rst index 1e18ca6..af18825 100644 --- a/Help/command/string.rst +++ b/Help/command/string.rst @@ -15,6 +15,7 @@ String operations. string(REPLACE <match_string> <replace_string> <output variable> <input> [<input>...]) + string(CONCAT <output variable> [<input>...]) string(<MD5|SHA1|SHA224|SHA256|SHA384|SHA512> <output variable> <input>) string(COMPARE EQUAL <string1> <string2> <output variable>) @@ -51,6 +52,9 @@ through argument parsing. REPLACE will replace all occurrences of match_string in the input with replace_string and store the result in the output. +CONCAT will concatenate all the input arguments together and store +the result in the named output variable. + MD5, SHA1, SHA224, SHA256, SHA384, and SHA512 will compute a cryptographic hash of the input string. diff --git a/Help/manual/cmake-policies.7.rst b/Help/manual/cmake-policies.7.rst index 4fcc90b..cb328ee 100644 --- a/Help/manual/cmake-policies.7.rst +++ b/Help/manual/cmake-policies.7.rst @@ -57,3 +57,4 @@ All Policies /policy/CMP0025 /policy/CMP0026 /policy/CMP0027 + /policy/CMP0028 diff --git a/Help/manual/cmake.1.rst b/Help/manual/cmake.1.rst index d026c63..d2a45aa 100644 --- a/Help/manual/cmake.1.rst +++ b/Help/manual/cmake.1.rst @@ -36,12 +36,6 @@ native tool on their platform. are available. On Windows: delete_regv, write_regv. On UNIX: create_symlink. -* ``-i``: Run in wizard mode. - - Wizard mode runs cmake interactively without a GUI. The user is - prompted to answer questions about the project configuration. The - answers are used to set cmake cache values. - * ``-L[A][H]``: List non-advanced cached variables. List cache variables will run CMake and list all the variables from @@ -64,10 +58,7 @@ native tool on their platform. --config <cfg> = For multi-configuration tools, choose <cfg>. --clean-first = Build target 'clean' first, then build. (To clean only, use --target 'clean'.) - --use-stderr = Don't merge stdout/stderr output and pass the - original stdout/stderr handles to the native - tool so it can use the capabilities of the - calling terminal (e.g. colored output). + --use-stderr = Ignored. Behavior is default in CMake >= 3.0. -- = Pass remaining options to the native tool. Run cmake --build with no options for quick help. diff --git a/Help/policy/CMP0028.rst b/Help/policy/CMP0028.rst new file mode 100644 index 0000000..ec318a0 --- /dev/null +++ b/Help/policy/CMP0028.rst @@ -0,0 +1,23 @@ +CMP0028 +------- + +Double colon in target name means ALIAS or IMPORTED target. + +CMake 2.8.12 and lower allowed the use of targets and files with double +colons in target_link_libraries, with some buildsystem generators. + +The use of double-colons is a common pattern used to namespace IMPORTED +targets and ALIAS targets. When computing the link dependencies of a target, +the name of each dependency could either be a target, or a file on disk. +Previously, if a target was not found with a matching name, the name was +considered to refer to a file on disk. This can lead to confusing error +messages if there is a typo in what should be a target name. + +The OLD behavior for this policy is to search for targets, then files on disk, +even if the search term contains double-colons. The NEW behavior for this +policy is to issue a FATAL_ERROR if a link dependency contains +double-colons but is not an IMPORTED target or an ALIAS target. + +This policy was introduced in CMake version 3.0.0. CMake version +|release| warns when the policy is not set and uses OLD behavior. Use +the cmake_policy command to set it to OLD or NEW explicitly. diff --git a/Help/prop_tgt/VS_GLOBAL_KEYWORD.rst b/Help/prop_tgt/VS_GLOBAL_KEYWORD.rst index 072475f..ce49316 100644 --- a/Help/prop_tgt/VS_GLOBAL_KEYWORD.rst +++ b/Help/prop_tgt/VS_GLOBAL_KEYWORD.rst @@ -1,9 +1,12 @@ VS_GLOBAL_KEYWORD ----------------- -Visual Studio project keyword. +Visual Studio project keyword for VS 10 (2010) and newer. Sets the "keyword" attribute for a generated Visual Studio project. Defaults to "Win32Proj". You may wish to override this value with "ManagedCProj", for example, in a Visual Studio managed C++ unit test project. + +Use the :prop_tgt:`VS_KEYWORD` target property to set the +keyword for Visual Studio 9 (2008) and older. diff --git a/Help/prop_tgt/VS_KEYWORD.rst b/Help/prop_tgt/VS_KEYWORD.rst index aa8e206..6c2e042 100644 --- a/Help/prop_tgt/VS_KEYWORD.rst +++ b/Help/prop_tgt/VS_KEYWORD.rst @@ -1,7 +1,10 @@ VS_KEYWORD ---------- -Visual Studio project keyword. +Visual Studio project keyword for VS 9 (2008) and older. Can be set to change the visual studio keyword, for example Qt integration works better if this is set to Qt4VSv1.0. + +Use the :prop_tgt:`VS_GLOBAL_KEYWORD` target property to set the +keyword for Visual Studio 10 (2010) and newer. diff --git a/Source/CMakeLists.txt b/Source/CMakeLists.txt index 7efaa50..01e4f88 100644 --- a/Source/CMakeLists.txt +++ b/Source/CMakeLists.txt @@ -281,8 +281,6 @@ set(SRCS cmXMLSafe.h cmake.cxx cmake.h - cmakewizard.cxx - cmakewizard.h cm_sha2.h cm_sha2.c diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index a44f362..1c41593 100644 --- a/Source/CMakeVersion.cmake +++ b/Source/CMakeVersion.cmake @@ -2,5 +2,5 @@ set(CMake_VERSION_MAJOR 2) set(CMake_VERSION_MINOR 8) set(CMake_VERSION_PATCH 12) -set(CMake_VERSION_TWEAK 20131021) +set(CMake_VERSION_TWEAK 20131023) #set(CMake_VERSION_RC 1) diff --git a/Source/cmCacheManager.h b/Source/cmCacheManager.h index 2eb440a..4b8c07d 100644 --- a/Source/cmCacheManager.h +++ b/Source/cmCacheManager.h @@ -179,7 +179,6 @@ private: // the commands should never use the cmCacheManager directly friend class cmMakefile; // allow access to add cache values friend class cmake; // allow access to add cache values - friend class cmakewizard; // allow access to add cache values friend class cmMarkAsAdvancedCommand; // allow access to add cache values }; diff --git a/Source/cmGeneratorExpressionEvaluator.cxx b/Source/cmGeneratorExpressionEvaluator.cxx index 7fd0fdc..dfd995e 100644 --- a/Source/cmGeneratorExpressionEvaluator.cxx +++ b/Source/cmGeneratorExpressionEvaluator.cxx @@ -1446,7 +1446,7 @@ cmGeneratorExpressionNode* GetNode(const std::string &identifier) //---------------------------------------------------------------------------- GeneratorExpressionContent::GeneratorExpressionContent( const char *startContent, - unsigned int length) + size_t length) : StartContent(startContent), ContentLength(length) { diff --git a/Source/cmGeneratorExpressionEvaluator.h b/Source/cmGeneratorExpressionEvaluator.h index 218abf1..343e18b 100644 --- a/Source/cmGeneratorExpressionEvaluator.h +++ b/Source/cmGeneratorExpressionEvaluator.h @@ -63,7 +63,7 @@ private: struct TextContent : public cmGeneratorExpressionEvaluator { - TextContent(const char *start, unsigned int length) + TextContent(const char *start, size_t length) : Content(start), Length(length) { @@ -80,25 +80,25 @@ struct TextContent : public cmGeneratorExpressionEvaluator return cmGeneratorExpressionEvaluator::Text; } - void Extend(unsigned int length) + void Extend(size_t length) { this->Length += length; } - unsigned int GetLength() + size_t GetLength() { return this->Length; } private: const char *Content; - unsigned int Length; + size_t Length; }; //---------------------------------------------------------------------------- struct GeneratorExpressionContent : public cmGeneratorExpressionEvaluator { - GeneratorExpressionContent(const char *startContent, unsigned int length); + GeneratorExpressionContent(const char *startContent, size_t length); void SetIdentifier(std::vector<cmGeneratorExpressionEvaluator*> identifier) { this->IdentifierChildren = identifier; @@ -141,7 +141,7 @@ private: std::vector<cmGeneratorExpressionEvaluator*> IdentifierChildren; std::vector<std::vector<cmGeneratorExpressionEvaluator*> > ParamChildren; const char *StartContent; - unsigned int ContentLength; + size_t ContentLength; }; #endif diff --git a/Source/cmGeneratorExpressionLexer.h b/Source/cmGeneratorExpressionLexer.h index 5f16712..83d661d 100644 --- a/Source/cmGeneratorExpressionLexer.h +++ b/Source/cmGeneratorExpressionLexer.h @@ -19,7 +19,7 @@ //---------------------------------------------------------------------------- struct cmGeneratorExpressionToken { - cmGeneratorExpressionToken(unsigned type, const char *c, unsigned l) + cmGeneratorExpressionToken(unsigned type, const char *c, size_t l) : TokenType(type), Content(c), Length(l) { } @@ -32,7 +32,7 @@ struct cmGeneratorExpressionToken }; unsigned TokenType; const char *Content; - unsigned Length; + size_t Length; }; /** \class cmGeneratorExpressionLexer diff --git a/Source/cmGeneratorExpressionParser.cxx b/Source/cmGeneratorExpressionParser.cxx index e1fb8f1..a41a6e5 100644 --- a/Source/cmGeneratorExpressionParser.cxx +++ b/Source/cmGeneratorExpressionParser.cxx @@ -235,7 +235,7 @@ void cmGeneratorExpressionParser::ParseGeneratorExpression( return; } - int contentLength = ((this->it - 1)->Content + size_t contentLength = ((this->it - 1)->Content - startToken->Content) + (this->it - 1)->Length; GeneratorExpressionContent *content = new GeneratorExpressionContent( diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx index c8b6832..13ed143 100644 --- a/Source/cmGlobalXCodeGenerator.cxx +++ b/Source/cmGlobalXCodeGenerator.cxx @@ -876,10 +876,20 @@ cmGlobalXCodeGenerator::CreateXCodeFileReferenceFromPath( ext = realExt.substr(1); } - std::string sourcecode = GetSourcecodeValueFromFileExtension(ext, lang); - - fileRef->AddAttribute("explicitFileType", - this->CreateString(sourcecode.c_str())); + // If fullpath references a directory, then we need to specify + // lastKnownFileType as folder in order for Xcode to be able to open the + // contents of the folder (Xcode 4.6 does not like explicitFileType=folder). + if(cmSystemTools::FileIsDirectory(fullpath.c_str())) + { + fileRef->AddAttribute("lastKnownFileType", + this->CreateString("folder")); + } + else + { + std::string sourcecode = GetSourcecodeValueFromFileExtension(ext, lang); + fileRef->AddAttribute("explicitFileType", + this->CreateString(sourcecode.c_str())); + } // Store the file path relative to the top of the source tree. std::string path = this->RelativeToSource(fullpath.c_str()); @@ -1009,7 +1019,8 @@ cmGlobalXCodeGenerator::CreateXCodeTargets(cmLocalGenerator* gen, cmTarget::SourceFileFlags tsFlags = cmtarget.GetTargetSourceFileFlags(*i); - if(strcmp(filetype->GetString(), "compiled.mach-o.objfile") == 0) + if(filetype && + strcmp(filetype->GetString(), "compiled.mach-o.objfile") == 0) { externalObjFiles.push_back(xsf); } diff --git a/Source/cmLocalVisualStudio7Generator.cxx b/Source/cmLocalVisualStudio7Generator.cxx index f21abc3..30c3d73 100644 --- a/Source/cmLocalVisualStudio7Generator.cxx +++ b/Source/cmLocalVisualStudio7Generator.cxx @@ -2050,6 +2050,11 @@ cmLocalVisualStudio7Generator::WriteProjectStart(std::ostream& fout, fout << "\tProjectGUID=\"{" << gg->GetGUID(libName) << "}\"\n"; } this->WriteProjectSCC(fout, target); + if(const char* targetFrameworkVersion = + target.GetProperty("VS_DOTNET_TARGET_FRAMEWORK_VERSION")) + { + fout << "\tTargetFrameworkVersion=\"" << targetFrameworkVersion << "\"\n"; + } fout << "\tKeyword=\"" << keyword << "\">\n" << "\t<Platforms>\n" << "\t\t<Platform\n\t\t\tName=\"" << this->PlatformName << "\"/>\n" diff --git a/Source/cmPolicies.cxx b/Source/cmPolicies.cxx index ffab8e5..f7efc1e 100644 --- a/Source/cmPolicies.cxx +++ b/Source/cmPolicies.cxx @@ -241,6 +241,11 @@ cmPolicies::cmPolicies() CMP0027, "CMP0027", "Conditionally linked imported targets with missing include directories.", 3,0,0,0, cmPolicies::WARN); + + this->DefinePolicy( + CMP0028, "CMP0028", + "Double colon in target name means ALIAS or IMPORTED target.", + 3,0,0,0, cmPolicies::WARN); } cmPolicies::~cmPolicies() diff --git a/Source/cmPolicies.h b/Source/cmPolicies.h index 39c2afb..68cd7c2 100644 --- a/Source/cmPolicies.h +++ b/Source/cmPolicies.h @@ -79,6 +79,7 @@ public: CMP0026, ///< Disallow use of the LOCATION target property. CMP0027, ///< Conditionally linked imported targets with missing include /// directories. + CMP0028, ///< Double colon in target name means ALIAS or IMPORTED target. /** \brief Always the last entry. * diff --git a/Source/cmRST.cxx b/Source/cmRST.cxx index 18a197b..d2eeb0c 100644 --- a/Source/cmRST.cxx +++ b/Source/cmRST.cxx @@ -22,6 +22,7 @@ cmRST::cmRST(std::ostream& os, std::string const& docroot): DocRoot(docroot), IncludeDepth(0), OutputLinePending(false), + LastLineEndedInColonColon(false), Markup(MarkupNone), Directive(DirectiveNone), CMakeDirective("^.. (cmake:)?(" @@ -125,6 +126,7 @@ void cmRST::Reset() { case DirectiveNone: break; case DirectiveParsedLiteral: this->ProcessDirectiveParsedLiteral(); break; + case DirectiveLiteralBlock: this->ProcessDirectiveLiteralBlock(); break; case DirectiveCodeBlock: this->ProcessDirectiveCodeBlock(); break; case DirectiveReplace: this->ProcessDirectiveReplace(); break; case DirectiveTocTree: this->ProcessDirectiveTocTree(); break; @@ -137,6 +139,9 @@ void cmRST::Reset() //---------------------------------------------------------------------------- void cmRST::ProcessLine(std::string const& line) { + bool lastLineEndedInColonColon = this->LastLineEndedInColonColon; + this->LastLineEndedInColonColon = false; + // A line starting in .. is an explicit markup start. if(line == ".." || (line.size() >= 3 && line[0] == '.' && line[1] == '.' && isspace(line[2]))) @@ -211,10 +216,21 @@ void cmRST::ProcessLine(std::string const& line) this->MarkupLines.push_back(line); } } + // A blank line following a paragraph ending in "::" starts a literal block. + else if(lastLineEndedInColonColon && line.empty()) + { + // Record the literal lines to output after whole block. + this->Markup = MarkupNormal; + this->Directive = DirectiveLiteralBlock; + this->MarkupLines.push_back(""); + this->OutputLine("", false); + } // Print non-markup lines. else { this->NormalLine(line); + this->LastLineEndedInColonColon = (line.size() >= 2 + && line[line.size()-2] == ':' && line[line.size()-1] == ':'); } } @@ -222,35 +238,42 @@ void cmRST::ProcessLine(std::string const& line) void cmRST::NormalLine(std::string const& line) { this->Reset(); - this->OutputLine(line); + this->OutputLine(line, true); } //---------------------------------------------------------------------------- -void cmRST::OutputLine(std::string const& line_in) +void cmRST::OutputLine(std::string const& line_in, bool inlineMarkup) { if(this->OutputLinePending) { this->OS << "\n"; this->OutputLinePending = false; } - std::string line = this->ReplaceSubstitutions(line_in); - std::string::size_type pos = 0; - while(this->CMakeRole.find(line.c_str()+pos)) + if(inlineMarkup) { - this->OS << line.substr(pos, this->CMakeRole.start()); - std::string text = this->CMakeRole.match(3); - // If a command reference has no explicit target and - // no explicit "(...)" then add "()" to the text. - if(this->CMakeRole.match(2) == "command" && - this->CMakeRole.match(5).empty() && - text.find_first_of("()") == text.npos) + std::string line = this->ReplaceSubstitutions(line_in); + std::string::size_type pos = 0; + while(this->CMakeRole.find(line.c_str()+pos)) { - text += "()"; + this->OS << line.substr(pos, this->CMakeRole.start()); + std::string text = this->CMakeRole.match(3); + // If a command reference has no explicit target and + // no explicit "(...)" then add "()" to the text. + if(this->CMakeRole.match(2) == "command" && + this->CMakeRole.match(5).empty() && + text.find_first_of("()") == text.npos) + { + text += "()"; + } + this->OS << "``" << text << "``"; + pos += this->CMakeRole.end(); } - this->OS << "``" << text << "``"; - pos += this->CMakeRole.end(); + this->OS << line.substr(pos) << "\n"; + } + else + { + this->OS << line_in << "\n"; } - this->OS << line.substr(pos) << "\n"; } //---------------------------------------------------------------------------- @@ -284,6 +307,22 @@ std::string cmRST::ReplaceSubstitutions(std::string const& line) } //---------------------------------------------------------------------------- +void cmRST::OutputMarkupLines(bool inlineMarkup) +{ + for(std::vector<std::string>::iterator i = this->MarkupLines.begin(); + i != this->MarkupLines.end(); ++i) + { + std::string line = *i; + if(!line.empty()) + { + line = " " + line; + } + this->OutputLine(line, inlineMarkup); + } + this->OutputLinePending = true; +} + +//---------------------------------------------------------------------------- bool cmRST::ProcessInclude(std::string file, IncludeType type) { bool found = false; @@ -317,25 +356,19 @@ bool cmRST::ProcessInclude(std::string file, IncludeType type) //---------------------------------------------------------------------------- void cmRST::ProcessDirectiveParsedLiteral() { - // Output markup lines as literal text. - for(std::vector<std::string>::iterator i = this->MarkupLines.begin(); - i != this->MarkupLines.end(); ++i) - { - std::string line = *i; - if(!line.empty()) - { - line = " " + line; - } - this->OutputLine(line); - } - this->OutputLinePending = true; + this->OutputMarkupLines(true); +} + +//---------------------------------------------------------------------------- +void cmRST::ProcessDirectiveLiteralBlock() +{ + this->OutputMarkupLines(false); } //---------------------------------------------------------------------------- void cmRST::ProcessDirectiveCodeBlock() { - // Treat markup lines the same as a parsed literal. - this->ProcessDirectiveParsedLiteral(); + this->OutputMarkupLines(false); } //---------------------------------------------------------------------------- diff --git a/Source/cmRST.h b/Source/cmRST.h index 9352941..faae25f 100644 --- a/Source/cmRST.h +++ b/Source/cmRST.h @@ -38,6 +38,7 @@ private: { DirectiveNone, DirectiveParsedLiteral, + DirectiveLiteralBlock, DirectiveCodeBlock, DirectiveReplace, DirectiveTocTree @@ -48,10 +49,12 @@ private: void Reset(); void ProcessLine(std::string const& line); void NormalLine(std::string const& line); - void OutputLine(std::string const& line); + void OutputLine(std::string const& line, bool inlineMarkup); std::string ReplaceSubstitutions(std::string const& line); + void OutputMarkupLines(bool inlineMarkup); bool ProcessInclude(std::string file, IncludeType type); void ProcessDirectiveParsedLiteral(); + void ProcessDirectiveLiteralBlock(); void ProcessDirectiveCodeBlock(); void ProcessDirectiveReplace(); void ProcessDirectiveTocTree(); @@ -61,6 +64,7 @@ private: std::string DocRoot; int IncludeDepth; bool OutputLinePending; + bool LastLineEndedInColonColon; MarkupType Markup; DirectiveType Directive; cmsys::RegularExpression CMakeDirective; diff --git a/Source/cmStringCommand.cxx b/Source/cmStringCommand.cxx index 68ba13f..f9b69e3 100644 --- a/Source/cmStringCommand.cxx +++ b/Source/cmStringCommand.cxx @@ -73,6 +73,10 @@ bool cmStringCommand { return this->HandleLengthCommand(args); } + else if(subCommand == "CONCAT") + { + return this->HandleConcatCommand(args); + } else if(subCommand == "SUBSTRING") { return this->HandleSubstringCommand(args); @@ -768,6 +772,27 @@ bool cmStringCommand //---------------------------------------------------------------------------- bool cmStringCommand +::HandleConcatCommand(std::vector<std::string> const& args) +{ + if(args.size() < 2) + { + this->SetError("sub-command CONCAT requires at least one argument."); + return false; + } + + std::string const& variableName = args[1]; + std::string value; + for(unsigned int i = 2; i < args.size(); ++i) + { + value += args[i]; + } + + this->Makefile->AddDefinition(variableName.c_str(), value.c_str()); + return true; +} + +//---------------------------------------------------------------------------- +bool cmStringCommand ::HandleMakeCIdentifierCommand(std::vector<std::string> const& args) { if(args.size() != 3) diff --git a/Source/cmStringCommand.h b/Source/cmStringCommand.h index 0e833c4..66b48e6 100644 --- a/Source/cmStringCommand.h +++ b/Source/cmStringCommand.h @@ -69,6 +69,7 @@ protected: bool HandleReplaceCommand(std::vector<std::string> const& args); bool HandleLengthCommand(std::vector<std::string> const& args); bool HandleSubstringCommand(std::vector<std::string> const& args); + bool HandleConcatCommand(std::vector<std::string> const& args); bool HandleStripCommand(std::vector<std::string> const& args); bool HandleRandomCommand(std::vector<std::string> const& args); bool HandleFindCommand(std::vector<std::string> const& args); diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx index 6e5e0ff..126cdbd 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -5505,6 +5505,46 @@ void cmTarget::ComputeLinkImplementation(const char* config, { continue; } + cmTarget *tgt = this->Makefile->FindTargetToUse(li->c_str()); + + if(!tgt && std::string(item).find("::") != std::string::npos) + { + bool noMessage = false; + cmake::MessageType messageType = cmake::FATAL_ERROR; + cmOStringStream e; + switch(this->Makefile->GetPolicyStatus(cmPolicies::CMP0028)) + { + case cmPolicies::WARN: + { + e << (this->Makefile->GetPolicies() + ->GetPolicyWarning(cmPolicies::CMP0028)) << "\n"; + messageType = cmake::AUTHOR_WARNING; + } + break; + case cmPolicies::OLD: + noMessage = true; + case cmPolicies::REQUIRED_IF_USED: + case cmPolicies::REQUIRED_ALWAYS: + case cmPolicies::NEW: + // Issue the fatal message. + break; + } + + if(!noMessage) + { + e << "Target \"" << this->GetName() << "\" links to target \"" << item + << "\" but the target was not found. Perhaps a find_package() " + "call is missing for an IMPORTED target, or a ALIAS target is " + "missing?"; + this->Makefile->GetCMakeInstance()->IssueMessage(messageType, + e.str(), + this->GetBacktrace()); + if (messageType == cmake::FATAL_ERROR) + { + return; + } + } + } // The entry is meant for this configuration. impl.Libraries.push_back(item); } diff --git a/Source/cmake.cxx b/Source/cmake.cxx index 9c79516..6822fe1 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -2871,8 +2871,7 @@ int cmake::Build(const std::string& dir, const std::string& target, const std::string& config, const std::vector<std::string>& nativeOptions, - bool clean, - cmSystemTools::OutputOption outputflag) + bool clean) { if(!cmSystemTools::FileIsDirectory(dir.c_str())) { @@ -2914,7 +2913,8 @@ int cmake::Build(const std::string& dir, projName.c_str(), target.c_str(), &output, makeProgram.c_str(), - config.c_str(), clean, false, 0, outputflag, + config.c_str(), clean, false, 0, + cmSystemTools::OUTPUT_PASSTHROUGH, 0, nativeOptions); } diff --git a/Source/cmake.h b/Source/cmake.h index 73e5109..7fe130b 100644 --- a/Source/cmake.h +++ b/Source/cmake.h @@ -362,8 +362,7 @@ class cmake const std::string& target, const std::string& config, const std::vector<std::string>& nativeOptions, - bool clean, - cmSystemTools::OutputOption outputflag); + bool clean); void UnwatchUnusedCli(const char* var); void WatchUnusedCli(const char* var); diff --git a/Source/cmakemain.cxx b/Source/cmakemain.cxx index 5113a75..ff5c8ae 100644 --- a/Source/cmakemain.cxx +++ b/Source/cmakemain.cxx @@ -20,7 +20,6 @@ #include "cmcmd.h" #include "cmCacheManager.h" #include "cmListFileCache.h" -#include "cmakewizard.h" #include "cmSourceFile.h" #include "cmGlobalGenerator.h" #include "cmLocalGenerator.h" @@ -50,10 +49,7 @@ static const char * cmDocumentationUsage[][2] = " --config <cfg> = For multi-configuration tools, choose <cfg>.\n" \ " --clean-first = Build target 'clean' first, then build.\n" \ " (To clean only, use --target 'clean'.)\n" \ - " --use-stderr = Don't merge stdout/stderr output and pass the\n" \ - " original stdout/stderr handles to the native\n" \ - " tool so it can use the capabilities of the\n" \ - " calling terminal (e.g. colored output).\n" \ + " --use-stderr = Ignored. Behavior is default in CMake >= 3.0.\n" \ " -- = Pass remaining options to the native tool.\n" //---------------------------------------------------------------------------- @@ -61,7 +57,6 @@ static const char * cmDocumentationOptions[][2] = { CMAKE_STANDARD_OPTIONS_TABLE, {"-E", "CMake command mode."}, - {"-i", "Run in wizard mode."}, {"-L[A][H]", "List non-advanced cached variables."}, {"--build <dir>", "Build a CMake-generated project binary tree."}, {"-N", "View mode only."}, @@ -236,7 +231,6 @@ int do_cmake(int ac, char** av) } #endif - bool wiz = false; bool sysinfo = false; bool list_cached = false; bool list_all_cached = false; @@ -248,7 +242,11 @@ int do_cmake(int ac, char** av) { if(strcmp(av[i], "-i") == 0) { - wiz = true; + std::cerr << + "The \"cmake -i\" wizard mode is no longer supported.\n" + "Use the -D option to set cache values on the command line.\n" + "Use cmake-gui or ccmake for an interactive dialog.\n"; + return 1; } else if(strcmp(av[i], "--system-information") == 0) { @@ -301,11 +299,6 @@ int do_cmake(int ac, char** av) args.push_back(av[i]); } } - if (wiz) - { - cmakewizard wizard; - return wizard.RunWizard(args); - } if (sysinfo) { cmake cm; @@ -372,7 +365,6 @@ static int do_build(int ac, char** av) std::string dir; std::vector<std::string> nativeOptions; bool clean = false; - cmSystemTools::OutputOption outputflag = cmSystemTools::OUTPUT_MERGE; enum Doing { DoingNone, DoingDir, DoingTarget, DoingConfig, DoingNative}; Doing doing = DoingDir; @@ -397,7 +389,7 @@ static int do_build(int ac, char** av) } else if(strcmp(av[i], "--use-stderr") == 0) { - outputflag = cmSystemTools::OUTPUT_PASSTHROUGH; + /* tolerate legacy option */ } else if(strcmp(av[i], "--") == 0) { @@ -444,6 +436,6 @@ static int do_build(int ac, char** av) } cmake cm; - return cm.Build(dir, target, config, nativeOptions, clean, outputflag); + return cm.Build(dir, target, config, nativeOptions, clean); #endif } diff --git a/Source/cmakewizard.cxx b/Source/cmakewizard.cxx deleted file mode 100644 index bac403a..0000000 --- a/Source/cmakewizard.cxx +++ /dev/null @@ -1,155 +0,0 @@ -/*============================================================================ - CMake - Cross Platform Makefile Generator - Copyright 2000-2009 Kitware, Inc., Insight Software Consortium - - Distributed under the OSI-approved BSD License (the "License"); - see accompanying file Copyright.txt for details. - - This software is distributed WITHOUT ANY WARRANTY; without even the - implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - See the License for more information. -============================================================================*/ -#include "cmakewizard.h" -#include "cmake.h" -#include "cmCacheManager.h" - -cmakewizard::cmakewizard() -{ - this->ShowAdvanced = false; -} - - -void cmakewizard::AskUser(const char* key, - cmCacheManager::CacheIterator& iter) -{ - printf("Variable Name: %s\n", key); - const char* helpstring = iter.GetProperty("HELPSTRING"); - printf("Description: %s\n", (helpstring?helpstring:"(none)")); - printf("Current Value: %s\n", iter.GetValue()); - printf("New Value (Enter to keep current value): "); - char buffer[4096]; - if(!fgets(buffer, static_cast<int>(sizeof(buffer) - 1), stdin)) - { - buffer[0] = 0; - } - - if(strlen(buffer) > 0) - { - std::string sbuffer = buffer; - std::string::size_type pos = sbuffer.find_last_not_of(" \n\r\t"); - std::string value = ""; - if ( pos != std::string::npos ) - { - value = sbuffer.substr(0, pos+1); - } - - if ( value.size() > 0 ) - { - if(iter.GetType() == cmCacheManager::PATH || - iter.GetType() == cmCacheManager::FILEPATH) - { - cmSystemTools::ConvertToUnixSlashes(value); - } - if(iter.GetType() == cmCacheManager::BOOL) - { - if(!cmSystemTools::IsOn(value.c_str())) - { - value = "OFF"; - } - } - iter.SetValue(value.c_str()); - } - } - printf("\n"); -} - -bool cmakewizard::AskAdvanced() -{ - printf("Would you like to see advanced options? [No]:"); - char buffer[4096]; - if(!fgets(buffer, static_cast<int>(sizeof(buffer) - 1), stdin)) - { - buffer[0] = 0; - } - else if(buffer[0] == 'y' || buffer[0] == 'Y') - { - return true; - } - return false; -} - - -void cmakewizard::ShowMessage(const char* m) -{ - printf("%s\n", m); -} - - - -int cmakewizard::RunWizard(std::vector<std::string> const& args) -{ - this->ShowAdvanced = this->AskAdvanced(); - cmSystemTools::DisableRunCommandOutput(); - cmake make; - make.SetArgs(args); - make.SetCMakeCommand(args[0].c_str()); - make.LoadCache(); - make.SetCacheArgs(args); - std::map<cmStdString, cmStdString> askedCache; - bool asked = false; - // continue asking questions until no new questions are asked - do - { - asked = false; - // run cmake - this->ShowMessage( - "Please wait while cmake processes CMakeLists.txt files....\n"); - - make.Configure(); - this->ShowMessage("\n"); - // load the cache from disk - cmCacheManager *cachem = make.GetCacheManager(); - cachem->LoadCache(make.GetHomeOutputDirectory()); - cmCacheManager::CacheIterator i = cachem->NewIterator(); - // iterate over all entries in the cache - for(;!i.IsAtEnd(); i.Next()) - { - std::string key = i.GetName(); - if( i.GetType() == cmCacheManager::INTERNAL || - i.GetType() == cmCacheManager::STATIC || - i.GetType() == cmCacheManager::UNINITIALIZED ) - { - continue; - } - if(askedCache.count(key)) - { - std::string& e = askedCache.find(key)->second; - if(e != i.GetValue()) - { - if(this->ShowAdvanced || !i.GetPropertyAsBool("ADVANCED")) - { - this->AskUser(key.c_str(), i); - asked = true; - } - } - } - else - { - if(this->ShowAdvanced || !i.GetPropertyAsBool("ADVANCED")) - { - this->AskUser(key.c_str(), i); - asked = true; - } - } - askedCache[key] = i.GetValue(); - } - cachem->SaveCache(make.GetHomeOutputDirectory()); - } - while(asked); - if(make.Generate() == 0) - { - this->ShowMessage("CMake complete, run make to build project.\n"); - return 0; - } - return 1; -} diff --git a/Source/cmakewizard.h b/Source/cmakewizard.h deleted file mode 100644 index 0c8dba9..0000000 --- a/Source/cmakewizard.h +++ /dev/null @@ -1,42 +0,0 @@ -/*============================================================================ - CMake - Cross Platform Makefile Generator - Copyright 2000-2009 Kitware, Inc., Insight Software Consortium - - Distributed under the OSI-approved BSD License (the "License"); - see accompanying file Copyright.txt for details. - - This software is distributed WITHOUT ANY WARRANTY; without even the - implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - See the License for more information. -============================================================================*/ - - -#include "cmMakefile.h" - -class cmakewizard -{ -public: - cmakewizard(); - virtual ~cmakewizard() {} - /** - * Prompt the user to see if they want to see advanced entries. - */ - virtual bool AskAdvanced(); - - /** - * Prompt the User for a new value for key, the answer is put in entry. - */ - virtual void AskUser(const char* key, cmCacheManager::CacheIterator& iter); - ///! Show a message to wait for cmake to run. - virtual void ShowMessage(const char*); - - /** - * Run cmake in wizard mode. This will coninue to ask the user questions - * until there are no more entries in the cache. - */ - int RunWizard(std::vector<std::string>const& args); - -private: - bool ShowAdvanced; -}; - diff --git a/Tests/CMakeLib/testRST.expect b/Tests/CMakeLib/testRST.expect index 6a89002..9bd0ca4 100644 --- a/Tests/CMakeLib/testRST.expect +++ b/Tests/CMakeLib/testRST.expect @@ -45,11 +45,30 @@ More CMake Module Content Parsed-literal included without directive. Common Indentation Removed + # replaced in parsed literal # Sample CMake code block if(condition) message(indented) endif() + # |not replaced in literal| + +A literal block starts after a line consisting of two colons + +:: + + Literal block. + Common Indentation Removed + # |not replaced in literal| + +or after a paragraph ending in two colons:: + + Literal block. + Common Indentation Removed + # |not replaced in literal| + +but not after a line ending in two colons:: +in the middle of a paragraph. substituted text with multiple lines becomes one line diff --git a/Tests/CMakeLib/testRST.rst b/Tests/CMakeLib/testRST.rst index f7059cf..5cb6d91 100644 --- a/Tests/CMakeLib/testRST.rst +++ b/Tests/CMakeLib/testRST.rst @@ -26,6 +26,7 @@ Variable :variable:`VARIABLE_<PLACEHOLDER> <target>` with trailing placeholder a Generator :generator:`Some Generator` with space. .. |not replaced| replace:: not replaced through toctree +.. |not replaced in literal| replace:: replaced in parsed literal .. toctree:: :maxdepth: 2 @@ -55,6 +56,7 @@ Generator :generator:`Some Generator` with space. Parsed-literal included without directive. Common Indentation Removed + # |not replaced in literal| .. code-block:: cmake @@ -62,6 +64,24 @@ Generator :generator:`Some Generator` with space. if(condition) message(indented) endif() + # |not replaced in literal| + +A literal block starts after a line consisting of two colons + +:: + + Literal block. + Common Indentation Removed + # |not replaced in literal| + +or after a paragraph ending in two colons:: + + Literal block. + Common Indentation Removed + # |not replaced in literal| + +but not after a line ending in two colons:: +in the middle of a paragraph. .. |substitution| replace:: |nested substitution| diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt index 198ce04..b9c99e3 100644 --- a/Tests/CMakeLists.txt +++ b/Tests/CMakeLists.txt @@ -2526,11 +2526,10 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ ) endif() - add_test(CMakeWizardTest ${CMAKE_CMAKE_COMMAND} - -D build_dir:STRING=${CMAKE_CURRENT_BINARY_DIR}/CMakeWizardTest - -D source_dir:STRING=${CMAKE_CURRENT_SOURCE_DIR}/Tutorial/Step3 - -D CMAKE_CTEST_COMMAND:STRING=${CMAKE_CTEST_COMMAND} - -P ${CMAKE_CURRENT_SOURCE_DIR}/CMakeWizardTest.cmake) + add_test(NAME CMakeWizardTest COMMAND cmake -i) + set_property(TEST CMakeWizardTest PROPERTY PASS_REGULAR_EXPRESSION + "The \"cmake -i\" wizard mode is no longer supported.") + # If the cache variable CMAKE_CONTRACT_PROJECTS is set # then the dashboard will run a contract with CMake test of that # name. For example CMAKE_CONTRACT_PROJECTS = vtk542 would run diff --git a/Tests/CMakeWizardTest.cmake b/Tests/CMakeWizardTest.cmake deleted file mode 100644 index bcae8af..0000000 --- a/Tests/CMakeWizardTest.cmake +++ /dev/null @@ -1,52 +0,0 @@ -message("CTEST_FULL_OUTPUT (Avoid ctest truncation of output)") - -message(STATUS "build_dir='${build_dir}'") - -message(STATUS "source_dir='${source_dir}'") - - -execute_process(COMMAND ${CMAKE_COMMAND} -E - remove_directory ${build_dir} - TIMEOUT 5) - -execute_process(COMMAND ${CMAKE_COMMAND} -E - make_directory ${build_dir} - TIMEOUT 5) - -execute_process(COMMAND ${CMAKE_COMMAND} -E - copy_directory ${source_dir} ${build_dir}/src - TIMEOUT 5) - -execute_process(COMMAND ${CMAKE_COMMAND} -E - make_directory ${build_dir}/build - TIMEOUT 5) - -# This is enough to answer 32 questions with "the default answer is ok"... -# -file(WRITE ${build_dir}/input.txt - "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n") - - -message(STATUS "running wizard mode (cmake -i)...") - -execute_process(COMMAND ${CMAKE_COMMAND} -i ../src - INPUT_FILE ${build_dir}/input.txt - WORKING_DIRECTORY ${build_dir}/build - TIMEOUT 5 - ) - - -message(STATUS "building...") - -execute_process(COMMAND ${CMAKE_COMMAND} --build . - WORKING_DIRECTORY ${build_dir}/build - TIMEOUT 5 - ) - - -message(STATUS "testing...") - -execute_process(COMMAND ${CMAKE_CTEST_COMMAND} - WORKING_DIRECTORY ${build_dir}/build - TIMEOUT 5 - ) diff --git a/Tests/ExportImport/Export/Interface/CMakeLists.txt b/Tests/ExportImport/Export/Interface/CMakeLists.txt index fc9c0c7..b713262 100644 --- a/Tests/ExportImport/Export/Interface/CMakeLists.txt +++ b/Tests/ExportImport/Export/Interface/CMakeLists.txt @@ -24,7 +24,7 @@ add_library(sharediface INTERFACE) target_link_libraries(sharediface INTERFACE sharedlib) export(TARGETS sharediface sharedlib headeronly - NAMESPACE bld_ + NAMESPACE bld:: FILE ../ExportInterfaceBuildTree.cmake ) @@ -46,4 +46,4 @@ install(FILES DESTINATION include/sharedlib ) -install(EXPORT expInterface NAMESPACE exp_ DESTINATION lib/exp) +install(EXPORT expInterface NAMESPACE exp:: DESTINATION lib/exp) diff --git a/Tests/ExportImport/Import/Interface/CMakeLists.txt b/Tests/ExportImport/Import/Interface/CMakeLists.txt index c7bd13e..cf7e2bc 100644 --- a/Tests/ExportImport/Import/Interface/CMakeLists.txt +++ b/Tests/ExportImport/Import/Interface/CMakeLists.txt @@ -10,18 +10,18 @@ set_property(TARGET define_iface PROPERTY INTERFACE_COMPILE_DEFINITIONS DEFINE_IFACE_DEFINE) add_executable(headeronlytest_bld headeronlytest.cpp) -target_link_libraries(headeronlytest_bld bld_headeronly) +target_link_libraries(headeronlytest_bld bld::headeronly) -set_property(TARGET bld_sharediface APPEND PROPERTY INTERFACE_LINK_LIBRARIES define_iface) +set_property(TARGET bld::sharediface APPEND PROPERTY INTERFACE_LINK_LIBRARIES define_iface) add_executable(interfacetest_bld interfacetest.cpp) -target_link_libraries(interfacetest_bld bld_sharediface) +target_link_libraries(interfacetest_bld bld::sharediface) include(CheckCXXSourceCompiles) macro(do_try_compile prefix) - set(CMAKE_REQUIRED_LIBRARIES ${prefix}headeronly) + set(CMAKE_REQUIRED_LIBRARIES ${prefix}::headeronly) check_cxx_source_compiles( " #include \"headeronly.h\" @@ -42,14 +42,14 @@ macro(do_try_compile prefix) endif() endmacro() -do_try_compile(bld_) +do_try_compile(bld) add_executable(headeronlytest_exp headeronlytest.cpp) -target_link_libraries(headeronlytest_exp exp_headeronly) +target_link_libraries(headeronlytest_exp exp::headeronly) -set_property(TARGET exp_sharediface APPEND PROPERTY INTERFACE_LINK_LIBRARIES define_iface) +set_property(TARGET exp::sharediface APPEND PROPERTY INTERFACE_LINK_LIBRARIES define_iface) add_executable(interfacetest_exp interfacetest.cpp) -target_link_libraries(interfacetest_exp exp_sharediface) +target_link_libraries(interfacetest_exp exp::sharediface) -do_try_compile(exp_) +do_try_compile(exp) diff --git a/Tests/RunCMake/CMP0028/CMP0028-NEW-result.txt b/Tests/RunCMake/CMP0028/CMP0028-NEW-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/CMP0028/CMP0028-NEW-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/CMP0028/CMP0028-NEW-stderr.txt b/Tests/RunCMake/CMP0028/CMP0028-NEW-stderr.txt new file mode 100644 index 0000000..a7b0799 --- /dev/null +++ b/Tests/RunCMake/CMP0028/CMP0028-NEW-stderr.txt @@ -0,0 +1,6 @@ +CMake Error at CMP0028-NEW.cmake:4 \(add_library\): + Target "foo" links to target "External::Library" but the target was not + found. Perhaps a find_package\(\) call is missing for an IMPORTED target, or + a ALIAS target is missing\? +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/CMP0028/CMP0028-NEW.cmake b/Tests/RunCMake/CMP0028/CMP0028-NEW.cmake new file mode 100644 index 0000000..a0a6ae8 --- /dev/null +++ b/Tests/RunCMake/CMP0028/CMP0028-NEW.cmake @@ -0,0 +1,5 @@ + +cmake_policy(SET CMP0028 NEW) + +add_library(foo empty.cpp) +target_link_libraries(foo PRIVATE External::Library) diff --git a/Tests/RunCMake/CMP0028/CMP0028-OLD-result.txt b/Tests/RunCMake/CMP0028/CMP0028-OLD-result.txt new file mode 100644 index 0000000..573541a --- /dev/null +++ b/Tests/RunCMake/CMP0028/CMP0028-OLD-result.txt @@ -0,0 +1 @@ +0 diff --git a/Tests/RunCMake/CMP0028/CMP0028-OLD-stderr.txt b/Tests/RunCMake/CMP0028/CMP0028-OLD-stderr.txt new file mode 100644 index 0000000..10f3293 --- /dev/null +++ b/Tests/RunCMake/CMP0028/CMP0028-OLD-stderr.txt @@ -0,0 +1 @@ +^$ diff --git a/Tests/RunCMake/CMP0028/CMP0028-OLD.cmake b/Tests/RunCMake/CMP0028/CMP0028-OLD.cmake new file mode 100644 index 0000000..d4a870b --- /dev/null +++ b/Tests/RunCMake/CMP0028/CMP0028-OLD.cmake @@ -0,0 +1,5 @@ + +cmake_policy(SET CMP0028 OLD) + +add_library(foo empty.cpp) +target_link_libraries(foo PRIVATE External::Library) diff --git a/Tests/RunCMake/CMP0028/CMP0028-WARN-result.txt b/Tests/RunCMake/CMP0028/CMP0028-WARN-result.txt new file mode 100644 index 0000000..573541a --- /dev/null +++ b/Tests/RunCMake/CMP0028/CMP0028-WARN-result.txt @@ -0,0 +1 @@ +0 diff --git a/Tests/RunCMake/CMP0028/CMP0028-WARN-stderr.txt b/Tests/RunCMake/CMP0028/CMP0028-WARN-stderr.txt new file mode 100644 index 0000000..2ff6927 --- /dev/null +++ b/Tests/RunCMake/CMP0028/CMP0028-WARN-stderr.txt @@ -0,0 +1,11 @@ +CMake Warning \(dev\) at CMP0028-WARN.cmake:2 \(add_library\): + Policy CMP0028 is not set: Double colon in target name means ALIAS or + IMPORTED target. Run "cmake --help-policy CMP0028" for policy details. + Use the cmake_policy command to set the policy and suppress this warning. + + Target "foo" links to target "External::Library" but the target was not + found. Perhaps a find_package\(\) call is missing for an IMPORTED target, or + a ALIAS target is missing\? +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) +This warning is for project developers. Use -Wno-dev to suppress it. diff --git a/Tests/RunCMake/CMP0028/CMP0028-WARN.cmake b/Tests/RunCMake/CMP0028/CMP0028-WARN.cmake new file mode 100644 index 0000000..70a6cc6 --- /dev/null +++ b/Tests/RunCMake/CMP0028/CMP0028-WARN.cmake @@ -0,0 +1,3 @@ + +add_library(foo empty.cpp) +target_link_libraries(foo PRIVATE External::Library) diff --git a/Tests/RunCMake/CMP0028/CMakeLists.txt b/Tests/RunCMake/CMP0028/CMakeLists.txt new file mode 100644 index 0000000..f1d9cae --- /dev/null +++ b/Tests/RunCMake/CMP0028/CMakeLists.txt @@ -0,0 +1,3 @@ +cmake_minimum_required(VERSION 2.8.4) +project(${RunCMake_TEST} CXX) +include(${RunCMake_TEST}.cmake NO_POLICY_SCOPE) diff --git a/Tests/RunCMake/CMP0028/RunCMakeTest.cmake b/Tests/RunCMake/CMP0028/RunCMakeTest.cmake new file mode 100644 index 0000000..293e27b --- /dev/null +++ b/Tests/RunCMake/CMP0028/RunCMakeTest.cmake @@ -0,0 +1,5 @@ +include(RunCMake) + +run_cmake(CMP0028-NEW) +run_cmake(CMP0028-OLD) +run_cmake(CMP0028-WARN) diff --git a/Tests/RunCMake/CMP0028/empty.cpp b/Tests/RunCMake/CMP0028/empty.cpp new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/Tests/RunCMake/CMP0028/empty.cpp diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt index 52c8667..3a0ea91 100644 --- a/Tests/RunCMake/CMakeLists.txt +++ b/Tests/RunCMake/CMakeLists.txt @@ -55,6 +55,7 @@ add_RunCMake_test(CMP0019) add_RunCMake_test(CMP0022) add_RunCMake_test(CMP0026) add_RunCMake_test(CMP0027) +add_RunCMake_test(CMP0028) add_RunCMake_test(CTest) if(UNIX AND "${CMAKE_TEST_GENERATOR}" MATCHES "Unix Makefiles") add_RunCMake_test(CompilerChange) @@ -98,6 +99,7 @@ add_RunCMake_test(include) add_RunCMake_test(include_directories) add_RunCMake_test(list) add_RunCMake_test(message) +add_RunCMake_test(string) add_RunCMake_test(try_compile) add_RunCMake_test(variable_watch) add_RunCMake_test(CMP0004) diff --git a/Tests/RunCMake/string/CMakeLists.txt b/Tests/RunCMake/string/CMakeLists.txt new file mode 100644 index 0000000..12cd3c7 --- /dev/null +++ b/Tests/RunCMake/string/CMakeLists.txt @@ -0,0 +1,3 @@ +cmake_minimum_required(VERSION 2.8.4) +project(${RunCMake_TEST} NONE) +include(${RunCMake_TEST}.cmake) diff --git a/Tests/RunCMake/string/Concat.cmake b/Tests/RunCMake/string/Concat.cmake new file mode 100644 index 0000000..7260c95 --- /dev/null +++ b/Tests/RunCMake/string/Concat.cmake @@ -0,0 +1,19 @@ +set(b b) +set(out x) +string(CONCAT out) +if(NOT out STREQUAL "") + message(FATAL_ERROR "\"string(CONCAT out)\" set out to \"${out}\"") +endif() +string(CONCAT out a) +if(NOT out STREQUAL "a") + message(FATAL_ERROR "\"string(CONCAT out a)\" set out to \"${out}\"") +endif() +string(CONCAT out a "b") +if(NOT out STREQUAL "ab") + message(FATAL_ERROR "\"string(CONCAT out a \"b\")\" set out to \"${out}\"") +endif() +string(CONCAT out a "${b}" [[ +${c}]]) +if(NOT out STREQUAL "ab\${c}") + message(FATAL_ERROR "\"string(CONCAT out a \"\${b}\" [[\${c}]])\" set out to \"${out}\"") +endif() diff --git a/Tests/RunCMake/string/ConcatNoArgs-result.txt b/Tests/RunCMake/string/ConcatNoArgs-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/string/ConcatNoArgs-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/string/ConcatNoArgs-stderr.txt b/Tests/RunCMake/string/ConcatNoArgs-stderr.txt new file mode 100644 index 0000000..efea5f1 --- /dev/null +++ b/Tests/RunCMake/string/ConcatNoArgs-stderr.txt @@ -0,0 +1,4 @@ +CMake Error at ConcatNoArgs.cmake:1 \(string\): + string sub-command CONCAT requires at least one argument. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/string/ConcatNoArgs.cmake b/Tests/RunCMake/string/ConcatNoArgs.cmake new file mode 100644 index 0000000..ba21136 --- /dev/null +++ b/Tests/RunCMake/string/ConcatNoArgs.cmake @@ -0,0 +1 @@ +string(CONCAT) diff --git a/Tests/RunCMake/string/RunCMakeTest.cmake b/Tests/RunCMake/string/RunCMakeTest.cmake new file mode 100644 index 0000000..501acd2 --- /dev/null +++ b/Tests/RunCMake/string/RunCMakeTest.cmake @@ -0,0 +1,4 @@ +include(RunCMake) + +run_cmake(Concat) +run_cmake(ConcatNoArgs) @@ -224,7 +224,6 @@ CMAKE_CXX_SOURCES="\ cmStandardIncludes \ cmake \ cmakemain \ - cmakewizard \ cmcmd \ cmCommandArgumentLexer \ cmCommandArgumentParser \ |