From 091fbd69644e26043d1a7fe5c7a0b04d22066ca8 Mon Sep 17 00:00:00 2001 From: Brad King Date: Mon, 5 Oct 2015 10:16:03 -0400 Subject: [PATCH 001/486] Begin post-3.4 development --- Help/release/dev/0-sample-topic.rst | 7 +++++++ Help/release/index.rst | 2 ++ Source/CMakeVersion.cmake | 4 ++-- 3 files changed, 11 insertions(+), 2 deletions(-) create mode 100644 Help/release/dev/0-sample-topic.rst diff --git a/Help/release/dev/0-sample-topic.rst b/Help/release/dev/0-sample-topic.rst new file mode 100644 index 000000000..e4cc01e23 --- /dev/null +++ b/Help/release/dev/0-sample-topic.rst @@ -0,0 +1,7 @@ +0-sample-topic +-------------- + +* This is a sample release note for the change in a topic. + Developers should add similar notes for each topic branch + making a noteworthy change. Each document should be named + and titled to match the topic name to avoid merge conflicts. diff --git a/Help/release/index.rst b/Help/release/index.rst index 5d1a3f76a..752acbd30 100644 --- a/Help/release/index.rst +++ b/Help/release/index.rst @@ -5,6 +5,8 @@ CMake Release Notes This file should include the adjacent "dev.txt" file in development versions but not in release versions. +.. include:: dev.txt + Releases ======== diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index aaef21233..1fd599329 100644 --- a/Source/CMakeVersion.cmake +++ b/Source/CMakeVersion.cmake @@ -1,5 +1,5 @@ # CMake version number components. set(CMake_VERSION_MAJOR 3) set(CMake_VERSION_MINOR 4) -set(CMake_VERSION_PATCH 0) -set(CMake_VERSION_RC 1) +set(CMake_VERSION_PATCH 20151005) +#set(CMake_VERSION_RC 1) From 821e17785ecd4a329842dc6c5b093eb30cc4f160 Mon Sep 17 00:00:00 2001 From: Thijs Wenker Date: Thu, 1 Oct 2015 16:41:58 +0200 Subject: [PATCH 002/486] FindOpenSSL: Add support for static MSVC runtime Add an OPENSSL_MSVC_STATIC_RT option to switch from the default search for `/MD` libraries to look for `/MT` libraries instead. --- Help/release/dev/FindOpenSSL-msvc-static-rt.rst | 6 ++++++ Modules/FindOpenSSL.cmake | 17 ++++++++++++----- 2 files changed, 18 insertions(+), 5 deletions(-) create mode 100644 Help/release/dev/FindOpenSSL-msvc-static-rt.rst diff --git a/Help/release/dev/FindOpenSSL-msvc-static-rt.rst b/Help/release/dev/FindOpenSSL-msvc-static-rt.rst new file mode 100644 index 000000000..6e0ee276c --- /dev/null +++ b/Help/release/dev/FindOpenSSL-msvc-static-rt.rst @@ -0,0 +1,6 @@ +FindOpenSSL-msvc-static-rt +-------------------------- + +* The :module:`FindOpenSSL` module gained a new + ``OPENSSL_MSVC_STATIC_RT`` option to search for libraries using + the MSVC static runtime. diff --git a/Modules/FindOpenSSL.cmake b/Modules/FindOpenSSL.cmake index d75e8ab25..a0f4c524b 100644 --- a/Modules/FindOpenSSL.cmake +++ b/Modules/FindOpenSSL.cmake @@ -37,6 +37,7 @@ # # Set ``OPENSSL_ROOT_DIR`` to the root directory of an OpenSSL installation. # Set ``OPENSSL_USE_STATIC_LIBS`` to ``TRUE`` to look for static libraries. +# Set ``OPENSSL_MSVC_STATIC_RT`` set ``TRUE`` to choose the MT version of the lib. #============================================================================= # Copyright 2006-2009 Kitware, Inc. @@ -113,7 +114,7 @@ if(WIN32 AND NOT CYGWIN) # /MD and /MDd are the standard values - if someone wants to use # others, the libnames have to change here too # use also ssl and ssleay32 in debug as fallback for openssl < 0.9.8b - # TODO: handle /MT and static lib + # enable OPENSSL_MSVC_STATIC_RT to get the libs build /MT (Multithreaded no-DLL) # In Visual C++ naming convention each of these four kinds of Windows libraries has it's standard suffix: # * MD for dynamic-release # * MDd for dynamic-debug @@ -126,6 +127,12 @@ if(WIN32 AND NOT CYGWIN) # ssleay32MD.lib is identical to ../ssleay32.lib # enable OPENSSL_USE_STATIC_LIBS to use the static libs located in lib/VC/static + if (OPENSSL_MSVC_STATIC_RT) + set(_OPENSSL_MSVC_RT_MODE "MT") + else () + set(_OPENSSL_MSVC_RT_MODE "MD") + endif () + if(OPENSSL_USE_STATIC_LIBS) set(_OPENSSL_PATH_SUFFIXES "lib" @@ -142,7 +149,7 @@ if(WIN32 AND NOT CYGWIN) find_library(LIB_EAY_DEBUG NAMES - libeay32MDd + libeay32${_OPENSSL_MSVC_RT_MODE}d libeay32d ${_OPENSSL_ROOT_HINTS_AND_PATHS} PATH_SUFFIXES @@ -151,7 +158,7 @@ if(WIN32 AND NOT CYGWIN) find_library(LIB_EAY_RELEASE NAMES - libeay32MD + libeay32${_OPENSSL_MSVC_RT_MODE} libeay32 ${_OPENSSL_ROOT_HINTS_AND_PATHS} PATH_SUFFIXES @@ -160,7 +167,7 @@ if(WIN32 AND NOT CYGWIN) find_library(SSL_EAY_DEBUG NAMES - ssleay32MDd + ssleay32${_OPENSSL_MSVC_RT_MODE}d ssleay32d ${_OPENSSL_ROOT_HINTS_AND_PATHS} PATH_SUFFIXES @@ -169,7 +176,7 @@ if(WIN32 AND NOT CYGWIN) find_library(SSL_EAY_RELEASE NAMES - ssleay32MD + ssleay32${_OPENSSL_MSVC_RT_MODE} ssleay32 ssl ${_OPENSSL_ROOT_HINTS_AND_PATHS} From 48f8b6acf3a8083b5a52bbe1ec3adc10c515d710 Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Wed, 16 Sep 2015 01:07:03 +0200 Subject: [PATCH 003/486] cmExportFileGenerator: Evaluate genex with cmGeneratorTarget. --- Source/cmExportFileGenerator.cxx | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/Source/cmExportFileGenerator.cxx b/Source/cmExportFileGenerator.cxx index 9a7d73f4b..881aceee7 100644 --- a/Source/cmExportFileGenerator.cxx +++ b/Source/cmExportFileGenerator.cxx @@ -436,7 +436,9 @@ void cmExportFileGenerator::PopulateIncludeDirectoriesInterface( ImportPropertyMap &properties, std::vector &missingTargets) { - cmTarget *target = tei->Target; + cmGeneratorTarget *target = tei->Target->GetMakefile() + ->GetGlobalGenerator() + ->GetGeneratorTarget(tei->Target); assert(preprocessRule == cmGeneratorExpression::InstallInterface); const char *propName = "INTERFACE_INCLUDE_DIRECTORIES"; @@ -450,12 +452,12 @@ void cmExportFileGenerator::PopulateIncludeDirectoriesInterface( true); this->ReplaceInstallPrefix(dirs); cmsys::auto_ptr cge = ge.Parse(dirs); - std::string exportDirs = cge->Evaluate(target->GetMakefile(), "", - false, target); + std::string exportDirs = cge->Evaluate(target->Target->GetMakefile(), "", + false, target->Target); if (cge->GetHadContextSensitiveCondition()) { - cmMakefile* mf = target->GetMakefile(); + cmMakefile* mf = target->Target->GetMakefile(); std::ostringstream e; e << "Target \"" << target->GetName() << "\" is installed with " "INCLUDES DESTINATION set to a context sensitive path. Paths which " @@ -486,10 +488,10 @@ void cmExportFileGenerator::PopulateIncludeDirectoriesInterface( true); if (!prepro.empty()) { - this->ResolveTargetsInGeneratorExpressions(prepro, target, + this->ResolveTargetsInGeneratorExpressions(prepro, target->Target, missingTargets); - if (!checkInterfaceDirs(prepro, target, propName)) + if (!checkInterfaceDirs(prepro, target->Target, propName)) { return; } From d945b36a93ab9f935c4e369d5c75be8b47d48f7a Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Wed, 16 Sep 2015 01:08:49 +0200 Subject: [PATCH 004/486] cmExportTryCompileFileGenerator: Evaluate genex with cmGeneratorTarget. --- Source/cmExportTryCompileFileGenerator.cxx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Source/cmExportTryCompileFileGenerator.cxx b/Source/cmExportTryCompileFileGenerator.cxx index ba66531fd..026584c84 100644 --- a/Source/cmExportTryCompileFileGenerator.cxx +++ b/Source/cmExportTryCompileFileGenerator.cxx @@ -76,8 +76,12 @@ std::string cmExportTryCompileFileGenerator::FindTargets( dummyHead.SetType(cmTarget::EXECUTABLE, "try_compile_dummy_exe"); dummyHead.SetMakefile(tgt->GetMakefile()); - std::string result = cge->Evaluate(tgt->GetMakefile(), this->Config, - false, &dummyHead, tgt, &dagChecker); + cmGeneratorTarget* gtgt = + tgt->GetMakefile()->GetGlobalGenerator()->GetGeneratorTarget(tgt); + + std::string result = cge->Evaluate(gtgt->Target->GetMakefile(), this->Config, + false, &dummyHead, + gtgt->Target, &dagChecker); const std::set &allTargets = cge->GetAllTargetsSeen(); for(std::set::const_iterator li = allTargets.begin(); From a09c545d3a518d771b66b59f92821af3d55d7d4b Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Tue, 15 Sep 2015 20:36:02 +0200 Subject: [PATCH 005/486] Xcode: Extract a AddExtraIDETargets method. --- Source/cmGlobalXCodeGenerator.cxx | 6 +++++- Source/cmGlobalXCodeGenerator.h | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx index 33babecd9..e209b64a4 100644 --- a/Source/cmGlobalXCodeGenerator.cxx +++ b/Source/cmGlobalXCodeGenerator.cxx @@ -383,7 +383,12 @@ bool cmGlobalXCodeGenerator::Compute() { return false; } + this->AddExtraIDETargets(); + return true; +} +void cmGlobalXCodeGenerator::AddExtraIDETargets() +{ std::map >::iterator it; // make sure extra targets are added before calling // the parent generate which will call trace depends @@ -394,7 +399,6 @@ bool cmGlobalXCodeGenerator::Compute() // add ALL_BUILD, INSTALL, etc this->AddExtraTargets(root, it->second); } - return true; } void cmGlobalXCodeGenerator::Generate() diff --git a/Source/cmGlobalXCodeGenerator.h b/Source/cmGlobalXCodeGenerator.h index 102c0366a..413a7bc2f 100644 --- a/Source/cmGlobalXCodeGenerator.h +++ b/Source/cmGlobalXCodeGenerator.h @@ -88,6 +88,7 @@ public: void AppendFlag(std::string& flags, std::string const& flag); protected: virtual bool Compute(); + void AddExtraIDETargets(); virtual void Generate(); private: cmXCodeObject* CreateOrGetPBXGroup(cmTarget& cmtarget, From 4407eee01365d89d370d8e8b89f3ec0a65420046 Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Tue, 15 Sep 2015 20:37:57 +0200 Subject: [PATCH 006/486] cmGlobalGenerator: Call AddExtraIDETargets as a hook of Compute(). Relieve the Xcode generator of having to reimplement Compute(). --- Source/cmGlobalGenerator.cxx | 2 ++ Source/cmGlobalGenerator.h | 1 + Source/cmGlobalXCodeGenerator.cxx | 11 ----------- Source/cmGlobalXCodeGenerator.h | 3 +-- 4 files changed, 4 insertions(+), 13 deletions(-) diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx index 4a48b5d0b..27f860e04 100644 --- a/Source/cmGlobalGenerator.cxx +++ b/Source/cmGlobalGenerator.cxx @@ -1282,6 +1282,8 @@ bool cmGlobalGenerator::Compute() } } + this->AddExtraIDETargets(); + return true; } diff --git a/Source/cmGlobalGenerator.h b/Source/cmGlobalGenerator.h index ba74c9e65..e73aac26b 100644 --- a/Source/cmGlobalGenerator.h +++ b/Source/cmGlobalGenerator.h @@ -84,6 +84,7 @@ public: virtual void Configure(); virtual bool Compute(); + virtual void AddExtraIDETargets() {} enum TargetTypes { AllTargets, diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx index e209b64a4..746e1a73c 100644 --- a/Source/cmGlobalXCodeGenerator.cxx +++ b/Source/cmGlobalXCodeGenerator.cxx @@ -376,17 +376,6 @@ cmGlobalXCodeGenerator::CreateLocalGenerator(cmMakefile* mf) return new cmLocalXCodeGenerator(this, mf); } -//---------------------------------------------------------------------------- -bool cmGlobalXCodeGenerator::Compute() -{ - if (!cmGlobalGenerator::Compute()) - { - return false; - } - this->AddExtraIDETargets(); - return true; -} - void cmGlobalXCodeGenerator::AddExtraIDETargets() { std::map >::iterator it; diff --git a/Source/cmGlobalXCodeGenerator.h b/Source/cmGlobalXCodeGenerator.h index 413a7bc2f..9daf0abd6 100644 --- a/Source/cmGlobalXCodeGenerator.h +++ b/Source/cmGlobalXCodeGenerator.h @@ -87,8 +87,7 @@ public: virtual bool SetGeneratorToolset(std::string const& ts, cmMakefile* mf); void AppendFlag(std::string& flags, std::string const& flag); protected: - virtual bool Compute(); - void AddExtraIDETargets(); + virtual void AddExtraIDETargets(); virtual void Generate(); private: cmXCodeObject* CreateOrGetPBXGroup(cmTarget& cmtarget, From a9588e90bbddbfe71b1d33d63d38eedaf397023f Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Tue, 15 Sep 2015 20:48:41 +0200 Subject: [PATCH 007/486] VisualStudio10: Initialize the LongestSource at generate time. There is no need to initialize it at compute time. --- Source/cmGlobalVisualStudio10Generator.cxx | 12 +----------- Source/cmGlobalVisualStudio10Generator.h | 2 -- 2 files changed, 1 insertion(+), 13 deletions(-) diff --git a/Source/cmGlobalVisualStudio10Generator.cxx b/Source/cmGlobalVisualStudio10Generator.cxx index 59e8f8c7d..161b53247 100644 --- a/Source/cmGlobalVisualStudio10Generator.cxx +++ b/Source/cmGlobalVisualStudio10Generator.cxx @@ -325,19 +325,9 @@ cmLocalGenerator* cmGlobalVisualStudio10Generator::CreateLocalGenerator( return new cmLocalVisualStudio10Generator(this, mf); } -//---------------------------------------------------------------------------- -bool cmGlobalVisualStudio10Generator::Compute() -{ - if (!cmGlobalVisualStudio8Generator::Compute()) - { - return false; - } - this->LongestSource = LongestSourcePath(); - return true; -} - void cmGlobalVisualStudio10Generator::Generate() { + this->LongestSource = LongestSourcePath(); this->cmGlobalVisualStudio8Generator::Generate(); if(this->LongestSource.Length > 0) { diff --git a/Source/cmGlobalVisualStudio10Generator.h b/Source/cmGlobalVisualStudio10Generator.h index f4861dc6d..7600a0de6 100644 --- a/Source/cmGlobalVisualStudio10Generator.h +++ b/Source/cmGlobalVisualStudio10Generator.h @@ -45,8 +45,6 @@ public: std::vector const& makeOptions = std::vector() ); - virtual bool Compute(); - ///! create the correct local generator virtual cmLocalGenerator *CreateLocalGenerator(cmMakefile* mf); From 21f428f4c0adf7045e852be30739cd1243aa96fe Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Tue, 15 Sep 2015 20:47:35 +0200 Subject: [PATCH 008/486] VisualStudio: Replace Compute override with AddExtraIDETargets override. --- Source/cmGlobalVisualStudio8Generator.cxx | 9 ++------- Source/cmGlobalVisualStudio8Generator.h | 2 +- Source/cmGlobalVisualStudioGenerator.cxx | 8 +------- Source/cmGlobalVisualStudioGenerator.h | 2 +- 4 files changed, 5 insertions(+), 16 deletions(-) diff --git a/Source/cmGlobalVisualStudio8Generator.cxx b/Source/cmGlobalVisualStudio8Generator.cxx index 70c00e96e..86a8f8799 100644 --- a/Source/cmGlobalVisualStudio8Generator.cxx +++ b/Source/cmGlobalVisualStudio8Generator.cxx @@ -348,13 +348,9 @@ bool cmGlobalVisualStudio8Generator::AddCheckTarget() } //---------------------------------------------------------------------------- -bool cmGlobalVisualStudio8Generator::Compute() +void cmGlobalVisualStudio8Generator::AddExtraIDETargets() { - if (!cmGlobalVisualStudio7Generator::Compute()) - { - return false; - } - + cmGlobalVisualStudio7Generator::AddExtraIDETargets(); if(this->AddCheckTarget()) { // All targets depend on the build-system check target. @@ -368,7 +364,6 @@ bool cmGlobalVisualStudio8Generator::Compute() } } } - return true; } //---------------------------------------------------------------------------- diff --git a/Source/cmGlobalVisualStudio8Generator.h b/Source/cmGlobalVisualStudio8Generator.h index 1c6110386..9d6c64fe4 100644 --- a/Source/cmGlobalVisualStudio8Generator.h +++ b/Source/cmGlobalVisualStudio8Generator.h @@ -67,7 +67,7 @@ public: return !this->WindowsCEVersion.empty(); } protected: - virtual bool Compute(); + virtual void AddExtraIDETargets(); virtual const char* GetIDEVersion() { return "8.0"; } virtual std::string FindDevEnvCommand(); diff --git a/Source/cmGlobalVisualStudioGenerator.cxx b/Source/cmGlobalVisualStudioGenerator.cxx index 7552d67d2..d45aa2780 100644 --- a/Source/cmGlobalVisualStudioGenerator.cxx +++ b/Source/cmGlobalVisualStudioGenerator.cxx @@ -64,13 +64,8 @@ std::string cmGlobalVisualStudioGenerator::GetRegistryBase( } //---------------------------------------------------------------------------- -bool cmGlobalVisualStudioGenerator::Compute() +void cmGlobalVisualStudioGenerator::AddExtraIDETargets() { - if (!cmGlobalGenerator::Compute()) - { - return false; - } - // Add a special target that depends on ALL projects for easy build // of one configuration only. const char* no_working_dir = 0; @@ -144,7 +139,6 @@ bool cmGlobalVisualStudioGenerator::Compute() static_cast(*lgi); lg->AddCMakeListsRules(); } - return true; } //---------------------------------------------------------------------------- diff --git a/Source/cmGlobalVisualStudioGenerator.h b/Source/cmGlobalVisualStudioGenerator.h index c940eb354..41d0b8823 100644 --- a/Source/cmGlobalVisualStudioGenerator.h +++ b/Source/cmGlobalVisualStudioGenerator.h @@ -111,7 +111,7 @@ public: cmGeneratorTarget*, std::vector& commands, std::string const& configName); protected: - virtual bool Compute(); + virtual void AddExtraIDETargets(); // Does this VS version link targets to each other if there are // dependencies in the SLN file? This was done for VS versions From 2eca0559881c36061f84ea4fcd955ac32d9d427a Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Tue, 15 Sep 2015 20:50:11 +0200 Subject: [PATCH 009/486] cmGlobalGenerator: De-virtualize Compute(). It now implements the NVI pattern. --- Source/cmGlobalGenerator.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/cmGlobalGenerator.h b/Source/cmGlobalGenerator.h index e73aac26b..f233f1d96 100644 --- a/Source/cmGlobalGenerator.h +++ b/Source/cmGlobalGenerator.h @@ -83,7 +83,7 @@ public: */ virtual void Configure(); - virtual bool Compute(); + bool Compute(); virtual void AddExtraIDETargets() {} enum TargetTypes { From 9eea0486bfe5dfd497e6a8fca9e3c2551169c24e Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Sat, 29 Aug 2015 09:21:32 +0200 Subject: [PATCH 010/486] cmGlobalGenerator: Do more computation at compute time. --- Source/cmGlobalGenerator.cxx | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx index 27f860e04..cae546639 100644 --- a/Source/cmGlobalGenerator.cxx +++ b/Source/cmGlobalGenerator.cxx @@ -1284,13 +1284,6 @@ bool cmGlobalGenerator::Compute() this->AddExtraIDETargets(); - return true; -} - -void cmGlobalGenerator::Generate() -{ - unsigned int i; - // Trace the dependencies, after that no custom commands should be added // because their dependencies might not be handled correctly for (i = 0; i < this->LocalGenerators.size(); ++i) @@ -1309,9 +1302,16 @@ void cmGlobalGenerator::Generate() // Compute the inter-target dependencies. if(!this->ComputeTargetDepends()) { - return; + return false; } + return true; +} + +void cmGlobalGenerator::Generate() +{ + unsigned int i; + // Create a map from local generator to the complete set of targets // it builds by default. this->InitializeProgressMarks(); From 616f03114eb41218dc3278e72b52d8de09e40365 Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Sat, 29 Aug 2015 09:22:09 +0200 Subject: [PATCH 011/486] cmGlobalGenerator: Move path computation to Compute. --- Source/cmGlobalGenerator.cxx | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx index cae546639..3d073cae7 100644 --- a/Source/cmGlobalGenerator.cxx +++ b/Source/cmGlobalGenerator.cxx @@ -1305,26 +1305,24 @@ bool cmGlobalGenerator::Compute() return false; } + for (i = 0; i < this->LocalGenerators.size(); ++i) + { + this->LocalGenerators[i]->ComputeHomeRelativeOutputPath(); + } + return true; } void cmGlobalGenerator::Generate() { - unsigned int i; - // Create a map from local generator to the complete set of targets // it builds by default. this->InitializeProgressMarks(); this->ProcessEvaluationFiles(); - for (i = 0; i < this->LocalGenerators.size(); ++i) - { - this->LocalGenerators[i]->ComputeHomeRelativeOutputPath(); - } - // Generate project files - for (i = 0; i < this->LocalGenerators.size(); ++i) + for (unsigned int i = 0; i < this->LocalGenerators.size(); ++i) { this->SetCurrentMakefile(this->LocalGenerators[i]->GetMakefile()); this->LocalGenerators[i]->Generate(); From 493b17f8c7fb171fd7ca36cc0b29257939609298 Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Mon, 5 Oct 2015 18:45:21 +0200 Subject: [PATCH 012/486] QtAutogen: Move SetupSourceFiles method. --- Source/cmQtAutoGeneratorInitializer.cxx | 166 ++++++++++++------------ 1 file changed, 83 insertions(+), 83 deletions(-) diff --git a/Source/cmQtAutoGeneratorInitializer.cxx b/Source/cmQtAutoGeneratorInitializer.cxx index 24e7ed8db..216c5b4bf 100644 --- a/Source/cmQtAutoGeneratorInitializer.cxx +++ b/Source/cmQtAutoGeneratorInitializer.cxx @@ -25,6 +25,89 @@ # include "cmGlobalVisualStudioGenerator.h" #endif +void cmQtAutoGeneratorInitializer::SetupSourceFiles(cmTarget const* target, + std::vector& skipMoc, + std::vector& mocSources, + std::vector& mocHeaders, + std::vector& skipUic) +{ + cmMakefile* makefile = target->GetMakefile(); + + std::vector srcFiles; + cmGeneratorTarget *gtgt = target->GetMakefile() + ->GetGlobalGenerator() + ->GetGeneratorTarget(target); + gtgt->GetConfigCommonSourceFiles(srcFiles); + + std::vector newRccFiles; + + for(std::vector::const_iterator fileIt = srcFiles.begin(); + fileIt != srcFiles.end(); + ++fileIt) + { + cmSourceFile* sf = *fileIt; + std::string absFile = cmsys::SystemTools::GetRealPath( + sf->GetFullPath()); + bool skipFileForMoc = + cmSystemTools::IsOn(sf->GetPropertyForUser("SKIP_AUTOMOC")); + bool generated = cmSystemTools::IsOn(sf->GetPropertyForUser("GENERATED")); + + if(cmSystemTools::IsOn(sf->GetPropertyForUser("SKIP_AUTOUIC"))) + { + skipUic.push_back(absFile); + } + + std::string ext = sf->GetExtension(); + + if (target->GetPropertyAsBool("AUTORCC")) + { + if (ext == "qrc" + && !cmSystemTools::IsOn(sf->GetPropertyForUser("SKIP_AUTORCC"))) + { + std::string basename = cmsys::SystemTools:: + GetFilenameWithoutLastExtension(absFile); + + std::string rcc_output_dir = target->GetSupportDirectory(); + cmSystemTools::MakeDirectory(rcc_output_dir.c_str()); + std::string rcc_output_file = rcc_output_dir; + rcc_output_file += "/qrc_" + basename + ".cpp"; + makefile->AppendProperty("ADDITIONAL_MAKE_CLEAN_FILES", + rcc_output_file.c_str(), false); + makefile->GetOrCreateSource(rcc_output_file, true); + newRccFiles.push_back(rcc_output_file); + } + } + + if (!generated) + { + if (skipFileForMoc) + { + skipMoc.push_back(absFile); + } + else + { + cmSystemTools::FileFormat fileType = cmSystemTools::GetFileFormat( + ext.c_str()); + if (fileType == cmSystemTools::CXX_FILE_FORMAT) + { + mocSources.push_back(absFile); + } + else if (fileType == cmSystemTools::HEADER_FILE_FORMAT) + { + mocHeaders.push_back(absFile); + } + } + } + } + + for(std::vector::const_iterator fileIt = newRccFiles.begin(); + fileIt != newRccFiles.end(); + ++fileIt) + { + const_cast(target)->AddSource(*fileIt); + } +} + std::string cmQtAutoGeneratorInitializer::GetAutogenTargetName( cmTarget const* target) { @@ -568,89 +651,6 @@ void cmQtAutoGeneratorInitializer::SetupAutoGenerateTarget( } } -void cmQtAutoGeneratorInitializer::SetupSourceFiles(cmTarget const* target, - std::vector& skipMoc, - std::vector& mocSources, - std::vector& mocHeaders, - std::vector& skipUic) -{ - cmMakefile* makefile = target->GetMakefile(); - - std::vector srcFiles; - cmGeneratorTarget *gtgt = target->GetMakefile() - ->GetGlobalGenerator() - ->GetGeneratorTarget(target); - gtgt->GetConfigCommonSourceFiles(srcFiles); - - std::vector newRccFiles; - - for(std::vector::const_iterator fileIt = srcFiles.begin(); - fileIt != srcFiles.end(); - ++fileIt) - { - cmSourceFile* sf = *fileIt; - std::string absFile = cmsys::SystemTools::GetRealPath( - sf->GetFullPath()); - bool skipFileForMoc = - cmSystemTools::IsOn(sf->GetPropertyForUser("SKIP_AUTOMOC")); - bool generated = cmSystemTools::IsOn(sf->GetPropertyForUser("GENERATED")); - - if(cmSystemTools::IsOn(sf->GetPropertyForUser("SKIP_AUTOUIC"))) - { - skipUic.push_back(absFile); - } - - std::string ext = sf->GetExtension(); - - if (target->GetPropertyAsBool("AUTORCC")) - { - if (ext == "qrc" - && !cmSystemTools::IsOn(sf->GetPropertyForUser("SKIP_AUTORCC"))) - { - std::string basename = cmsys::SystemTools:: - GetFilenameWithoutLastExtension(absFile); - - std::string rcc_output_dir = target->GetSupportDirectory(); - cmSystemTools::MakeDirectory(rcc_output_dir.c_str()); - std::string rcc_output_file = rcc_output_dir; - rcc_output_file += "/qrc_" + basename + ".cpp"; - makefile->AppendProperty("ADDITIONAL_MAKE_CLEAN_FILES", - rcc_output_file.c_str(), false); - makefile->GetOrCreateSource(rcc_output_file, true); - newRccFiles.push_back(rcc_output_file); - } - } - - if (!generated) - { - if (skipFileForMoc) - { - skipMoc.push_back(absFile); - } - else - { - cmSystemTools::FileFormat fileType = cmSystemTools::GetFileFormat( - ext.c_str()); - if (fileType == cmSystemTools::CXX_FILE_FORMAT) - { - mocSources.push_back(absFile); - } - else if (fileType == cmSystemTools::HEADER_FILE_FORMAT) - { - mocHeaders.push_back(absFile); - } - } - } - } - - for(std::vector::const_iterator fileIt = newRccFiles.begin(); - fileIt != newRccFiles.end(); - ++fileIt) - { - const_cast(target)->AddSource(*fileIt); - } -} - void cmQtAutoGeneratorInitializer::SetupAutoMocTarget(cmTarget const* target, const std::string &autogenTargetName, std::vector const& skipMoc, From f3158e45b8fde882603e1d9b2262a5c64e25c1ee Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Mon, 5 Oct 2015 18:46:11 +0200 Subject: [PATCH 013/486] QtAutogen: Move GetCompileDefinitionsAndDirectories method. --- Source/cmQtAutoGeneratorInitializer.cxx | 44 ++++++++++++------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/Source/cmQtAutoGeneratorInitializer.cxx b/Source/cmQtAutoGeneratorInitializer.cxx index 216c5b4bf..76006fad0 100644 --- a/Source/cmQtAutoGeneratorInitializer.cxx +++ b/Source/cmQtAutoGeneratorInitializer.cxx @@ -108,6 +108,28 @@ void cmQtAutoGeneratorInitializer::SetupSourceFiles(cmTarget const* target, } } +static void GetCompileDefinitionsAndDirectories(cmTarget const* target, + const std::string& config, + std::string &incs, + std::string &defs) +{ + cmMakefile* makefile = target->GetMakefile(); + cmGlobalGenerator* globalGen = makefile->GetGlobalGenerator(); + std::vector includeDirs; + cmGeneratorTarget *gtgt = globalGen->GetGeneratorTarget(target); + cmLocalGenerator *localGen = gtgt->GetLocalGenerator(); + // Get the include dirs for this target, without stripping the implicit + // include dirs off, see http://public.kitware.com/Bug/view.php?id=13667 + localGen->GetIncludeDirectories(includeDirs, gtgt, "CXX", config, false); + + incs = cmJoin(includeDirs, ";"); + + std::set defines; + localGen->AddCompileDefinitions(defines, target, config, "CXX"); + + defs += cmJoin(defines, ";"); +} + std::string cmQtAutoGeneratorInitializer::GetAutogenTargetName( cmTarget const* target) { @@ -489,28 +511,6 @@ void cmQtAutoGeneratorInitializer::InitializeAutogenTarget( } } -static void GetCompileDefinitionsAndDirectories(cmTarget const* target, - const std::string& config, - std::string &incs, - std::string &defs) -{ - cmMakefile* makefile = target->GetMakefile(); - cmGlobalGenerator* globalGen = makefile->GetGlobalGenerator(); - std::vector includeDirs; - cmGeneratorTarget *gtgt = globalGen->GetGeneratorTarget(target); - cmLocalGenerator *localGen = gtgt->GetLocalGenerator(); - // Get the include dirs for this target, without stripping the implicit - // include dirs off, see http://public.kitware.com/Bug/view.php?id=13667 - localGen->GetIncludeDirectories(includeDirs, gtgt, "CXX", config, false); - - incs = cmJoin(includeDirs, ";"); - - std::set defines; - localGen->AddCompileDefinitions(defines, target, config, "CXX"); - - defs += cmJoin(defines, ";"); -} - void cmQtAutoGeneratorInitializer::SetupAutoGenerateTarget( cmTarget const* target) { From f75ec6044c593d0ff042e13b940d2c674910b683 Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Mon, 5 Oct 2015 18:46:58 +0200 Subject: [PATCH 014/486] QtAutogen: Move SetupAutoMocTarget method. --- Source/cmQtAutoGeneratorInitializer.cxx | 184 ++++++++++++------------ 1 file changed, 92 insertions(+), 92 deletions(-) diff --git a/Source/cmQtAutoGeneratorInitializer.cxx b/Source/cmQtAutoGeneratorInitializer.cxx index 76006fad0..b9bd27579 100644 --- a/Source/cmQtAutoGeneratorInitializer.cxx +++ b/Source/cmQtAutoGeneratorInitializer.cxx @@ -130,6 +130,98 @@ static void GetCompileDefinitionsAndDirectories(cmTarget const* target, defs += cmJoin(defines, ";"); } +void cmQtAutoGeneratorInitializer::SetupAutoMocTarget(cmTarget const* target, + const std::string &autogenTargetName, + std::vector const& skipMoc, + std::vector const& mocHeaders, + std::map &configIncludes, + std::map &configDefines) +{ + cmMakefile* makefile = target->GetMakefile(); + + const char* tmp = target->GetProperty("AUTOMOC_MOC_OPTIONS"); + std::string _moc_options = (tmp!=0 ? tmp : ""); + makefile->AddDefinition("_moc_options", + cmOutputConverter::EscapeForCMake(_moc_options).c_str()); + makefile->AddDefinition("_skip_moc", + cmOutputConverter::EscapeForCMake(cmJoin(skipMoc, ";")).c_str()); + makefile->AddDefinition("_moc_headers", + cmOutputConverter::EscapeForCMake(cmJoin(mocHeaders, ";")).c_str()); + bool relaxedMode = makefile->IsOn("CMAKE_AUTOMOC_RELAXED_MODE"); + makefile->AddDefinition("_moc_relaxed_mode", relaxedMode ? "TRUE" : "FALSE"); + + std::string _moc_incs; + std::string _moc_compile_defs; + std::vector configs; + const std::string& config = makefile->GetConfigurations(configs); + GetCompileDefinitionsAndDirectories(target, config, + _moc_incs, _moc_compile_defs); + + makefile->AddDefinition("_moc_incs", + cmOutputConverter::EscapeForCMake(_moc_incs).c_str()); + makefile->AddDefinition("_moc_compile_defs", + cmOutputConverter::EscapeForCMake(_moc_compile_defs).c_str()); + + for (std::vector::const_iterator li = configs.begin(); + li != configs.end(); ++li) + { + std::string config_moc_incs; + std::string config_moc_compile_defs; + GetCompileDefinitionsAndDirectories(target, *li, + config_moc_incs, + config_moc_compile_defs); + if (config_moc_incs != _moc_incs) + { + configIncludes[*li] = + cmOutputConverter::EscapeForCMake(config_moc_incs); + if(_moc_incs.empty()) + { + _moc_incs = config_moc_incs; + } + } + if (config_moc_compile_defs != _moc_compile_defs) + { + configDefines[*li] = + cmOutputConverter::EscapeForCMake(config_moc_compile_defs); + if(_moc_compile_defs.empty()) + { + _moc_compile_defs = config_moc_compile_defs; + } + } + } + + const char *qtVersion = makefile->GetDefinition("_target_qt_version"); + if (strcmp(qtVersion, "5") == 0) + { + cmTarget *qt5Moc = makefile->FindTargetToUse("Qt5::moc"); + if (!qt5Moc) + { + cmSystemTools::Error("Qt5::moc target not found ", + autogenTargetName.c_str()); + return; + } + makefile->AddDefinition("_qt_moc_executable", + qt5Moc->ImportedGetLocation("")); + } + else if (strcmp(qtVersion, "4") == 0) + { + cmTarget *qt4Moc = makefile->FindTargetToUse("Qt4::moc"); + if (!qt4Moc) + { + cmSystemTools::Error("Qt4::moc target not found ", + autogenTargetName.c_str()); + return; + } + makefile->AddDefinition("_qt_moc_executable", + qt4Moc->ImportedGetLocation("")); + } + else + { + cmSystemTools::Error("The CMAKE_AUTOMOC feature supports only Qt 4 and " + "Qt 5 ", autogenTargetName.c_str()); + } +} + std::string cmQtAutoGeneratorInitializer::GetAutogenTargetName( cmTarget const* target) { @@ -651,98 +743,6 @@ void cmQtAutoGeneratorInitializer::SetupAutoGenerateTarget( } } -void cmQtAutoGeneratorInitializer::SetupAutoMocTarget(cmTarget const* target, - const std::string &autogenTargetName, - std::vector const& skipMoc, - std::vector const& mocHeaders, - std::map &configIncludes, - std::map &configDefines) -{ - cmMakefile* makefile = target->GetMakefile(); - - const char* tmp = target->GetProperty("AUTOMOC_MOC_OPTIONS"); - std::string _moc_options = (tmp!=0 ? tmp : ""); - makefile->AddDefinition("_moc_options", - cmOutputConverter::EscapeForCMake(_moc_options).c_str()); - makefile->AddDefinition("_skip_moc", - cmOutputConverter::EscapeForCMake(cmJoin(skipMoc, ";")).c_str()); - makefile->AddDefinition("_moc_headers", - cmOutputConverter::EscapeForCMake(cmJoin(mocHeaders, ";")).c_str()); - bool relaxedMode = makefile->IsOn("CMAKE_AUTOMOC_RELAXED_MODE"); - makefile->AddDefinition("_moc_relaxed_mode", relaxedMode ? "TRUE" : "FALSE"); - - std::string _moc_incs; - std::string _moc_compile_defs; - std::vector configs; - const std::string& config = makefile->GetConfigurations(configs); - GetCompileDefinitionsAndDirectories(target, config, - _moc_incs, _moc_compile_defs); - - makefile->AddDefinition("_moc_incs", - cmOutputConverter::EscapeForCMake(_moc_incs).c_str()); - makefile->AddDefinition("_moc_compile_defs", - cmOutputConverter::EscapeForCMake(_moc_compile_defs).c_str()); - - for (std::vector::const_iterator li = configs.begin(); - li != configs.end(); ++li) - { - std::string config_moc_incs; - std::string config_moc_compile_defs; - GetCompileDefinitionsAndDirectories(target, *li, - config_moc_incs, - config_moc_compile_defs); - if (config_moc_incs != _moc_incs) - { - configIncludes[*li] = - cmOutputConverter::EscapeForCMake(config_moc_incs); - if(_moc_incs.empty()) - { - _moc_incs = config_moc_incs; - } - } - if (config_moc_compile_defs != _moc_compile_defs) - { - configDefines[*li] = - cmOutputConverter::EscapeForCMake(config_moc_compile_defs); - if(_moc_compile_defs.empty()) - { - _moc_compile_defs = config_moc_compile_defs; - } - } - } - - const char *qtVersion = makefile->GetDefinition("_target_qt_version"); - if (strcmp(qtVersion, "5") == 0) - { - cmTarget *qt5Moc = makefile->FindTargetToUse("Qt5::moc"); - if (!qt5Moc) - { - cmSystemTools::Error("Qt5::moc target not found ", - autogenTargetName.c_str()); - return; - } - makefile->AddDefinition("_qt_moc_executable", - qt5Moc->ImportedGetLocation("")); - } - else if (strcmp(qtVersion, "4") == 0) - { - cmTarget *qt4Moc = makefile->FindTargetToUse("Qt4::moc"); - if (!qt4Moc) - { - cmSystemTools::Error("Qt4::moc target not found ", - autogenTargetName.c_str()); - return; - } - makefile->AddDefinition("_qt_moc_executable", - qt4Moc->ImportedGetLocation("")); - } - else - { - cmSystemTools::Error("The CMAKE_AUTOMOC feature supports only Qt 4 and " - "Qt 5 ", autogenTargetName.c_str()); - } -} - static void GetUicOpts(cmTarget const* target, const std::string& config, std::string &optString) { From 975b753997849507684da7d529d1bbe0ffd3ade9 Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Mon, 5 Oct 2015 18:47:49 +0200 Subject: [PATCH 015/486] QtAutogen: Move GetUicOpts method. --- Source/cmQtAutoGeneratorInitializer.cxx | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/Source/cmQtAutoGeneratorInitializer.cxx b/Source/cmQtAutoGeneratorInitializer.cxx index b9bd27579..ef2f2a56b 100644 --- a/Source/cmQtAutoGeneratorInitializer.cxx +++ b/Source/cmQtAutoGeneratorInitializer.cxx @@ -222,6 +222,17 @@ void cmQtAutoGeneratorInitializer::SetupAutoMocTarget(cmTarget const* target, } } +static void GetUicOpts(cmTarget const* target, const std::string& config, + std::string &optString) +{ + cmGeneratorTarget *gtgt = target->GetMakefile() + ->GetGlobalGenerator() + ->GetGeneratorTarget(target); + std::vector opts; + gtgt->GetAutoUicOptions(opts, config); + optString = cmJoin(opts, ";"); +} + std::string cmQtAutoGeneratorInitializer::GetAutogenTargetName( cmTarget const* target) { @@ -743,17 +754,6 @@ void cmQtAutoGeneratorInitializer::SetupAutoGenerateTarget( } } -static void GetUicOpts(cmTarget const* target, const std::string& config, - std::string &optString) -{ - cmGeneratorTarget *gtgt = target->GetMakefile() - ->GetGlobalGenerator() - ->GetGeneratorTarget(target); - std::vector opts; - gtgt->GetAutoUicOptions(opts, config); - optString = cmJoin(opts, ";"); -} - void cmQtAutoGeneratorInitializer::SetupAutoUicTarget(cmTarget const* target, std::vector const& skipUic, std::map &configUicOptions) From 7254f6452596f438f0607ece559be7ad556b190a Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Mon, 5 Oct 2015 18:48:41 +0200 Subject: [PATCH 016/486] QtAutogen: Move SetupAutoUicTarget method. --- Source/cmQtAutoGeneratorInitializer.cxx | 214 ++++++++++++------------ 1 file changed, 107 insertions(+), 107 deletions(-) diff --git a/Source/cmQtAutoGeneratorInitializer.cxx b/Source/cmQtAutoGeneratorInitializer.cxx index ef2f2a56b..d998ae099 100644 --- a/Source/cmQtAutoGeneratorInitializer.cxx +++ b/Source/cmQtAutoGeneratorInitializer.cxx @@ -233,6 +233,113 @@ static void GetUicOpts(cmTarget const* target, const std::string& config, optString = cmJoin(opts, ";"); } +void cmQtAutoGeneratorInitializer::SetupAutoUicTarget(cmTarget const* target, + std::vector const& skipUic, + std::map &configUicOptions) +{ + cmMakefile *makefile = target->GetMakefile(); + + std::set skipped; + skipped.insert(skipUic.begin(), skipUic.end()); + + makefile->AddDefinition("_skip_uic", + cmOutputConverter::EscapeForCMake(cmJoin(skipUic, ";")).c_str()); + + std::vector uiFilesWithOptions + = makefile->GetQtUiFilesWithOptions(); + + const char *qtVersion = makefile->GetDefinition("_target_qt_version"); + + std::string _uic_opts; + std::vector configs; + const std::string& config = makefile->GetConfigurations(configs); + GetUicOpts(target, config, _uic_opts); + + if (!_uic_opts.empty()) + { + _uic_opts = cmOutputConverter::EscapeForCMake(_uic_opts); + makefile->AddDefinition("_uic_target_options", _uic_opts.c_str()); + } + for (std::vector::const_iterator li = configs.begin(); + li != configs.end(); ++li) + { + std::string config_uic_opts; + GetUicOpts(target, *li, config_uic_opts); + if (config_uic_opts != _uic_opts) + { + configUicOptions[*li] = + cmOutputConverter::EscapeForCMake(config_uic_opts); + if(_uic_opts.empty()) + { + _uic_opts = config_uic_opts; + } + } + } + + std::string uiFileFiles; + std::string uiFileOptions; + const char* sep = ""; + + for(std::vector::const_iterator fileIt = + uiFilesWithOptions.begin(); + fileIt != uiFilesWithOptions.end(); + ++fileIt) + { + cmSourceFile* sf = *fileIt; + std::string absFile = cmsys::SystemTools::GetRealPath( + sf->GetFullPath()); + + if (!skipped.insert(absFile).second) + { + continue; + } + uiFileFiles += sep; + uiFileFiles += absFile; + uiFileOptions += sep; + std::string opts = sf->GetProperty("AUTOUIC_OPTIONS"); + cmSystemTools::ReplaceString(opts, ";", "@list_sep@"); + uiFileOptions += opts; + sep = ";"; + } + + makefile->AddDefinition("_qt_uic_options_files", + cmOutputConverter::EscapeForCMake(uiFileFiles).c_str()); + makefile->AddDefinition("_qt_uic_options_options", + cmOutputConverter::EscapeForCMake(uiFileOptions).c_str()); + + std::string targetName = target->GetName(); + if (strcmp(qtVersion, "5") == 0) + { + cmTarget *qt5Uic = makefile->FindTargetToUse("Qt5::uic"); + if (!qt5Uic) + { + // Project does not use Qt5Widgets, but has AUTOUIC ON anyway + } + else + { + makefile->AddDefinition("_qt_uic_executable", + qt5Uic->ImportedGetLocation("")); + } + } + else if (strcmp(qtVersion, "4") == 0) + { + cmTarget *qt4Uic = makefile->FindTargetToUse("Qt4::uic"); + if (!qt4Uic) + { + cmSystemTools::Error("Qt4::uic target not found ", + targetName.c_str()); + return; + } + makefile->AddDefinition("_qt_uic_executable", + qt4Uic->ImportedGetLocation("")); + } + else + { + cmSystemTools::Error("The CMAKE_AUTOUIC feature supports only Qt 4 and " + "Qt 5 ", targetName.c_str()); + } +} + std::string cmQtAutoGeneratorInitializer::GetAutogenTargetName( cmTarget const* target) { @@ -754,113 +861,6 @@ void cmQtAutoGeneratorInitializer::SetupAutoGenerateTarget( } } -void cmQtAutoGeneratorInitializer::SetupAutoUicTarget(cmTarget const* target, - std::vector const& skipUic, - std::map &configUicOptions) -{ - cmMakefile *makefile = target->GetMakefile(); - - std::set skipped; - skipped.insert(skipUic.begin(), skipUic.end()); - - makefile->AddDefinition("_skip_uic", - cmOutputConverter::EscapeForCMake(cmJoin(skipUic, ";")).c_str()); - - std::vector uiFilesWithOptions - = makefile->GetQtUiFilesWithOptions(); - - const char *qtVersion = makefile->GetDefinition("_target_qt_version"); - - std::string _uic_opts; - std::vector configs; - const std::string& config = makefile->GetConfigurations(configs); - GetUicOpts(target, config, _uic_opts); - - if (!_uic_opts.empty()) - { - _uic_opts = cmOutputConverter::EscapeForCMake(_uic_opts); - makefile->AddDefinition("_uic_target_options", _uic_opts.c_str()); - } - for (std::vector::const_iterator li = configs.begin(); - li != configs.end(); ++li) - { - std::string config_uic_opts; - GetUicOpts(target, *li, config_uic_opts); - if (config_uic_opts != _uic_opts) - { - configUicOptions[*li] = - cmOutputConverter::EscapeForCMake(config_uic_opts); - if(_uic_opts.empty()) - { - _uic_opts = config_uic_opts; - } - } - } - - std::string uiFileFiles; - std::string uiFileOptions; - const char* sep = ""; - - for(std::vector::const_iterator fileIt = - uiFilesWithOptions.begin(); - fileIt != uiFilesWithOptions.end(); - ++fileIt) - { - cmSourceFile* sf = *fileIt; - std::string absFile = cmsys::SystemTools::GetRealPath( - sf->GetFullPath()); - - if (!skipped.insert(absFile).second) - { - continue; - } - uiFileFiles += sep; - uiFileFiles += absFile; - uiFileOptions += sep; - std::string opts = sf->GetProperty("AUTOUIC_OPTIONS"); - cmSystemTools::ReplaceString(opts, ";", "@list_sep@"); - uiFileOptions += opts; - sep = ";"; - } - - makefile->AddDefinition("_qt_uic_options_files", - cmOutputConverter::EscapeForCMake(uiFileFiles).c_str()); - makefile->AddDefinition("_qt_uic_options_options", - cmOutputConverter::EscapeForCMake(uiFileOptions).c_str()); - - std::string targetName = target->GetName(); - if (strcmp(qtVersion, "5") == 0) - { - cmTarget *qt5Uic = makefile->FindTargetToUse("Qt5::uic"); - if (!qt5Uic) - { - // Project does not use Qt5Widgets, but has AUTOUIC ON anyway - } - else - { - makefile->AddDefinition("_qt_uic_executable", - qt5Uic->ImportedGetLocation("")); - } - } - else if (strcmp(qtVersion, "4") == 0) - { - cmTarget *qt4Uic = makefile->FindTargetToUse("Qt4::uic"); - if (!qt4Uic) - { - cmSystemTools::Error("Qt4::uic target not found ", - targetName.c_str()); - return; - } - makefile->AddDefinition("_qt_uic_executable", - qt4Uic->ImportedGetLocation("")); - } - else - { - cmSystemTools::Error("The CMAKE_AUTOUIC feature supports only Qt 4 and " - "Qt 5 ", targetName.c_str()); - } -} - void cmQtAutoGeneratorInitializer::MergeRccOptions( std::vector &opts, const std::vector &fileOpts, From 59b91107d16c2f2ba68791ae67c53bdcc0d32e05 Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Mon, 5 Oct 2015 18:50:00 +0200 Subject: [PATCH 017/486] QtAutogen: Move GetRccExecutable method. --- Source/cmQtAutoGeneratorInitializer.cxx | 102 ++++++++++++------------ 1 file changed, 51 insertions(+), 51 deletions(-) diff --git a/Source/cmQtAutoGeneratorInitializer.cxx b/Source/cmQtAutoGeneratorInitializer.cxx index d998ae099..5cb22e953 100644 --- a/Source/cmQtAutoGeneratorInitializer.cxx +++ b/Source/cmQtAutoGeneratorInitializer.cxx @@ -340,6 +340,57 @@ void cmQtAutoGeneratorInitializer::SetupAutoUicTarget(cmTarget const* target, } } +std::string cmQtAutoGeneratorInitializer::GetRccExecutable( + cmTarget const* target) +{ + cmGeneratorTarget *gtgt = target->GetMakefile() + ->GetGlobalGenerator() + ->GetGeneratorTarget(target); + cmMakefile *makefile = target->GetMakefile(); + const char *qtVersion = makefile->GetDefinition("_target_qt_version"); + if (!qtVersion) + { + qtVersion = makefile->GetDefinition("Qt5Core_VERSION_MAJOR"); + if (!qtVersion) + { + qtVersion = makefile->GetDefinition("QT_VERSION_MAJOR"); + } + if (const char *targetQtVersion = + gtgt->GetLinkInterfaceDependentStringProperty("QT_MAJOR_VERSION", "")) + { + qtVersion = targetQtVersion; + } + } + + std::string targetName = target->GetName(); + if (strcmp(qtVersion, "5") == 0) + { + cmTarget *qt5Rcc = makefile->FindTargetToUse("Qt5::rcc"); + if (!qt5Rcc) + { + cmSystemTools::Error("Qt5::rcc target not found ", + targetName.c_str()); + return std::string(); + } + return qt5Rcc->ImportedGetLocation(""); + } + else if (strcmp(qtVersion, "4") == 0) + { + cmTarget *qt4Rcc = makefile->FindTargetToUse("Qt4::rcc"); + if (!qt4Rcc) + { + cmSystemTools::Error("Qt4::rcc target not found ", + targetName.c_str()); + return std::string(); + } + return qt4Rcc->ImportedGetLocation(""); + } + + cmSystemTools::Error("The CMAKE_AUTORCC feature supports only Qt 4 and " + "Qt 5 ", targetName.c_str()); + return std::string(); +} + std::string cmQtAutoGeneratorInitializer::GetAutogenTargetName( cmTarget const* target) { @@ -1021,54 +1072,3 @@ void cmQtAutoGeneratorInitializer::SetupAutoRccTarget(cmTarget const* target) makefile->AddDefinition("_qt_rcc_executable", cmQtAutoGeneratorInitializer::GetRccExecutable(target).c_str()); } - -std::string cmQtAutoGeneratorInitializer::GetRccExecutable( - cmTarget const* target) -{ - cmGeneratorTarget *gtgt = target->GetMakefile() - ->GetGlobalGenerator() - ->GetGeneratorTarget(target); - cmMakefile *makefile = target->GetMakefile(); - const char *qtVersion = makefile->GetDefinition("_target_qt_version"); - if (!qtVersion) - { - qtVersion = makefile->GetDefinition("Qt5Core_VERSION_MAJOR"); - if (!qtVersion) - { - qtVersion = makefile->GetDefinition("QT_VERSION_MAJOR"); - } - if (const char *targetQtVersion = - gtgt->GetLinkInterfaceDependentStringProperty("QT_MAJOR_VERSION", "")) - { - qtVersion = targetQtVersion; - } - } - - std::string targetName = target->GetName(); - if (strcmp(qtVersion, "5") == 0) - { - cmTarget *qt5Rcc = makefile->FindTargetToUse("Qt5::rcc"); - if (!qt5Rcc) - { - cmSystemTools::Error("Qt5::rcc target not found ", - targetName.c_str()); - return std::string(); - } - return qt5Rcc->ImportedGetLocation(""); - } - else if (strcmp(qtVersion, "4") == 0) - { - cmTarget *qt4Rcc = makefile->FindTargetToUse("Qt4::rcc"); - if (!qt4Rcc) - { - cmSystemTools::Error("Qt4::rcc target not found ", - targetName.c_str()); - return std::string(); - } - return qt4Rcc->ImportedGetLocation(""); - } - - cmSystemTools::Error("The CMAKE_AUTORCC feature supports only Qt 4 and " - "Qt 5 ", targetName.c_str()); - return std::string(); -} From 2aa3f500c49e6c81f4d4b821d6ae71ef2589cb07 Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Mon, 5 Oct 2015 18:50:47 +0200 Subject: [PATCH 018/486] QtAutogen: Move MergeRccOptions method. --- Source/cmQtAutoGeneratorInitializer.cxx | 88 ++++++++++++------------- 1 file changed, 44 insertions(+), 44 deletions(-) diff --git a/Source/cmQtAutoGeneratorInitializer.cxx b/Source/cmQtAutoGeneratorInitializer.cxx index 5cb22e953..9bece40ef 100644 --- a/Source/cmQtAutoGeneratorInitializer.cxx +++ b/Source/cmQtAutoGeneratorInitializer.cxx @@ -391,6 +391,50 @@ std::string cmQtAutoGeneratorInitializer::GetRccExecutable( return std::string(); } +void cmQtAutoGeneratorInitializer::MergeRccOptions( + std::vector &opts, + const std::vector &fileOpts, + bool isQt5) +{ + static const char* valueOptions[] = { + "name", + "root", + "compress", + "threshold" + }; + std::vector extraOpts; + for(std::vector::const_iterator it = fileOpts.begin(); + it != fileOpts.end(); ++it) + { + std::vector::iterator existingIt + = std::find(opts.begin(), opts.end(), *it); + if (existingIt != opts.end()) + { + const char *o = it->c_str(); + if (*o == '-') + { + ++o; + } + if (isQt5 && *o == '-') + { + ++o; + } + if (std::find_if(cmArrayBegin(valueOptions), cmArrayEnd(valueOptions), + cmStrCmp(*it)) != cmArrayEnd(valueOptions)) + { + assert(existingIt + 1 != opts.end()); + *(existingIt + 1) = *(it + 1); + ++it; + } + } + else + { + extraOpts.push_back(*it); + } + } + opts.insert(opts.end(), extraOpts.begin(), extraOpts.end()); +} + std::string cmQtAutoGeneratorInitializer::GetAutogenTargetName( cmTarget const* target) { @@ -912,50 +956,6 @@ void cmQtAutoGeneratorInitializer::SetupAutoGenerateTarget( } } -void cmQtAutoGeneratorInitializer::MergeRccOptions( - std::vector &opts, - const std::vector &fileOpts, - bool isQt5) -{ - static const char* valueOptions[] = { - "name", - "root", - "compress", - "threshold" - }; - std::vector extraOpts; - for(std::vector::const_iterator it = fileOpts.begin(); - it != fileOpts.end(); ++it) - { - std::vector::iterator existingIt - = std::find(opts.begin(), opts.end(), *it); - if (existingIt != opts.end()) - { - const char *o = it->c_str(); - if (*o == '-') - { - ++o; - } - if (isQt5 && *o == '-') - { - ++o; - } - if (std::find_if(cmArrayBegin(valueOptions), cmArrayEnd(valueOptions), - cmStrCmp(*it)) != cmArrayEnd(valueOptions)) - { - assert(existingIt + 1 != opts.end()); - *(existingIt + 1) = *(it + 1); - ++it; - } - } - else - { - extraOpts.push_back(*it); - } - } - opts.insert(opts.end(), extraOpts.begin(), extraOpts.end()); -} - void cmQtAutoGeneratorInitializer::SetupAutoRccTarget(cmTarget const* target) { std::string _rcc_files; From 86f7fc5d55da5cf569c516f2d1fb8b69603c1be2 Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Mon, 5 Oct 2015 18:55:09 +0200 Subject: [PATCH 019/486] QtAutogen: Move SetupAutoRccTarget method. --- Source/cmQtAutoGeneratorInitializer.cxx | 233 ++++++++++++------------ 1 file changed, 116 insertions(+), 117 deletions(-) diff --git a/Source/cmQtAutoGeneratorInitializer.cxx b/Source/cmQtAutoGeneratorInitializer.cxx index 9bece40ef..a2a72d429 100644 --- a/Source/cmQtAutoGeneratorInitializer.cxx +++ b/Source/cmQtAutoGeneratorInitializer.cxx @@ -593,6 +593,122 @@ std::string cmQtAutoGeneratorInitializer::ListQt4RccInputs(cmSourceFile* sf, return entriesList; } +void cmQtAutoGeneratorInitializer::SetupAutoRccTarget(cmTarget const* target) +{ + std::string _rcc_files; + const char* sepRccFiles = ""; + cmMakefile *makefile = target->GetMakefile(); + + std::vector srcFiles; + cmGeneratorTarget *gtgt = target->GetMakefile() + ->GetGlobalGenerator() + ->GetGeneratorTarget(target); + gtgt->GetConfigCommonSourceFiles(srcFiles); + + std::string qrcInputs; + const char* qrcInputsSep = ""; + + std::string rccFileFiles; + std::string rccFileOptions; + const char *optionSep = ""; + + const char *qtVersion = makefile->GetDefinition("_target_qt_version"); + + std::vector rccOptions; + if (const char* opts = target->GetProperty("AUTORCC_OPTIONS")) + { + cmSystemTools::ExpandListArgument(opts, rccOptions); + } + std::string qtMajorVersion = makefile->GetSafeDefinition("QT_VERSION_MAJOR"); + if (qtMajorVersion == "") + { + qtMajorVersion = makefile->GetSafeDefinition("Qt5Core_VERSION_MAJOR"); + } + + for(std::vector::const_iterator fileIt = srcFiles.begin(); + fileIt != srcFiles.end(); + ++fileIt) + { + cmSourceFile* sf = *fileIt; + std::string ext = sf->GetExtension(); + if (ext == "qrc") + { + std::string absFile = cmsys::SystemTools::GetRealPath( + sf->GetFullPath()); + bool skip = cmSystemTools::IsOn(sf->GetPropertyForUser("SKIP_AUTORCC")); + + if (!skip) + { + _rcc_files += sepRccFiles; + _rcc_files += absFile; + sepRccFiles = ";"; + + if (const char *prop = sf->GetProperty("AUTORCC_OPTIONS")) + { + std::vector optsVec; + cmSystemTools::ExpandListArgument(prop, optsVec); + cmQtAutoGeneratorInitializer::MergeRccOptions(rccOptions, optsVec, + strcmp(qtVersion, "5") == 0); + } + + if (!rccOptions.empty()) + { + rccFileFiles += optionSep; + rccFileFiles += absFile; + rccFileOptions += optionSep; + } + const char *listSep = ""; + for(std::vector::const_iterator it = rccOptions.begin(); + it != rccOptions.end(); + ++it) + { + rccFileOptions += listSep; + rccFileOptions += *it; + listSep = "@list_sep@"; + } + optionSep = ";"; + + std::vector depends; + + std::string entriesList; + if (!cmSystemTools::IsOn(sf->GetPropertyForUser("GENERATED"))) + { + if (qtMajorVersion == "5") + { + entriesList = cmQtAutoGeneratorInitializer::ListQt5RccInputs(sf, + target, + depends); + } + else + { + entriesList = + cmQtAutoGeneratorInitializer::ListQt4RccInputs(sf, depends); + } + if (entriesList.empty()) + { + return; + } + } + qrcInputs += qrcInputsSep; + qrcInputs += entriesList; + qrcInputsSep = ";"; + } + } + } + makefile->AddDefinition("_qt_rcc_inputs_" + target->GetName(), + cmOutputConverter::EscapeForCMake(qrcInputs).c_str()); + + makefile->AddDefinition("_rcc_files", + cmOutputConverter::EscapeForCMake(_rcc_files).c_str()); + + makefile->AddDefinition("_qt_rcc_options_files", + cmOutputConverter::EscapeForCMake(rccFileFiles).c_str()); + makefile->AddDefinition("_qt_rcc_options_options", + cmOutputConverter::EscapeForCMake(rccFileOptions).c_str()); + + makefile->AddDefinition("_qt_rcc_executable", + cmQtAutoGeneratorInitializer::GetRccExecutable(target).c_str()); +} void cmQtAutoGeneratorInitializer::InitializeAutogenSources(cmTarget* target) { @@ -955,120 +1071,3 @@ void cmQtAutoGeneratorInitializer::SetupAutoGenerateTarget( } } } - -void cmQtAutoGeneratorInitializer::SetupAutoRccTarget(cmTarget const* target) -{ - std::string _rcc_files; - const char* sepRccFiles = ""; - cmMakefile *makefile = target->GetMakefile(); - - std::vector srcFiles; - cmGeneratorTarget *gtgt = target->GetMakefile() - ->GetGlobalGenerator() - ->GetGeneratorTarget(target); - gtgt->GetConfigCommonSourceFiles(srcFiles); - - std::string qrcInputs; - const char* qrcInputsSep = ""; - - std::string rccFileFiles; - std::string rccFileOptions; - const char *optionSep = ""; - - const char *qtVersion = makefile->GetDefinition("_target_qt_version"); - - std::vector rccOptions; - if (const char* opts = target->GetProperty("AUTORCC_OPTIONS")) - { - cmSystemTools::ExpandListArgument(opts, rccOptions); - } - std::string qtMajorVersion = makefile->GetSafeDefinition("QT_VERSION_MAJOR"); - if (qtMajorVersion == "") - { - qtMajorVersion = makefile->GetSafeDefinition("Qt5Core_VERSION_MAJOR"); - } - - for(std::vector::const_iterator fileIt = srcFiles.begin(); - fileIt != srcFiles.end(); - ++fileIt) - { - cmSourceFile* sf = *fileIt; - std::string ext = sf->GetExtension(); - if (ext == "qrc") - { - std::string absFile = cmsys::SystemTools::GetRealPath( - sf->GetFullPath()); - bool skip = cmSystemTools::IsOn(sf->GetPropertyForUser("SKIP_AUTORCC")); - - if (!skip) - { - _rcc_files += sepRccFiles; - _rcc_files += absFile; - sepRccFiles = ";"; - - if (const char *prop = sf->GetProperty("AUTORCC_OPTIONS")) - { - std::vector optsVec; - cmSystemTools::ExpandListArgument(prop, optsVec); - cmQtAutoGeneratorInitializer::MergeRccOptions(rccOptions, optsVec, - strcmp(qtVersion, "5") == 0); - } - - if (!rccOptions.empty()) - { - rccFileFiles += optionSep; - rccFileFiles += absFile; - rccFileOptions += optionSep; - } - const char *listSep = ""; - for(std::vector::const_iterator it = rccOptions.begin(); - it != rccOptions.end(); - ++it) - { - rccFileOptions += listSep; - rccFileOptions += *it; - listSep = "@list_sep@"; - } - optionSep = ";"; - - std::vector depends; - - std::string entriesList; - if (!cmSystemTools::IsOn(sf->GetPropertyForUser("GENERATED"))) - { - if (qtMajorVersion == "5") - { - entriesList = cmQtAutoGeneratorInitializer::ListQt5RccInputs(sf, - target, - depends); - } - else - { - entriesList = - cmQtAutoGeneratorInitializer::ListQt4RccInputs(sf, depends); - } - if (entriesList.empty()) - { - return; - } - } - qrcInputs += qrcInputsSep; - qrcInputs += entriesList; - qrcInputsSep = ";"; - } - } - } - makefile->AddDefinition("_qt_rcc_inputs_" + target->GetName(), - cmOutputConverter::EscapeForCMake(qrcInputs).c_str()); - - makefile->AddDefinition("_rcc_files", - cmOutputConverter::EscapeForCMake(_rcc_files).c_str()); - - makefile->AddDefinition("_qt_rcc_options_files", - cmOutputConverter::EscapeForCMake(rccFileFiles).c_str()); - makefile->AddDefinition("_qt_rcc_options_options", - cmOutputConverter::EscapeForCMake(rccFileOptions).c_str()); - - makefile->AddDefinition("_qt_rcc_executable", - cmQtAutoGeneratorInitializer::GetRccExecutable(target).c_str()); -} From 9cbab63ee143662a94fa050b95d02e9f14342907 Mon Sep 17 00:00:00 2001 From: Brad King Date: Mon, 5 Oct 2015 13:06:15 -0400 Subject: [PATCH 020/486] Tests: Drop nightly OS X ppc/i386 binary Users with OS X 10.5 or below can build from source or use an older CMake version. --- Tests/CMakeLists.txt | 2 -- 1 file changed, 2 deletions(-) diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt index c82cb68d0..46a1243f2 100644 --- a/Tests/CMakeLists.txt +++ b/Tests/CMakeLists.txt @@ -687,8 +687,6 @@ ${CMake_BINARY_DIR}/bin/cmake -DDIR=dev -P ${CMake_SOURCE_DIR}/Utilities/Release if(CMAKE_BUILD_NIGHTLY_RELEASES) ADD_NIGHTLY_BUILD_TEST(CMakeNightlyWindows dash2win64_release.cmake) - ADD_NIGHTLY_BUILD_TEST(CMakeNightlyMac - dashmacmini2_release.cmake) ADD_NIGHTLY_BUILD_TEST(CMakeNightlyMac64 dashmacmini5_release.cmake) ADD_NIGHTLY_BUILD_TEST(CMakeNightlyLinux From 45fa326b6ccceae1858ef3f30c11341c8b397d73 Mon Sep 17 00:00:00 2001 From: Brad King Date: Mon, 5 Oct 2015 11:53:14 -0400 Subject: [PATCH 021/486] Utilities/Release: Drop OS X ppc/i386 binary Users with OS X 10.5 or below can build from source or use an older CMake version. --- Utilities/Release/create-cmake-release.cmake | 3 +-- Utilities/Release/dashmacmini2_release.cmake | 25 -------------------- 2 files changed, 1 insertion(+), 27 deletions(-) delete mode 100644 Utilities/Release/dashmacmini2_release.cmake diff --git a/Utilities/Release/create-cmake-release.cmake b/Utilities/Release/create-cmake-release.cmake index 4cfa2ed93..76057d122 100644 --- a/Utilities/Release/create-cmake-release.cmake +++ b/Utilities/Release/create-cmake-release.cmake @@ -7,8 +7,7 @@ file(MAKE_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/logs) set(RELEASE_SCRIPTS_BATCH_1 dash2win64_release.cmake # Windows - dashmacmini2_release.cmake # Mac Darwin universal ppc;i386 - dashmacmini5_release.cmake # Mac Darwin64 universal x86_64;i386 + dashmacmini5_release.cmake # OS X x86_64 magrathea_release.cmake # Linux linux64_release.cmake # Linux x86_64 ) diff --git a/Utilities/Release/dashmacmini2_release.cmake b/Utilities/Release/dashmacmini2_release.cmake deleted file mode 100644 index cd4c5a1e3..000000000 --- a/Utilities/Release/dashmacmini2_release.cmake +++ /dev/null @@ -1,25 +0,0 @@ -set(PROCESSORS 2) -set(CMAKE_RELEASE_DIRECTORY /Users/kitware/CMakeReleaseDirectory) -set(USER_OVERRIDE "set(CMAKE_CXX_LINK_EXECUTABLE \\\"gcc -o -shared-libgcc -lstdc++-static\\\")") -set(BOOTSTRAP_ARGS "--prefix=/ --docdir=doc/cmake") -set(HOST dashmacmini2) -set(MAKE_PROGRAM "make") -set(MAKE "${MAKE_PROGRAM} -j2") -set(CPACK_BINARY_GENERATORS "DragNDrop TGZ TZ") -set(CPACK_DMG_FORMAT "UDBZ") #build using bzip2 for smaller package size -set(INITIAL_CACHE " -CMAKE_BUILD_TYPE:STRING=Release -CMAKE_OSX_ARCHITECTURES:STRING=ppc;i386 -CMAKE_USE_OPENSSL:BOOL=ON -OPENSSL_CRYPTO_LIBRARY:FILEPATH=/Users/kitware/openssl-1.0.1g-install/lib/libcrypto.a -OPENSSL_INCLUDE_DIR:PATH=/Users/kitware/openssl-1.0.1g-install/include -OPENSSL_SSL_LIBRARY:FILEPATH=/Users/kitware/openssl-1.0.1g-install/lib/libssl.a -CMAKE_SKIP_BOOTSTRAP_TEST:STRING=TRUE -CPACK_SYSTEM_NAME:STRING=Darwin-universal -BUILD_QtDialog:BOOL=TRUE -CMake_GUI_DISTRIBUTE_WITH_Qt_LGPL:BOOL=TRUE -CMake_INSTALL_DEPENDENCIES:BOOL=ON -QT_QMAKE_EXECUTABLE:FILEPATH=/Users/kitware/Support/qt-4.8.0/install/bin/qmake -") -get_filename_component(path "${CMAKE_CURRENT_LIST_FILE}" PATH) -include(${path}/release_cmake.cmake) From 992c43d2ed0bdede5d9d0389c51b8e28bb22cd96 Mon Sep 17 00:00:00 2001 From: Brad King Date: Mon, 5 Oct 2015 13:07:55 -0400 Subject: [PATCH 022/486] Tests: Rename OS X nightly release binary test The "Mac64" build is now the primary and only OS X build, so just name it "OSX". --- Tests/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt index 46a1243f2..1861d82e9 100644 --- a/Tests/CMakeLists.txt +++ b/Tests/CMakeLists.txt @@ -687,7 +687,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DDIR=dev -P ${CMake_SOURCE_DIR}/Utilities/Release if(CMAKE_BUILD_NIGHTLY_RELEASES) ADD_NIGHTLY_BUILD_TEST(CMakeNightlyWindows dash2win64_release.cmake) - ADD_NIGHTLY_BUILD_TEST(CMakeNightlyMac64 + ADD_NIGHTLY_BUILD_TEST(CMakeNightlyOSX dashmacmini5_release.cmake) ADD_NIGHTLY_BUILD_TEST(CMakeNightlyLinux magrathea_release.cmake) From 5fb730174dc5e0c07dfc7aec27e3d6e60c79e3d3 Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Mon, 5 Oct 2015 19:21:48 +0200 Subject: [PATCH 023/486] QtAutogen: Make some private statics file static. --- Source/cmQtAutoGeneratorInitializer.cxx | 67 ++++++++++--------------- Source/cmQtAutoGeneratorInitializer.h | 32 ------------ 2 files changed, 27 insertions(+), 72 deletions(-) diff --git a/Source/cmQtAutoGeneratorInitializer.cxx b/Source/cmQtAutoGeneratorInitializer.cxx index a2a72d429..fe888b7be 100644 --- a/Source/cmQtAutoGeneratorInitializer.cxx +++ b/Source/cmQtAutoGeneratorInitializer.cxx @@ -25,7 +25,7 @@ # include "cmGlobalVisualStudioGenerator.h" #endif -void cmQtAutoGeneratorInitializer::SetupSourceFiles(cmTarget const* target, +static void SetupSourceFiles(cmTarget const* target, std::vector& skipMoc, std::vector& mocSources, std::vector& mocHeaders, @@ -130,7 +130,7 @@ static void GetCompileDefinitionsAndDirectories(cmTarget const* target, defs += cmJoin(defines, ";"); } -void cmQtAutoGeneratorInitializer::SetupAutoMocTarget(cmTarget const* target, +static void SetupAutoMocTarget(cmTarget const* target, const std::string &autogenTargetName, std::vector const& skipMoc, std::vector const& mocHeaders, @@ -233,7 +233,7 @@ static void GetUicOpts(cmTarget const* target, const std::string& config, optString = cmJoin(opts, ";"); } -void cmQtAutoGeneratorInitializer::SetupAutoUicTarget(cmTarget const* target, +static void SetupAutoUicTarget(cmTarget const* target, std::vector const& skipUic, std::map &configUicOptions) { @@ -340,8 +340,7 @@ void cmQtAutoGeneratorInitializer::SetupAutoUicTarget(cmTarget const* target, } } -std::string cmQtAutoGeneratorInitializer::GetRccExecutable( - cmTarget const* target) +static std::string GetRccExecutable(cmTarget const* target) { cmGeneratorTarget *gtgt = target->GetMakefile() ->GetGlobalGenerator() @@ -391,8 +390,7 @@ std::string cmQtAutoGeneratorInitializer::GetRccExecutable( return std::string(); } -void cmQtAutoGeneratorInitializer::MergeRccOptions( - std::vector &opts, +static void MergeRccOptions(std::vector &opts, const std::vector &fileOpts, bool isQt5) { @@ -435,7 +433,7 @@ void cmQtAutoGeneratorInitializer::MergeRccOptions( opts.insert(opts.end(), extraOpts.begin(), extraOpts.end()); } -std::string cmQtAutoGeneratorInitializer::GetAutogenTargetName( +std::string GetAutogenTargetName( cmTarget const* target) { std::string autogenTargetName = target->GetName(); @@ -443,14 +441,14 @@ std::string cmQtAutoGeneratorInitializer::GetAutogenTargetName( return autogenTargetName; } -std::string cmQtAutoGeneratorInitializer::GetAutogenTargetDir( +std::string GetAutogenTargetDir( cmTarget const* target) { cmMakefile* makefile = target->GetMakefile(); std::string targetDir = makefile->GetCurrentBinaryDirectory(); targetDir += makefile->GetCMakeInstance()->GetCMakeFilesDirectory(); targetDir += "/"; - targetDir += cmQtAutoGeneratorInitializer::GetAutogenTargetName(target); + targetDir += GetAutogenTargetName(target); targetDir += ".dir/"; return targetDir; } @@ -486,12 +484,12 @@ static std::string ReadAll(const std::string& filename) return stream.str(); } -std::string cmQtAutoGeneratorInitializer::ListQt5RccInputs(cmSourceFile* sf, +static std::string ListQt5RccInputs(cmSourceFile* sf, cmTarget const* target, std::vector& depends) { std::string rccCommand - = cmQtAutoGeneratorInitializer::GetRccExecutable(target); + = GetRccExecutable(target); std::vector qrcEntries; std::vector command; @@ -557,7 +555,7 @@ std::string cmQtAutoGeneratorInitializer::ListQt5RccInputs(cmSourceFile* sf, return cmJoin(qrcEntries, "@list_sep@"); } -std::string cmQtAutoGeneratorInitializer::ListQt4RccInputs(cmSourceFile* sf, +static std::string ListQt4RccInputs(cmSourceFile* sf, std::vector& depends) { const std::string qrcContents = ReadAll(sf->GetFullPath()); @@ -593,7 +591,7 @@ std::string cmQtAutoGeneratorInitializer::ListQt4RccInputs(cmSourceFile* sf, return entriesList; } -void cmQtAutoGeneratorInitializer::SetupAutoRccTarget(cmTarget const* target) +static void SetupAutoRccTarget(cmTarget const* target) { std::string _rcc_files; const char* sepRccFiles = ""; @@ -647,7 +645,7 @@ void cmQtAutoGeneratorInitializer::SetupAutoRccTarget(cmTarget const* target) { std::vector optsVec; cmSystemTools::ExpandListArgument(prop, optsVec); - cmQtAutoGeneratorInitializer::MergeRccOptions(rccOptions, optsVec, + MergeRccOptions(rccOptions, optsVec, strcmp(qtVersion, "5") == 0); } @@ -675,14 +673,11 @@ void cmQtAutoGeneratorInitializer::SetupAutoRccTarget(cmTarget const* target) { if (qtMajorVersion == "5") { - entriesList = cmQtAutoGeneratorInitializer::ListQt5RccInputs(sf, - target, - depends); + entriesList = ListQt5RccInputs(sf, target, depends); } else { - entriesList = - cmQtAutoGeneratorInitializer::ListQt4RccInputs(sf, depends); + entriesList = ListQt4RccInputs(sf, depends); } if (entriesList.empty()) { @@ -707,7 +702,7 @@ void cmQtAutoGeneratorInitializer::SetupAutoRccTarget(cmTarget const* target) cmOutputConverter::EscapeForCMake(rccFileOptions).c_str()); makefile->AddDefinition("_qt_rcc_executable", - cmQtAutoGeneratorInitializer::GetRccExecutable(target).c_str()); + GetRccExecutable(target).c_str()); } void cmQtAutoGeneratorInitializer::InitializeAutogenSources(cmTarget* target) @@ -716,8 +711,7 @@ void cmQtAutoGeneratorInitializer::InitializeAutogenSources(cmTarget* target) if (target->GetPropertyAsBool("AUTOMOC")) { - std::string automocTargetName = - cmQtAutoGeneratorInitializer::GetAutogenTargetName(target); + std::string automocTargetName = GetAutogenTargetName(target); std::string mocCppFile = makefile->GetCurrentBinaryDirectory(); mocCppFile += "/"; mocCppFile += automocTargetName; @@ -743,11 +737,9 @@ void cmQtAutoGeneratorInitializer::InitializeAutogenTarget( } // create a custom target for running generators at buildtime: - std::string autogenTargetName = - cmQtAutoGeneratorInitializer::GetAutogenTargetName(target); + std::string autogenTargetName = GetAutogenTargetName(target); - std::string targetDir = - cmQtAutoGeneratorInitializer::GetAutogenTargetDir(target); + std::string targetDir = GetAutogenTargetDir(target); cmCustomCommandLine currentLine; currentLine.push_back(cmSystemTools::GetCMakeCommand()); @@ -864,12 +856,11 @@ void cmQtAutoGeneratorInitializer::InitializeAutogenTarget( { if (qtMajorVersion == "5") { - cmQtAutoGeneratorInitializer::ListQt5RccInputs(sf, target, - depends); + ListQt5RccInputs(sf, target, depends); } else { - cmQtAutoGeneratorInitializer::ListQt4RccInputs(sf, depends); + ListQt4RccInputs(sf, depends); } #if defined(_WIN32) && !defined(__CYGWIN__) // Cannot use PRE_BUILD because the resource files themselves @@ -942,16 +933,14 @@ void cmQtAutoGeneratorInitializer::SetupAutoGenerateTarget( static_cast(varScope); // create a custom target for running generators at buildtime: - std::string autogenTargetName = - cmQtAutoGeneratorInitializer::GetAutogenTargetName(target); + std::string autogenTargetName = GetAutogenTargetName(target); makefile->AddDefinition("_moc_target_name", cmOutputConverter::EscapeForCMake(autogenTargetName).c_str()); makefile->AddDefinition("_origin_target_name", cmOutputConverter::EscapeForCMake(target->GetName()).c_str()); - std::string targetDir = - cmQtAutoGeneratorInitializer::GetAutogenTargetDir(target); + std::string targetDir = GetAutogenTargetDir(target); const char *qtVersion = makefile->GetDefinition("Qt5Core_VERSION_MAJOR"); if (!qtVersion) @@ -983,25 +972,23 @@ void cmQtAutoGeneratorInitializer::SetupAutoGenerateTarget( || target->GetPropertyAsBool("AUTOUIC") || target->GetPropertyAsBool("AUTORCC")) { - cmQtAutoGeneratorInitializer::SetupSourceFiles(target, skipMoc, - mocSources, mocHeaders, skipUic); + SetupSourceFiles(target, skipMoc, mocSources, mocHeaders, skipUic); } makefile->AddDefinition("_cpp_files", cmOutputConverter::EscapeForCMake(cmJoin(mocSources, ";")).c_str()); if (target->GetPropertyAsBool("AUTOMOC")) { - cmQtAutoGeneratorInitializer::SetupAutoMocTarget(target, autogenTargetName, + SetupAutoMocTarget(target, autogenTargetName, skipMoc, mocHeaders, configIncludes, configDefines); } if (target->GetPropertyAsBool("AUTOUIC")) { - cmQtAutoGeneratorInitializer::SetupAutoUicTarget(target, skipUic, - configUicOptions); + SetupAutoUicTarget(target, skipUic, configUicOptions); } if (target->GetPropertyAsBool("AUTORCC")) { - cmQtAutoGeneratorInitializer::SetupAutoRccTarget(target); + SetupAutoRccTarget(target); } const char* cmakeRoot = makefile->GetSafeDefinition("CMAKE_ROOT"); diff --git a/Source/cmQtAutoGeneratorInitializer.h b/Source/cmQtAutoGeneratorInitializer.h index c22f1727e..ad5c85c73 100644 --- a/Source/cmQtAutoGeneratorInitializer.h +++ b/Source/cmQtAutoGeneratorInitializer.h @@ -30,38 +30,6 @@ public: static void InitializeAutogenSources(cmTarget* target); static void InitializeAutogenTarget(cmLocalGenerator* lg, cmTarget* target); static void SetupAutoGenerateTarget(cmTarget const* target); - - static std::string GetAutogenTargetName(cmTarget const* target); - static std::string GetAutogenTargetDir(cmTarget const* target); - -private: - static void SetupSourceFiles(cmTarget const* target, - std::vector& skipMoc, - std::vector& mocSources, - std::vector& mocHeaders, - std::vector& skipUic); - - static void SetupAutoMocTarget(cmTarget const* target, - const std::string &autogenTargetName, - const std::vector& skipMoc, - const std::vector& mocHeaders, - std::map &configIncludes, - std::map &configDefines); - static void SetupAutoUicTarget(cmTarget const* target, - const std::vector& skipUic, - std::map &configUicOptions); - static void SetupAutoRccTarget(cmTarget const* target); - - static void MergeRccOptions(std::vector &opts, - const std::vector &fileOpts, bool isQt5); - - static std::string GetRccExecutable(cmTarget const* target); - - static std::string ListQt5RccInputs(cmSourceFile* sf, cmTarget const* target, - std::vector& depends); - - static std::string ListQt4RccInputs(cmSourceFile* sf, - std::vector& depends); }; #endif From 1e757c318b38566aea1c9312a6fb5a3accd3966b Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Mon, 5 Oct 2015 19:21:56 +0200 Subject: [PATCH 024/486] QtAutogen: Use a target type between loops. --- Source/cmGlobalGenerator.cxx | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx index 4a48b5d0b..53c859da3 100644 --- a/Source/cmGlobalGenerator.cxx +++ b/Source/cmGlobalGenerator.cxx @@ -1413,8 +1413,8 @@ cmGlobalGenerator::CreateQtAutoGeneratorsTargets() { cmTargets& targets = this->LocalGenerators[i]->GetMakefile()->GetTargets(); - std::vector targetNames; - targetNames.reserve(targets.size()); + std::vector filteredTargets; + filteredTargets.reserve(targets.size()); for(cmTargets::iterator ti = targets.begin(); ti != targets.end(); ++ti) { @@ -1450,13 +1450,12 @@ cmGlobalGenerator::CreateQtAutoGeneratorsTargets() } cmQtAutoGeneratorInitializer::InitializeAutogenSources(&ti->second); - targetNames.push_back(ti->second.GetName()); + filteredTargets.push_back(&ti->second); } - for(std::vector::iterator ti = targetNames.begin(); - ti != targetNames.end(); ++ti) + for(std::vector::iterator ti = filteredTargets.begin(); + ti != filteredTargets.end(); ++ti) { - cmTarget* target = this->LocalGenerators[i] - ->GetMakefile()->FindTarget(*ti, true); + cmTarget* target = *ti; cmQtAutoGeneratorInitializer::InitializeAutogenTarget( this->LocalGenerators[i], target); autogenTargets.push_back(target); From b2054e1661e5c607cf25e1ac127982f58e29dd44 Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Mon, 5 Oct 2015 19:21:59 +0200 Subject: [PATCH 025/486] QtAutogen: Port global generator to cmGeneratorTarget. --- Source/cmGlobalGenerator.cxx | 26 ++++++++++++++------------ Source/cmGlobalGenerator.h | 2 +- 2 files changed, 15 insertions(+), 13 deletions(-) diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx index 53c859da3..21ada7133 100644 --- a/Source/cmGlobalGenerator.cxx +++ b/Source/cmGlobalGenerator.cxx @@ -1251,7 +1251,7 @@ bool cmGlobalGenerator::Compute() #ifdef CMAKE_BUILD_WITH_CMAKE // Iterate through all targets and set up automoc for those which have // the AUTOMOC, AUTOUIC or AUTORCC property set - std::vector autogenTargets = + std::vector autogenTargets = this->CreateQtAutoGeneratorsTargets(); #endif @@ -1264,10 +1264,10 @@ bool cmGlobalGenerator::Compute() } #ifdef CMAKE_BUILD_WITH_CMAKE - for (std::vector::iterator it = autogenTargets.begin(); - it != autogenTargets.end(); ++it) + for (std::vector::iterator it = + autogenTargets.begin(); it != autogenTargets.end(); ++it) { - cmQtAutoGeneratorInitializer::SetupAutoGenerateTarget(*it); + cmQtAutoGeneratorInitializer::SetupAutoGenerateTarget((*it)->Target); } #endif @@ -1403,17 +1403,17 @@ bool cmGlobalGenerator::ComputeTargetDepends() } //---------------------------------------------------------------------------- -std::vector +std::vector cmGlobalGenerator::CreateQtAutoGeneratorsTargets() { - std::vector autogenTargets; + std::vector autogenTargets; #ifdef CMAKE_BUILD_WITH_CMAKE for(unsigned int i=0; i < this->LocalGenerators.size(); ++i) { cmTargets& targets = this->LocalGenerators[i]->GetMakefile()->GetTargets(); - std::vector filteredTargets; + std::vector filteredTargets; filteredTargets.reserve(targets.size()); for(cmTargets::iterator ti = targets.begin(); ti != targets.end(); ++ti) @@ -1449,16 +1449,18 @@ cmGlobalGenerator::CreateQtAutoGeneratorsTargets() continue; } - cmQtAutoGeneratorInitializer::InitializeAutogenSources(&ti->second); - filteredTargets.push_back(&ti->second); + cmGeneratorTarget* gt = this->GetGeneratorTarget(&ti->second); + + cmQtAutoGeneratorInitializer::InitializeAutogenSources(gt->Target); + filteredTargets.push_back(gt); } - for(std::vector::iterator ti = filteredTargets.begin(); + for(std::vector::iterator ti = filteredTargets.begin(); ti != filteredTargets.end(); ++ti) { - cmTarget* target = *ti; + cmTarget* target = (*ti)->Target; cmQtAutoGeneratorInitializer::InitializeAutogenTarget( this->LocalGenerators[i], target); - autogenTargets.push_back(target); + autogenTargets.push_back(*ti); } } #endif diff --git a/Source/cmGlobalGenerator.h b/Source/cmGlobalGenerator.h index ba74c9e65..25e06cda9 100644 --- a/Source/cmGlobalGenerator.h +++ b/Source/cmGlobalGenerator.h @@ -384,7 +384,7 @@ protected: virtual bool CheckALLOW_DUPLICATE_CUSTOM_TARGETS() const; - std::vector CreateQtAutoGeneratorsTargets(); + std::vector CreateQtAutoGeneratorsTargets(); std::string SelectMakeProgram(const std::string& makeProgram, const std::string& makeDefault = "") const; From f7738fd122ac38fb3785e6366193fe5095b23b88 Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Mon, 5 Oct 2015 19:15:56 +0200 Subject: [PATCH 026/486] cmLocalGenerator: Constify target in API. --- Source/cmLocalGenerator.cxx | 2 +- Source/cmLocalGenerator.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx index 32304032d..b26151ccf 100644 --- a/Source/cmLocalGenerator.cxx +++ b/Source/cmLocalGenerator.cxx @@ -1180,7 +1180,7 @@ void cmLocalGenerator::AddCompileOptions( //---------------------------------------------------------------------------- void cmLocalGenerator::GetIncludeDirectories(std::vector& dirs, - cmGeneratorTarget* target, + cmGeneratorTarget const* target, const std::string& lang, const std::string& config, bool stripImplicitInclDirs diff --git a/Source/cmLocalGenerator.h b/Source/cmLocalGenerator.h index 6ea414a50..33fede14a 100644 --- a/Source/cmLocalGenerator.h +++ b/Source/cmLocalGenerator.h @@ -171,7 +171,7 @@ public: /** Get the include flags for the current makefile and language. */ void GetIncludeDirectories(std::vector& dirs, - cmGeneratorTarget* target, + cmGeneratorTarget const* target, const std::string& lang = "C", const std::string& config = "", bool stripImplicitInclDirs = true) const; From 94cc4e74aec3bc76e94a426d94cd1015c8a9749e Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Mon, 5 Oct 2015 19:58:36 +0200 Subject: [PATCH 027/486] CPack: Remove needless cmLocalGenerator creation. --- Source/CPack/cmCPackGenerator.cxx | 3 --- Source/CPack/cpack.cxx | 2 -- 2 files changed, 5 deletions(-) diff --git a/Source/CPack/cmCPackGenerator.cxx b/Source/CPack/cmCPackGenerator.cxx index def9fc7b6..2f69c2541 100644 --- a/Source/CPack/cmCPackGenerator.cxx +++ b/Source/CPack/cmCPackGenerator.cxx @@ -16,7 +16,6 @@ #include "cmCPackLog.h" #include "cmake.h" #include "cmGlobalGenerator.h" -#include "cmLocalGenerator.h" #include "cmGeneratedFileStream.h" #include "cmCPackComponentGroup.h" #include "cmXMLSafe.h" @@ -723,8 +722,6 @@ int cmCPackGenerator::InstallProjectViaInstallCMakeProjects( cmGlobalGenerator gg(&cm); cmsys::auto_ptr mf( new cmMakefile(&gg, cm.GetCurrentSnapshot())); - cmsys::auto_ptr lg( - gg.CreateLocalGenerator(mf.get())); std::string realInstallDirectory = tempInstallDirectory; if ( !installSubDirectory.empty() && installSubDirectory != "/" ) { diff --git a/Source/CPack/cpack.cxx b/Source/CPack/cpack.cxx index cb9cbc49e..213b7eff7 100644 --- a/Source/CPack/cpack.cxx +++ b/Source/CPack/cpack.cxx @@ -204,8 +204,6 @@ int main (int argc, char const* const* argv) cmGlobalGenerator cmgg(&cminst); cmsys::auto_ptr globalMF( new cmMakefile(&cmgg, cminst.GetCurrentSnapshot())); - cmsys::auto_ptr cmlg( - cmgg.CreateLocalGenerator(globalMF.get())); #if defined(__CYGWIN__) globalMF->AddDefinition("CMAKE_LEGACY_CYGWIN_WIN32", "0"); #endif From 6da4cd8fb9a2583c7ba08c403ec3a5aeb264730f Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Mon, 5 Oct 2015 20:01:41 +0200 Subject: [PATCH 028/486] CTest: Remove needless cmLocalGenerator creation. --- Source/CTest/cmCTestLaunch.cxx | 3 --- Source/CTest/cmCTestTestHandler.cxx | 3 --- Source/cmCTest.cxx | 2 -- 3 files changed, 8 deletions(-) diff --git a/Source/CTest/cmCTestLaunch.cxx b/Source/CTest/cmCTestLaunch.cxx index fb0cce634..ca5d05a58 100644 --- a/Source/CTest/cmCTestLaunch.cxx +++ b/Source/CTest/cmCTestLaunch.cxx @@ -728,7 +728,6 @@ int cmCTestLaunch::Main(int argc, const char* const argv[]) //---------------------------------------------------------------------------- #include "cmGlobalGenerator.h" -#include "cmLocalGenerator.h" #include "cmMakefile.h" #include "cmake.h" #include @@ -739,8 +738,6 @@ void cmCTestLaunch::LoadConfig() cm.SetHomeOutputDirectory(""); cmGlobalGenerator gg(&cm); cmsys::auto_ptr mf(new cmMakefile(&gg, cm.GetCurrentSnapshot())); - cmsys::auto_ptr lg( - gg.CreateLocalGenerator(mf.get())); std::string fname = this->LogDir; fname += "CTestLaunchConfig.cmake"; if(cmSystemTools::FileExists(fname.c_str()) && diff --git a/Source/CTest/cmCTestTestHandler.cxx b/Source/CTest/cmCTestTestHandler.cxx index f9678e7ba..968a30732 100644 --- a/Source/CTest/cmCTestTestHandler.cxx +++ b/Source/CTest/cmCTestTestHandler.cxx @@ -24,7 +24,6 @@ #include #include "cmMakefile.h" #include "cmGlobalGenerator.h" -#include "cmLocalGenerator.h" #include "cmCommand.h" #include "cmSystemTools.h" #include "cmXMLWriter.h" @@ -1593,8 +1592,6 @@ void cmCTestTestHandler::GetListOfTests() cm.SetHomeOutputDirectory(""); cmGlobalGenerator gg(&cm); cmsys::auto_ptr mf(new cmMakefile(&gg, cm.GetCurrentSnapshot())); - cmsys::auto_ptr lg( - gg.CreateLocalGenerator(mf.get())); mf->AddDefinition("CTEST_CONFIGURATION_TYPE", this->CTest->GetConfigType().c_str()); diff --git a/Source/cmCTest.cxx b/Source/cmCTest.cxx index 6e55d8939..67eb042e0 100644 --- a/Source/cmCTest.cxx +++ b/Source/cmCTest.cxx @@ -14,7 +14,6 @@ #include "cmCTest.h" #include "cmake.h" #include "cmMakefile.h" -#include "cmLocalGenerator.h" #include "cmGlobalGenerator.h" #include #include @@ -520,7 +519,6 @@ int cmCTest::Initialize(const char* binary_dir, cmCTestStartCommand* command) cm.SetHomeOutputDirectory(""); cmGlobalGenerator gg(&cm); cmsys::auto_ptr mf(new cmMakefile(&gg, cm.GetCurrentSnapshot())); - cmsys::auto_ptr lg(gg.CreateLocalGenerator(mf.get())); if ( !this->ReadCustomConfigurationFileTree(this->BinaryDir.c_str(), mf.get()) ) { From 3339a7508e2d90cbc832490e64f593c1ab935097 Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Mon, 5 Oct 2015 20:03:14 +0200 Subject: [PATCH 029/486] CTest: Port away from cmLocalGenerator. --- Source/CTest/cmCTestScriptHandler.cxx | 14 ++------------ Source/CTest/cmCTestScriptHandler.h | 2 -- 2 files changed, 2 insertions(+), 14 deletions(-) diff --git a/Source/CTest/cmCTestScriptHandler.cxx b/Source/CTest/cmCTestScriptHandler.cxx index c1ba2794a..2f125aaa6 100644 --- a/Source/CTest/cmCTestScriptHandler.cxx +++ b/Source/CTest/cmCTestScriptHandler.cxx @@ -16,7 +16,6 @@ #include "cmake.h" #include "cmFunctionBlocker.h" #include "cmMakefile.h" -#include "cmLocalGenerator.h" #include "cmGlobalGenerator.h" #include "cmGeneratedFileStream.h" @@ -86,7 +85,6 @@ cmCTestScriptHandler::cmCTestScriptHandler() this->EmptyBinDir = false; this->EmptyBinDirOnce = false; this->Makefile = 0; - this->LocalGenerator = 0; this->CMake = 0; this->GlobalGenerator = 0; @@ -128,9 +126,6 @@ void cmCTestScriptHandler::Initialize() delete this->Makefile; this->Makefile = 0; - delete this->LocalGenerator; - this->LocalGenerator = 0; - delete this->GlobalGenerator; this->GlobalGenerator = 0; @@ -141,7 +136,6 @@ void cmCTestScriptHandler::Initialize() cmCTestScriptHandler::~cmCTestScriptHandler() { delete this->Makefile; - delete this->LocalGenerator; delete this->GlobalGenerator; delete this->CMake; } @@ -179,15 +173,14 @@ int cmCTestScriptHandler::ProcessHandler() void cmCTestScriptHandler::UpdateElapsedTime() { - if (this->LocalGenerator) + if (this->Makefile) { // set the current elapsed time char timeString[20]; int itime = static_cast(cmSystemTools::GetTime() - this->ScriptStartTime); sprintf(timeString,"%i",itime); - this->LocalGenerator->GetMakefile()->AddDefinition("CTEST_ELAPSED_TIME", - timeString); + this->Makefile->AddDefinition("CTEST_ELAPSED_TIME", timeString); } } @@ -316,7 +309,6 @@ void cmCTestScriptHandler::CreateCMake() { delete this->CMake; delete this->GlobalGenerator; - delete this->LocalGenerator; delete this->Makefile; } this->CMake = new cmake; @@ -327,8 +319,6 @@ void cmCTestScriptHandler::CreateCMake() cmState::Snapshot snapshot = this->CMake->GetCurrentSnapshot(); this->Makefile = new cmMakefile(this->GlobalGenerator, snapshot); - this->LocalGenerator = - this->GlobalGenerator->CreateLocalGenerator(this->Makefile); this->CMake->SetProgressCallback(ctestScriptProgressCallback, this->CTest); diff --git a/Source/CTest/cmCTestScriptHandler.h b/Source/CTest/cmCTestScriptHandler.h index 42c2f209b..c9d0b6a3c 100644 --- a/Source/CTest/cmCTestScriptHandler.h +++ b/Source/CTest/cmCTestScriptHandler.h @@ -18,7 +18,6 @@ #include "cmListFileCache.h" class cmMakefile; -class cmLocalGenerator; class cmGlobalGenerator; class cmake; class cmCTestCommand; @@ -166,7 +165,6 @@ private: double ScriptStartTime; cmMakefile *Makefile; - cmLocalGenerator *LocalGenerator; cmGlobalGenerator *GlobalGenerator; cmake *CMake; }; From 0a73044579a687d1f610a3b6d65e801d2f217435 Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Mon, 5 Oct 2015 20:52:26 +0200 Subject: [PATCH 030/486] cmake: Remove needless cmLocalGenerator creation. --- Source/cmake.cxx | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/Source/cmake.cxx b/Source/cmake.cxx index 386f6a5a5..2aa092a96 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -378,20 +378,19 @@ void cmake::ReadListFile(const std::vector& args, this->SetHomeOutputDirectory(cmSystemTools::GetCurrentWorkingDirectory()); cmState::Snapshot snapshot = this->GetCurrentSnapshot(); cmsys::auto_ptr mf(new cmMakefile(gg, snapshot)); - cmsys::auto_ptr lg(gg->CreateLocalGenerator(mf.get())); - lg->GetMakefile()->SetCurrentBinaryDirectory + mf->SetCurrentBinaryDirectory (cmSystemTools::GetCurrentWorkingDirectory()); - lg->GetMakefile()->SetCurrentSourceDirectory + mf->SetCurrentSourceDirectory (cmSystemTools::GetCurrentWorkingDirectory()); if (this->GetWorkingMode() != NORMAL_MODE) { std::string file(cmSystemTools::CollapseFullPath(path)); cmSystemTools::ConvertToUnixSlashes(file); - lg->GetMakefile()->SetScriptModeFile(file.c_str()); + mf->SetScriptModeFile(file.c_str()); - lg->GetMakefile()->SetArgcArgv(args); + mf->SetArgcArgv(args); } - if (!lg->GetMakefile()->ReadListFile(path)) + if (!mf->ReadListFile(path)) { cmSystemTools::Error("Error processing file: ", path); } @@ -1906,7 +1905,6 @@ int cmake::CheckBuildSystem() cm.SetHomeOutputDirectory(""); cmGlobalGenerator gg(&cm); cmsys::auto_ptr mf(new cmMakefile(&gg, cm.GetCurrentSnapshot())); - cmsys::auto_ptr lg(gg.CreateLocalGenerator(mf.get())); if(!mf->ReadListFile(this->CheckBuildSystemArgument.c_str()) || cmSystemTools::GetErrorOccuredFlag()) { From 09466690f05a2d81383409962cda2213fd366d8c Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Mon, 5 Oct 2015 20:57:47 +0200 Subject: [PATCH 031/486] Add cmOutputConverter include where needed. --- Source/cmIfCommand.cxx | 1 + Source/cmListFileCache.cxx | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/Source/cmIfCommand.cxx b/Source/cmIfCommand.cxx index 20448c163..a03808f47 100644 --- a/Source/cmIfCommand.cxx +++ b/Source/cmIfCommand.cxx @@ -11,6 +11,7 @@ ============================================================================*/ #include "cmIfCommand.h" #include "cmStringCommand.h" +#include "cmOutputConverter.h" #include "cmConditionEvaluator.h" diff --git a/Source/cmListFileCache.cxx b/Source/cmListFileCache.cxx index bff298615..505022955 100644 --- a/Source/cmListFileCache.cxx +++ b/Source/cmListFileCache.cxx @@ -12,7 +12,7 @@ #include "cmListFileCache.h" #include "cmListFileLexer.h" -#include "cmLocalGenerator.h" +#include "cmOutputConverter.h" #include "cmSystemTools.h" #include "cmMakefile.h" #include "cmVersion.h" From 74d565e0e91f31e5fb25c74f998a2e4553c0842e Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Mon, 5 Oct 2015 20:45:49 +0200 Subject: [PATCH 032/486] Remove unused cmLocalGenerator include. --- Source/CPack/IFW/cmCPackIFWGenerator.cxx | 1 - Source/CPack/cmCPackArchiveGenerator.cxx | 1 - Source/CPack/cmCPackCygwinBinaryGenerator.cxx | 1 - Source/CPack/cmCPackCygwinSourceGenerator.cxx | 1 - Source/CPack/cmCPackNSISGenerator.cxx | 1 - Source/CPack/cmCPackOSXX11Generator.cxx | 1 - Source/CPack/cmCPackPackageMakerGenerator.cxx | 1 - Source/CPack/cmCPackSTGZGenerator.cxx | 1 - Source/CPack/cpack.cxx | 1 - Source/CTest/cmCTestBuildHandler.cxx | 1 - Source/CTest/cmCTestStartCommand.cxx | 1 - Source/CTest/cmCTestUpdateHandler.cxx | 1 - Source/cmAddDependenciesCommand.cxx | 1 - Source/cmBuildCommand.cxx | 1 - Source/cmEnableTestingCommand.cxx | 1 - Source/cmExportCommand.cxx | 1 - Source/cmFileCommand.cxx | 1 - Source/cmGetCMakePropertyCommand.cxx | 1 - Source/cmGetPropertyCommand.cxx | 1 - Source/cmSetTargetPropertiesCommand.cxx | 1 - Source/cmSourceFile.cxx | 1 - Source/cmSourceFileLocation.cxx | 1 - 22 files changed, 22 deletions(-) diff --git a/Source/CPack/IFW/cmCPackIFWGenerator.cxx b/Source/CPack/IFW/cmCPackIFWGenerator.cxx index 43d34ee65..4eb23c182 100644 --- a/Source/CPack/IFW/cmCPackIFWGenerator.cxx +++ b/Source/CPack/IFW/cmCPackIFWGenerator.cxx @@ -24,7 +24,6 @@ #include #include -#include #include #include #include diff --git a/Source/CPack/cmCPackArchiveGenerator.cxx b/Source/CPack/cmCPackArchiveGenerator.cxx index 70de757c7..db985db81 100644 --- a/Source/CPack/cmCPackArchiveGenerator.cxx +++ b/Source/CPack/cmCPackArchiveGenerator.cxx @@ -14,7 +14,6 @@ #include "cmake.h" #include "cmGlobalGenerator.h" -#include "cmLocalGenerator.h" #include "cmSystemTools.h" #include "cmMakefile.h" #include "cmGeneratedFileStream.h" diff --git a/Source/CPack/cmCPackCygwinBinaryGenerator.cxx b/Source/CPack/cmCPackCygwinBinaryGenerator.cxx index 6605f16e0..1f905c030 100644 --- a/Source/CPack/cmCPackCygwinBinaryGenerator.cxx +++ b/Source/CPack/cmCPackCygwinBinaryGenerator.cxx @@ -14,7 +14,6 @@ #include "cmake.h" #include "cmGlobalGenerator.h" -#include "cmLocalGenerator.h" #include "cmSystemTools.h" #include "cmMakefile.h" #include "cmGeneratedFileStream.h" diff --git a/Source/CPack/cmCPackCygwinSourceGenerator.cxx b/Source/CPack/cmCPackCygwinSourceGenerator.cxx index f1e8539b9..f5cb53cc9 100644 --- a/Source/CPack/cmCPackCygwinSourceGenerator.cxx +++ b/Source/CPack/cmCPackCygwinSourceGenerator.cxx @@ -14,7 +14,6 @@ #include "cmake.h" #include "cmGlobalGenerator.h" -#include "cmLocalGenerator.h" #include "cmSystemTools.h" #include "cmMakefile.h" #include "cmGeneratedFileStream.h" diff --git a/Source/CPack/cmCPackNSISGenerator.cxx b/Source/CPack/cmCPackNSISGenerator.cxx index 6cdda2832..52fbdaf91 100644 --- a/Source/CPack/cmCPackNSISGenerator.cxx +++ b/Source/CPack/cmCPackNSISGenerator.cxx @@ -13,7 +13,6 @@ #include "cmCPackNSISGenerator.h" #include "cmGlobalGenerator.h" -#include "cmLocalGenerator.h" #include "cmSystemTools.h" #include "cmMakefile.h" #include "cmGeneratedFileStream.h" diff --git a/Source/CPack/cmCPackOSXX11Generator.cxx b/Source/CPack/cmCPackOSXX11Generator.cxx index d533af87a..8940f5415 100644 --- a/Source/CPack/cmCPackOSXX11Generator.cxx +++ b/Source/CPack/cmCPackOSXX11Generator.cxx @@ -13,7 +13,6 @@ #include "cmake.h" #include "cmGlobalGenerator.h" -#include "cmLocalGenerator.h" #include "cmSystemTools.h" #include "cmMakefile.h" #include "cmGeneratedFileStream.h" diff --git a/Source/CPack/cmCPackPackageMakerGenerator.cxx b/Source/CPack/cmCPackPackageMakerGenerator.cxx index 880663f7e..8fdc03660 100644 --- a/Source/CPack/cmCPackPackageMakerGenerator.cxx +++ b/Source/CPack/cmCPackPackageMakerGenerator.cxx @@ -13,7 +13,6 @@ #include "cmake.h" #include "cmGlobalGenerator.h" -#include "cmLocalGenerator.h" #include "cmSystemTools.h" #include "cmMakefile.h" #include "cmGeneratedFileStream.h" diff --git a/Source/CPack/cmCPackSTGZGenerator.cxx b/Source/CPack/cmCPackSTGZGenerator.cxx index 109dcb71f..68b893f6f 100644 --- a/Source/CPack/cmCPackSTGZGenerator.cxx +++ b/Source/CPack/cmCPackSTGZGenerator.cxx @@ -14,7 +14,6 @@ #include "cmake.h" #include "cmGlobalGenerator.h" -#include "cmLocalGenerator.h" #include "cmSystemTools.h" #include "cmMakefile.h" #include "cmCPackLog.h" diff --git a/Source/CPack/cpack.cxx b/Source/CPack/cpack.cxx index 213b7eff7..f6447eceb 100644 --- a/Source/CPack/cpack.cxx +++ b/Source/CPack/cpack.cxx @@ -18,7 +18,6 @@ #include "cmCPackGenerator.h" #include "cmake.h" #include "cmGlobalGenerator.h" -#include "cmLocalGenerator.h" #include "cmMakefile.h" #include "cmCPackLog.h" diff --git a/Source/CTest/cmCTestBuildHandler.cxx b/Source/CTest/cmCTestBuildHandler.cxx index 6dbb2451c..0d74f48f2 100644 --- a/Source/CTest/cmCTestBuildHandler.cxx +++ b/Source/CTest/cmCTestBuildHandler.cxx @@ -15,7 +15,6 @@ #include "cmCTest.h" #include "cmake.h" #include "cmMakefile.h" -#include "cmLocalGenerator.h" #include "cmGlobalGenerator.h" #include "cmGeneratedFileStream.h" #include "cmXMLWriter.h" diff --git a/Source/CTest/cmCTestStartCommand.cxx b/Source/CTest/cmCTestStartCommand.cxx index e19e4f41e..36576c540 100644 --- a/Source/CTest/cmCTestStartCommand.cxx +++ b/Source/CTest/cmCTestStartCommand.cxx @@ -12,7 +12,6 @@ #include "cmCTestStartCommand.h" #include "cmCTest.h" -#include "cmLocalGenerator.h" #include "cmGlobalGenerator.h" #include "cmCTestVC.h" #include "cmGeneratedFileStream.h" diff --git a/Source/CTest/cmCTestUpdateHandler.cxx b/Source/CTest/cmCTestUpdateHandler.cxx index 963e50173..bf2f34ac7 100644 --- a/Source/CTest/cmCTestUpdateHandler.cxx +++ b/Source/CTest/cmCTestUpdateHandler.cxx @@ -15,7 +15,6 @@ #include "cmCTest.h" #include "cmake.h" #include "cmMakefile.h" -#include "cmLocalGenerator.h" #include "cmGlobalGenerator.h" #include "cmVersion.h" #include "cmGeneratedFileStream.h" diff --git a/Source/cmAddDependenciesCommand.cxx b/Source/cmAddDependenciesCommand.cxx index 3a7494650..01e525311 100644 --- a/Source/cmAddDependenciesCommand.cxx +++ b/Source/cmAddDependenciesCommand.cxx @@ -10,7 +10,6 @@ See the License for more information. ============================================================================*/ #include "cmAddDependenciesCommand.h" -#include "cmLocalGenerator.h" #include "cmGlobalGenerator.h" // cmDependenciesCommand diff --git a/Source/cmBuildCommand.cxx b/Source/cmBuildCommand.cxx index 62fafa5d5..64d4fcaad 100644 --- a/Source/cmBuildCommand.cxx +++ b/Source/cmBuildCommand.cxx @@ -11,7 +11,6 @@ ============================================================================*/ #include "cmBuildCommand.h" -#include "cmLocalGenerator.h" #include "cmGlobalGenerator.h" //---------------------------------------------------------------------- diff --git a/Source/cmEnableTestingCommand.cxx b/Source/cmEnableTestingCommand.cxx index aa41ef73b..6a7fd4692 100644 --- a/Source/cmEnableTestingCommand.cxx +++ b/Source/cmEnableTestingCommand.cxx @@ -10,7 +10,6 @@ See the License for more information. ============================================================================*/ #include "cmEnableTestingCommand.h" -#include "cmLocalGenerator.h" // we do this in the final pass so that we now the subdirs have all // been defined diff --git a/Source/cmExportCommand.cxx b/Source/cmExportCommand.cxx index 96ea77b2d..6a1d7f34d 100644 --- a/Source/cmExportCommand.cxx +++ b/Source/cmExportCommand.cxx @@ -11,7 +11,6 @@ ============================================================================*/ #include "cmExportCommand.h" #include "cmGlobalGenerator.h" -#include "cmLocalGenerator.h" #include "cmGeneratedFileStream.h" #include "cmake.h" diff --git a/Source/cmFileCommand.cxx b/Source/cmFileCommand.cxx index 87faf8468..df95d9dd6 100644 --- a/Source/cmFileCommand.cxx +++ b/Source/cmFileCommand.cxx @@ -15,7 +15,6 @@ #include "cmHexFileConverter.h" #include "cmInstallType.h" #include "cmFileTimeComparison.h" -#include "cmLocalGenerator.h" #include "cmGlobalGenerator.h" #include "cmCryptoHash.h" #include "cmAlgorithms.h" diff --git a/Source/cmGetCMakePropertyCommand.cxx b/Source/cmGetCMakePropertyCommand.cxx index 248ce5943..1a91183d4 100644 --- a/Source/cmGetCMakePropertyCommand.cxx +++ b/Source/cmGetCMakePropertyCommand.cxx @@ -12,7 +12,6 @@ #include "cmGetCMakePropertyCommand.h" #include "cmGlobalGenerator.h" -#include "cmLocalGenerator.h" #include "cmake.h" #include "cmState.h" #include "cmAlgorithms.h" diff --git a/Source/cmGetPropertyCommand.cxx b/Source/cmGetPropertyCommand.cxx index 4c42f5314..617a8116e 100644 --- a/Source/cmGetPropertyCommand.cxx +++ b/Source/cmGetPropertyCommand.cxx @@ -15,7 +15,6 @@ #include "cmState.h" #include "cmTest.h" #include "cmGlobalGenerator.h" -#include "cmLocalGenerator.h" #include "cmSourceFile.h" #include "cmPropertyDefinition.h" diff --git a/Source/cmSetTargetPropertiesCommand.cxx b/Source/cmSetTargetPropertiesCommand.cxx index 06217bb1f..b1c13ac96 100644 --- a/Source/cmSetTargetPropertiesCommand.cxx +++ b/Source/cmSetTargetPropertiesCommand.cxx @@ -10,7 +10,6 @@ See the License for more information. ============================================================================*/ #include "cmSetTargetPropertiesCommand.h" -#include "cmLocalGenerator.h" #include "cmGlobalGenerator.h" // cmSetTargetPropertiesCommand diff --git a/Source/cmSourceFile.cxx b/Source/cmSourceFile.cxx index 86f0a7a87..37383be7f 100644 --- a/Source/cmSourceFile.cxx +++ b/Source/cmSourceFile.cxx @@ -12,7 +12,6 @@ #include "cmSourceFile.h" #include "cmGlobalGenerator.h" -#include "cmLocalGenerator.h" #include "cmMakefile.h" #include "cmSystemTools.h" #include "cmake.h" diff --git a/Source/cmSourceFileLocation.cxx b/Source/cmSourceFileLocation.cxx index 4a87cc2b3..b8d5c020b 100644 --- a/Source/cmSourceFileLocation.cxx +++ b/Source/cmSourceFileLocation.cxx @@ -12,7 +12,6 @@ #include "cmSourceFileLocation.h" #include "cmMakefile.h" -#include "cmLocalGenerator.h" #include "cmGlobalGenerator.h" #include "cmSystemTools.h" #include "cmAlgorithms.h" From 3709e950f4ed7545a38c2506c19ee90ee58fa920 Mon Sep 17 00:00:00 2001 From: Kitware Robot Date: Tue, 6 Oct 2015 00:01:06 -0400 Subject: [PATCH 033/486] CMake Nightly Date Stamp --- Source/CMakeVersion.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index 1fd599329..d36e648ef 100644 --- a/Source/CMakeVersion.cmake +++ b/Source/CMakeVersion.cmake @@ -1,5 +1,5 @@ # CMake version number components. set(CMake_VERSION_MAJOR 3) set(CMake_VERSION_MINOR 4) -set(CMake_VERSION_PATCH 20151005) +set(CMake_VERSION_PATCH 20151006) #set(CMake_VERSION_RC 1) From 3758af12fab8bc3c6279400621be94c4aa540a70 Mon Sep 17 00:00:00 2001 From: Colin Tracey Date: Fri, 25 Sep 2015 15:06:08 -0500 Subject: [PATCH 034/486] CPackNSIS: Add options to set the bitmap for NSIS installer left side set MUI_WELCOMEFINISHPAGE_BITMAP set MUI_UNWELCOMEFINISHPAGE_BITMAP --- Help/release/dev/cpack-nsis-bitmap.rst | 6 ++++++ Modules/CPackNSIS.cmake | 8 ++++++++ Modules/NSIS.template.in | 2 ++ Source/CPack/cmCPackNSISGenerator.cxx | 22 ++++++++++++++++++++++ 4 files changed, 38 insertions(+) create mode 100644 Help/release/dev/cpack-nsis-bitmap.rst diff --git a/Help/release/dev/cpack-nsis-bitmap.rst b/Help/release/dev/cpack-nsis-bitmap.rst new file mode 100644 index 000000000..c5ccfb546 --- /dev/null +++ b/Help/release/dev/cpack-nsis-bitmap.rst @@ -0,0 +1,6 @@ +cpack-nsis-bitmap +----------------- + +* The :module:`CPackNSIS` module learned new variables to add bitmaps to the + installer. See the :variable:`CPACK_NSIS_MUI_WELCOMEFINISHPAGE_BITMAP` + and :variable:`CPACK_NSIS_MUI_UNWELCOMEFINISHPAGE_BITMAP` variables. diff --git a/Modules/CPackNSIS.cmake b/Modules/CPackNSIS.cmake index c6b3d194a..db5984a66 100644 --- a/Modules/CPackNSIS.cmake +++ b/Modules/CPackNSIS.cmake @@ -30,6 +30,14 @@ # # undocumented. # +# .. variable:: CPACK_NSIS_MUI_WELCOMEFINISHPAGE_BITMAP +# +# The filename of a bitmap to use as the NSIS MUI_WELCOMEFINISHPAGE_BITMAP. +# +# .. variable:: CPACK_NSIS_MUI_UNWELCOMEFINISHPAGE_BITMAP +# +# The filename of a bitmap to use as the NSIS MUI_UNWELCOMEFINISHPAGE_BITMAP. +# # .. variable:: CPACK_NSIS_EXTRA_PREINSTALL_COMMANDS # # Extra NSIS commands that will be added to the beginning of the install diff --git a/Modules/NSIS.template.in b/Modules/NSIS.template.in index 76310af31..1ef3d28c7 100644 --- a/Modules/NSIS.template.in +++ b/Modules/NSIS.template.in @@ -542,6 +542,8 @@ FunctionEnd ; Define some macro setting for the gui @CPACK_NSIS_INSTALLER_MUI_ICON_CODE@ @CPACK_NSIS_INSTALLER_ICON_CODE@ +@CPACK_NSIS_INSTALLER_MUI_WELCOMEFINISH_CODE@ +@CPACK_NSIS_INSTALLER_MUI_UNWELCOMEFINISH_CODE@ @CPACK_NSIS_INSTALLER_MUI_COMPONENTS_DESC@ @CPACK_NSIS_INSTALLER_MUI_FINISHPAGE_RUN_CODE@ diff --git a/Source/CPack/cmCPackNSISGenerator.cxx b/Source/CPack/cmCPackNSISGenerator.cxx index 6cdda2832..705b864a6 100644 --- a/Source/CPack/cmCPackNSISGenerator.cxx +++ b/Source/CPack/cmCPackNSISGenerator.cxx @@ -158,6 +158,28 @@ int cmCPackNSISGenerator::PackageFiles() installerIconCode.c_str()); } + if (this->IsSet("CPACK_NSIS_MUI_WELCOMEFINISHPAGE_BITMAP")) + { + std::string installerBitmapCode = + "!define MUI_WELCOMEFINISHPAGE_BITMAP \""; + installerBitmapCode += + this->GetOption("CPACK_NSIS_MUI_WELCOMEFINISHPAGE_BITMAP"); + installerBitmapCode += "\"\n"; + this->SetOptionIfNotSet("CPACK_NSIS_INSTALLER_MUI_WELCOMEFINISH_CODE", + installerBitmapCode.c_str()); + } + + if (this->IsSet("CPACK_NSIS_MUI_UNWELCOMEFINISHPAGE_BITMAP")) + { + std::string installerBitmapCode = + "!define MUI_UNWELCOMEFINISHPAGE_BITMAP \""; + installerBitmapCode += + this->GetOption("CPACK_NSIS_MUI_UNWELCOMEFINISHPAGE_BITMAP"); + installerBitmapCode += "\"\n"; + this->SetOptionIfNotSet("CPACK_NSIS_INSTALLER_MUI_UNWELCOMEFINISH_CODE", + installerBitmapCode.c_str()); + } + if(this->IsSet("CPACK_NSIS_MUI_FINISHPAGE_RUN")) { std::string installerRunCode = "!define MUI_FINISHPAGE_RUN \"$INSTDIR\\"; From 8bb908b1084b5db1a6f8197a4d26b67984587ee4 Mon Sep 17 00:00:00 2001 From: Tamas Kenez Date: Mon, 5 Oct 2015 22:12:30 +0200 Subject: [PATCH 035/486] Document and test CMAKE_[CURRENT_](BINARY|SOURCE)_DIR in script mode --- Help/variable/CMAKE_BINARY_DIR.rst | 5 +++++ Help/variable/CMAKE_CURRENT_BINARY_DIR.rst | 5 +++++ Help/variable/CMAKE_CURRENT_SOURCE_DIR.rst | 5 +++++ Help/variable/CMAKE_SOURCE_DIR.rst | 5 +++++ Tests/RunCMake/CommandLine/P_working-dir.cmake | 14 ++++++++++++++ Tests/RunCMake/CommandLine/RunCMakeTest.cmake | 1 + 6 files changed, 35 insertions(+) create mode 100644 Tests/RunCMake/CommandLine/P_working-dir.cmake diff --git a/Help/variable/CMAKE_BINARY_DIR.rst b/Help/variable/CMAKE_BINARY_DIR.rst index f8dd8ab8d..3b323b7ae 100644 --- a/Help/variable/CMAKE_BINARY_DIR.rst +++ b/Help/variable/CMAKE_BINARY_DIR.rst @@ -6,3 +6,8 @@ The path to the top level of the build tree. This is the full path to the top level of the current CMake build tree. For an in-source build, this would be the same as :variable:`CMAKE_SOURCE_DIR`. + +When run in -P script mode, CMake sets the variables +:variable:`CMAKE_BINARY_DIR`, :variable:`CMAKE_SOURCE_DIR`, +:variable:`CMAKE_CURRENT_BINARY_DIR` and +:variable:`CMAKE_CURRENT_SOURCE_DIR` to the current working directory. diff --git a/Help/variable/CMAKE_CURRENT_BINARY_DIR.rst b/Help/variable/CMAKE_CURRENT_BINARY_DIR.rst index cc3b63987..40496b5d9 100644 --- a/Help/variable/CMAKE_CURRENT_BINARY_DIR.rst +++ b/Help/variable/CMAKE_CURRENT_BINARY_DIR.rst @@ -8,3 +8,8 @@ processed by cmake. Each directory added by :command:`add_subdirectory` will create a binary directory in the build tree, and as it is being processed this variable will be set. For in-source builds this is the current source directory being processed. + +When run in -P script mode, CMake sets the variables +:variable:`CMAKE_BINARY_DIR`, :variable:`CMAKE_SOURCE_DIR`, +:variable:`CMAKE_CURRENT_BINARY_DIR` and +:variable:`CMAKE_CURRENT_SOURCE_DIR` to the current working directory. diff --git a/Help/variable/CMAKE_CURRENT_SOURCE_DIR.rst b/Help/variable/CMAKE_CURRENT_SOURCE_DIR.rst index db063a4b7..c1b755a0e 100644 --- a/Help/variable/CMAKE_CURRENT_SOURCE_DIR.rst +++ b/Help/variable/CMAKE_CURRENT_SOURCE_DIR.rst @@ -5,3 +5,8 @@ The path to the source directory currently being processed. This the full path to the source directory that is currently being processed by cmake. + +When run in -P script mode, CMake sets the variables +:variable:`CMAKE_BINARY_DIR`, :variable:`CMAKE_SOURCE_DIR`, +:variable:`CMAKE_CURRENT_BINARY_DIR` and +:variable:`CMAKE_CURRENT_SOURCE_DIR` to the current working directory. diff --git a/Help/variable/CMAKE_SOURCE_DIR.rst b/Help/variable/CMAKE_SOURCE_DIR.rst index 3df0226dc..416fbe1a8 100644 --- a/Help/variable/CMAKE_SOURCE_DIR.rst +++ b/Help/variable/CMAKE_SOURCE_DIR.rst @@ -6,3 +6,8 @@ The path to the top level of the source tree. This is the full path to the top level of the current CMake source tree. For an in-source build, this would be the same as :variable:`CMAKE_BINARY_DIR`. + +When run in -P script mode, CMake sets the variables +:variable:`CMAKE_BINARY_DIR`, :variable:`CMAKE_SOURCE_DIR`, +:variable:`CMAKE_CURRENT_BINARY_DIR` and +:variable:`CMAKE_CURRENT_SOURCE_DIR` to the current working directory. diff --git a/Tests/RunCMake/CommandLine/P_working-dir.cmake b/Tests/RunCMake/CommandLine/P_working-dir.cmake new file mode 100644 index 000000000..4ea029382 --- /dev/null +++ b/Tests/RunCMake/CommandLine/P_working-dir.cmake @@ -0,0 +1,14 @@ +if(NOT IS_DIRECTORY "${EXPECTED_WORKING_DIR}") + message(FATAL_ERROR "EXPECTED_WORKING_DIR is not a directory: ${EXPECTED_WORKING_DIR}") +endif() + +foreach(d CMAKE_BINARY_DIR CMAKE_CURRENT_BINARY_DIR CMAKE_SOURCE_DIR CMAKE_CURRENT_SOURCE_DIR) + if(NOT DEFINED ${d}) + message(FATAL_ERROR "${d} is not defined") + endif() + if(EXPECTED_WORKING_DIR STREQUAL "${${d}}") + message(STATUS "${d} is the expected working directory (${EXPECTED_WORKING_DIR})") + else() + message(FATAL_ERROR "${d} = \"${${d}}\" is not the expected working directory (${EXPECTED_WORKING_DIR})") + endif() +endforeach() diff --git a/Tests/RunCMake/CommandLine/RunCMakeTest.cmake b/Tests/RunCMake/CommandLine/RunCMakeTest.cmake index cef636852..2d94e298f 100644 --- a/Tests/RunCMake/CommandLine/RunCMakeTest.cmake +++ b/Tests/RunCMake/CommandLine/RunCMakeTest.cmake @@ -115,6 +115,7 @@ run_cmake_command(E_sleep-bad-arg2 ${CMAKE_COMMAND} -E sleep 1 -1) run_cmake_command(E_sleep-one-tenth ${CMAKE_COMMAND} -E sleep 0.1) run_cmake_command(P_directory ${CMAKE_COMMAND} -P ${RunCMake_SOURCE_DIR}) +run_cmake_command(P_working-dir ${CMAKE_COMMAND} -DEXPECTED_WORKING_DIR=${RunCMake_BINARY_DIR}/P_working-dir-build -P ${RunCMake_SOURCE_DIR}/P_working-dir.cmake) set(RunCMake_TEST_OPTIONS "-DFOO=-DBAR:BOOL=BAZ") From fab35c95cbf47e583cbf86b1db1ac3e77ce7035e Mon Sep 17 00:00:00 2001 From: Brad King Date: Tue, 6 Oct 2015 10:13:28 -0400 Subject: [PATCH 036/486] Utilities/Release: Move cygwin packages to a subdirectory --- Utilities/Release/dash2win64_cygwin.cmake | 2 ++ Utilities/Release/release_cmake.cmake | 19 +++++++++++++------ 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/Utilities/Release/dash2win64_cygwin.cmake b/Utilities/Release/dash2win64_cygwin.cmake index c0cd76103..ca590ed1f 100644 --- a/Utilities/Release/dash2win64_cygwin.cmake +++ b/Utilities/Release/dash2win64_cygwin.cmake @@ -28,4 +28,6 @@ get_filename_component(path "${CMAKE_CURRENT_LIST_FILE}" PATH) # allows us to produce cygwin builds in the short term. set(EXTRA_CTEST_ARGS "-E ExternalProject") +set(LOCAL_DIR cygwin) + include(${path}/release_cmake.cmake) diff --git a/Utilities/Release/release_cmake.cmake b/Utilities/Release/release_cmake.cmake index 4c4dd8a5b..c50602dad 100644 --- a/Utilities/Release/release_cmake.cmake +++ b/Utilities/Release/release_cmake.cmake @@ -119,27 +119,34 @@ foreach(gen ${generators}) set(SUFFIXES ${SUFFIXES} "*.exe") endif() endforeach() + +if(LOCAL_DIR) + file(MAKE_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/${LOCAL_DIR}") +else() + set(LOCAL_DIR .) +endif() + # copy all the files over from the remote machine set(PROJECT_PREFIX cmake-) foreach(suffix ${SUFFIXES}) - message("scp ${HOST}:${FINAL_PATH}/${PROJECT_PREFIX}${suffix} .") + message("scp ${HOST}:${FINAL_PATH}/${PROJECT_PREFIX}${suffix} ${LOCAL_DIR}") execute_process(COMMAND - scp ${HOST}:${FINAL_PATH}/${PROJECT_PREFIX}${suffix} . + scp ${HOST}:${FINAL_PATH}/${PROJECT_PREFIX}${suffix} ${LOCAL_DIR} RESULT_VARIABLE result) if(${result} GREATER 0) - message("error getting file back scp ${HOST}:${FINAL_PATH}/${PROJECT_PREFIX}${suffix} .") + message("error getting file back scp ${HOST}:${FINAL_PATH}/${PROJECT_PREFIX}${suffix} ${LOCAL_DIR}") endif() endforeach() # if there are extra files to copy get them as well if(extra_files) foreach(f ${extra_files}) - message("scp ${HOST}:${FINAL_PATH}/${f} .") + message("scp ${HOST}:${FINAL_PATH}/${f} ${LOCAL_DIR}") execute_process(COMMAND - scp ${HOST}:${FINAL_PATH}/${f} . + scp ${HOST}:${FINAL_PATH}/${f} ${LOCAL_DIR} RESULT_VARIABLE result) if(${result} GREATER 0) - message("error getting file back scp ${HOST}:${FINAL_PATH}/${f} .") + message("error getting file back scp ${HOST}:${FINAL_PATH}/${f} ${LOCAL_DIR}") endif() endforeach() endif() From b6702d40dd9ab512a8cd56dd202ebe8cdbdb03d9 Mon Sep 17 00:00:00 2001 From: Terrell Russell Date: Mon, 5 Oct 2015 21:42:19 -0400 Subject: [PATCH 037/486] Modules: Fix spelling of "succeeded" in check messages Change "succeded" to "succeeded" everywhere. --- Modules/CheckCSourceCompiles.cmake | 2 +- Modules/CheckCSourceRuns.cmake | 2 +- Modules/CheckCXXSourceCompiles.cmake | 2 +- Modules/CheckCXXSourceRuns.cmake | 2 +- Modules/CheckFortranSourceCompiles.cmake | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Modules/CheckCSourceCompiles.cmake b/Modules/CheckCSourceCompiles.cmake index 6e80fb535..c2b172311 100644 --- a/Modules/CheckCSourceCompiles.cmake +++ b/Modules/CheckCSourceCompiles.cmake @@ -93,7 +93,7 @@ macro(CHECK_C_SOURCE_COMPILES SOURCE VAR) message(STATUS "Performing Test ${VAR} - Success") endif() file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log - "Performing C SOURCE FILE Test ${VAR} succeded with the following output:\n" + "Performing C SOURCE FILE Test ${VAR} succeeded with the following output:\n" "${OUTPUT}\n" "Source file was:\n${SOURCE}\n") else() diff --git a/Modules/CheckCSourceRuns.cmake b/Modules/CheckCSourceRuns.cmake index 0ce423c1f..5afeab685 100644 --- a/Modules/CheckCSourceRuns.cmake +++ b/Modules/CheckCSourceRuns.cmake @@ -81,7 +81,7 @@ macro(CHECK_C_SOURCE_RUNS SOURCE VAR) message(STATUS "Performing Test ${VAR} - Success") endif() file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log - "Performing C SOURCE FILE Test ${VAR} succeded with the following output:\n" + "Performing C SOURCE FILE Test ${VAR} succeeded with the following output:\n" "${OUTPUT}\n" "Return value: ${${VAR}}\n" "Source file was:\n${SOURCE}\n") diff --git a/Modules/CheckCXXSourceCompiles.cmake b/Modules/CheckCXXSourceCompiles.cmake index 6d52ec6b8..f8736e216 100644 --- a/Modules/CheckCXXSourceCompiles.cmake +++ b/Modules/CheckCXXSourceCompiles.cmake @@ -94,7 +94,7 @@ macro(CHECK_CXX_SOURCE_COMPILES SOURCE VAR) message(STATUS "Performing Test ${VAR} - Success") endif() file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log - "Performing C++ SOURCE FILE Test ${VAR} succeded with the following output:\n" + "Performing C++ SOURCE FILE Test ${VAR} succeeded with the following output:\n" "${OUTPUT}\n" "Source file was:\n${SOURCE}\n") else() diff --git a/Modules/CheckCXXSourceRuns.cmake b/Modules/CheckCXXSourceRuns.cmake index 3c06d7540..84b661d15 100644 --- a/Modules/CheckCXXSourceRuns.cmake +++ b/Modules/CheckCXXSourceRuns.cmake @@ -82,7 +82,7 @@ macro(CHECK_CXX_SOURCE_RUNS SOURCE VAR) message(STATUS "Performing Test ${VAR} - Success") endif() file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log - "Performing C++ SOURCE FILE Test ${VAR} succeded with the following output:\n" + "Performing C++ SOURCE FILE Test ${VAR} succeeded with the following output:\n" "${OUTPUT}\n" "Return value: ${${VAR}}\n" "Source file was:\n${SOURCE}\n") diff --git a/Modules/CheckFortranSourceCompiles.cmake b/Modules/CheckFortranSourceCompiles.cmake index f90d05bd6..0bdcffa8c 100644 --- a/Modules/CheckFortranSourceCompiles.cmake +++ b/Modules/CheckFortranSourceCompiles.cmake @@ -94,7 +94,7 @@ macro(CHECK_Fortran_SOURCE_COMPILES SOURCE VAR) message(STATUS "Performing Test ${VAR} - Success") endif() file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log - "Performing Fortran SOURCE FILE Test ${VAR} succeded with the following output:\n" + "Performing Fortran SOURCE FILE Test ${VAR} succeeded with the following output:\n" "${OUTPUT}\n" "Source file was:\n${SOURCE}\n") else() From 062473842f3c926944cbc2a32c7703bc1204890d Mon Sep 17 00:00:00 2001 From: Terrell Russell Date: Mon, 5 Oct 2015 21:42:19 -0400 Subject: [PATCH 038/486] bootstrap: Fix spelling of "succeeded" --- bootstrap | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bootstrap b/bootstrap index 31e9b898a..ca4fd5ecc 100755 --- a/bootstrap +++ b/bootstrap @@ -572,7 +572,7 @@ cmake_try_run () echo "Test produced non-zero return code" return 3 fi - echo "Test succeded" + echo "Test succeeded" return 0 } From bca73252130b7f60fc12b7bcbbc95a3153047bd3 Mon Sep 17 00:00:00 2001 From: KWSys Robot Date: Tue, 6 Oct 2015 10:28:20 -0400 Subject: [PATCH 039/486] KWSys 2015-10-06 (d79801bb) Extract upstream KWSys using the following shell commands. $ git archive --prefix=upstream-kwsys/ d79801bb | tar x $ git shortlog --no-merges --abbrev=8 --format='%h %s' 2089567a..d79801bb Brad King (1): e56e3292 Encoding: Support building on Windows with WIN32_LEAN_AND_MEAN Terrell Russell (1): d79801bb SystemTools: Fix spelling of "succeeded" in comments --- EncodingCXX.cxx | 1 + SystemTools.hxx.in | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/EncodingCXX.cxx b/EncodingCXX.cxx index 7d9b3e4d8..597d4bd19 100644 --- a/EncodingCXX.cxx +++ b/EncodingCXX.cxx @@ -38,6 +38,7 @@ // Windows API. #if defined(_WIN32) # include +# include #endif namespace KWSYS_NAMESPACE diff --git a/SystemTools.hxx.in b/SystemTools.hxx.in index d2d1d4006..bba5a5cd3 100644 --- a/SystemTools.hxx.in +++ b/SystemTools.hxx.in @@ -703,13 +703,13 @@ public: /** * Create a symbolic link if the platform supports it. Returns whether - * creation succeded. + * creation succeeded. */ static bool CreateSymlink(const std::string& origName, const std::string& newName); /** * Read the contents of a symbolic link. Returns whether reading - * succeded. + * succeeded. */ static bool ReadSymlink(const std::string& newName, std::string& origName); From 15c02cf14edd823b96660e65772a9db568a25bdc Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Mon, 5 Oct 2015 19:21:30 +0200 Subject: [PATCH 040/486] QtAutogen: Port API to cmGeneratorTarget. --- Source/cmGlobalGenerator.cxx | 7 +- Source/cmQtAutoGeneratorInitializer.cxx | 106 ++++++++++-------------- Source/cmQtAutoGeneratorInitializer.h | 9 +- 3 files changed, 53 insertions(+), 69 deletions(-) diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx index 21ada7133..309884fb9 100644 --- a/Source/cmGlobalGenerator.cxx +++ b/Source/cmGlobalGenerator.cxx @@ -1267,7 +1267,7 @@ bool cmGlobalGenerator::Compute() for (std::vector::iterator it = autogenTargets.begin(); it != autogenTargets.end(); ++it) { - cmQtAutoGeneratorInitializer::SetupAutoGenerateTarget((*it)->Target); + cmQtAutoGeneratorInitializer::SetupAutoGenerateTarget(*it); } #endif @@ -1451,15 +1451,14 @@ cmGlobalGenerator::CreateQtAutoGeneratorsTargets() cmGeneratorTarget* gt = this->GetGeneratorTarget(&ti->second); - cmQtAutoGeneratorInitializer::InitializeAutogenSources(gt->Target); + cmQtAutoGeneratorInitializer::InitializeAutogenSources(gt); filteredTargets.push_back(gt); } for(std::vector::iterator ti = filteredTargets.begin(); ti != filteredTargets.end(); ++ti) { - cmTarget* target = (*ti)->Target; cmQtAutoGeneratorInitializer::InitializeAutogenTarget( - this->LocalGenerators[i], target); + this->LocalGenerators[i], *ti); autogenTargets.push_back(*ti); } } diff --git a/Source/cmQtAutoGeneratorInitializer.cxx b/Source/cmQtAutoGeneratorInitializer.cxx index fe888b7be..2703f4c99 100644 --- a/Source/cmQtAutoGeneratorInitializer.cxx +++ b/Source/cmQtAutoGeneratorInitializer.cxx @@ -25,19 +25,16 @@ # include "cmGlobalVisualStudioGenerator.h" #endif -static void SetupSourceFiles(cmTarget const* target, +static void SetupSourceFiles(cmGeneratorTarget const* target, std::vector& skipMoc, std::vector& mocSources, std::vector& mocHeaders, std::vector& skipUic) { - cmMakefile* makefile = target->GetMakefile(); + cmMakefile* makefile = target->Target->GetMakefile(); std::vector srcFiles; - cmGeneratorTarget *gtgt = target->GetMakefile() - ->GetGlobalGenerator() - ->GetGeneratorTarget(target); - gtgt->GetConfigCommonSourceFiles(srcFiles); + target->GetConfigCommonSourceFiles(srcFiles); std::vector newRccFiles; @@ -67,7 +64,7 @@ static void SetupSourceFiles(cmTarget const* target, std::string basename = cmsys::SystemTools:: GetFilenameWithoutLastExtension(absFile); - std::string rcc_output_dir = target->GetSupportDirectory(); + std::string rcc_output_dir = target->Target->GetSupportDirectory(); cmSystemTools::MakeDirectory(rcc_output_dir.c_str()); std::string rcc_output_file = rcc_output_dir; rcc_output_file += "/qrc_" + basename + ".cpp"; @@ -104,40 +101,38 @@ static void SetupSourceFiles(cmTarget const* target, fileIt != newRccFiles.end(); ++fileIt) { - const_cast(target)->AddSource(*fileIt); + const_cast(target->Target)->AddSource(*fileIt); } } -static void GetCompileDefinitionsAndDirectories(cmTarget const* target, - const std::string& config, - std::string &incs, - std::string &defs) +static void GetCompileDefinitionsAndDirectories( + cmGeneratorTarget const* target, + const std::string& config, + std::string &incs, + std::string &defs) { - cmMakefile* makefile = target->GetMakefile(); - cmGlobalGenerator* globalGen = makefile->GetGlobalGenerator(); std::vector includeDirs; - cmGeneratorTarget *gtgt = globalGen->GetGeneratorTarget(target); - cmLocalGenerator *localGen = gtgt->GetLocalGenerator(); + cmLocalGenerator *localGen = target->GetLocalGenerator(); // Get the include dirs for this target, without stripping the implicit // include dirs off, see http://public.kitware.com/Bug/view.php?id=13667 - localGen->GetIncludeDirectories(includeDirs, gtgt, "CXX", config, false); + localGen->GetIncludeDirectories(includeDirs, target, "CXX", config, false); incs = cmJoin(includeDirs, ";"); std::set defines; - localGen->AddCompileDefinitions(defines, target, config, "CXX"); + localGen->AddCompileDefinitions(defines, target->Target, config, "CXX"); defs += cmJoin(defines, ";"); } -static void SetupAutoMocTarget(cmTarget const* target, +static void SetupAutoMocTarget(cmGeneratorTarget const* target, const std::string &autogenTargetName, std::vector const& skipMoc, std::vector const& mocHeaders, std::map &configIncludes, std::map &configDefines) { - cmMakefile* makefile = target->GetMakefile(); + cmMakefile* makefile = target->Target->GetMakefile(); const char* tmp = target->GetProperty("AUTOMOC_MOC_OPTIONS"); std::string _moc_options = (tmp!=0 ? tmp : ""); @@ -222,22 +217,20 @@ static void SetupAutoMocTarget(cmTarget const* target, } } -static void GetUicOpts(cmTarget const* target, const std::string& config, +static void GetUicOpts(cmGeneratorTarget const* target, + const std::string& config, std::string &optString) { - cmGeneratorTarget *gtgt = target->GetMakefile() - ->GetGlobalGenerator() - ->GetGeneratorTarget(target); std::vector opts; - gtgt->GetAutoUicOptions(opts, config); + target->GetAutoUicOptions(opts, config); optString = cmJoin(opts, ";"); } -static void SetupAutoUicTarget(cmTarget const* target, +static void SetupAutoUicTarget(cmGeneratorTarget const* target, std::vector const& skipUic, std::map &configUicOptions) { - cmMakefile *makefile = target->GetMakefile(); + cmMakefile *makefile = target->Target->GetMakefile(); std::set skipped; skipped.insert(skipUic.begin(), skipUic.end()); @@ -340,12 +333,9 @@ static void SetupAutoUicTarget(cmTarget const* target, } } -static std::string GetRccExecutable(cmTarget const* target) +static std::string GetRccExecutable(cmGeneratorTarget const* target) { - cmGeneratorTarget *gtgt = target->GetMakefile() - ->GetGlobalGenerator() - ->GetGeneratorTarget(target); - cmMakefile *makefile = target->GetMakefile(); + cmMakefile *makefile = target->Target->GetMakefile(); const char *qtVersion = makefile->GetDefinition("_target_qt_version"); if (!qtVersion) { @@ -355,7 +345,8 @@ static std::string GetRccExecutable(cmTarget const* target) qtVersion = makefile->GetDefinition("QT_VERSION_MAJOR"); } if (const char *targetQtVersion = - gtgt->GetLinkInterfaceDependentStringProperty("QT_MAJOR_VERSION", "")) + target->GetLinkInterfaceDependentStringProperty("QT_MAJOR_VERSION", + "")) { qtVersion = targetQtVersion; } @@ -434,7 +425,7 @@ static void MergeRccOptions(std::vector &opts, } std::string GetAutogenTargetName( - cmTarget const* target) + cmGeneratorTarget const* target) { std::string autogenTargetName = target->GetName(); autogenTargetName += "_automoc"; @@ -442,9 +433,9 @@ std::string GetAutogenTargetName( } std::string GetAutogenTargetDir( - cmTarget const* target) + cmGeneratorTarget const* target) { - cmMakefile* makefile = target->GetMakefile(); + cmMakefile* makefile = target->Target->GetMakefile(); std::string targetDir = makefile->GetCurrentBinaryDirectory(); targetDir += makefile->GetCMakeInstance()->GetCMakeFilesDirectory(); targetDir += "/"; @@ -485,7 +476,7 @@ static std::string ReadAll(const std::string& filename) } static std::string ListQt5RccInputs(cmSourceFile* sf, - cmTarget const* target, + cmGeneratorTarget const* target, std::vector& depends) { std::string rccCommand @@ -591,17 +582,14 @@ static std::string ListQt4RccInputs(cmSourceFile* sf, return entriesList; } -static void SetupAutoRccTarget(cmTarget const* target) +static void SetupAutoRccTarget(cmGeneratorTarget const* target) { std::string _rcc_files; const char* sepRccFiles = ""; - cmMakefile *makefile = target->GetMakefile(); + cmMakefile *makefile = target->Target->GetMakefile(); std::vector srcFiles; - cmGeneratorTarget *gtgt = target->GetMakefile() - ->GetGlobalGenerator() - ->GetGeneratorTarget(target); - gtgt->GetConfigCommonSourceFiles(srcFiles); + target->GetConfigCommonSourceFiles(srcFiles); std::string qrcInputs; const char* qrcInputsSep = ""; @@ -705,9 +693,10 @@ static void SetupAutoRccTarget(cmTarget const* target) GetRccExecutable(target).c_str()); } -void cmQtAutoGeneratorInitializer::InitializeAutogenSources(cmTarget* target) +void cmQtAutoGeneratorInitializer::InitializeAutogenSources( + cmGeneratorTarget* target) { - cmMakefile* makefile = target->GetMakefile(); + cmMakefile* makefile = target->Target->GetMakefile(); if (target->GetPropertyAsBool("AUTOMOC")) { @@ -720,15 +709,15 @@ void cmQtAutoGeneratorInitializer::InitializeAutogenSources(cmTarget* target) makefile->AppendProperty("ADDITIONAL_MAKE_CLEAN_FILES", mocCppFile.c_str(), false); - target->AddSource(mocCppFile); + target->Target->AddSource(mocCppFile); } } void cmQtAutoGeneratorInitializer::InitializeAutogenTarget( cmLocalGenerator* lg, - cmTarget* target) + cmGeneratorTarget* target) { - cmMakefile* makefile = target->GetMakefile(); + cmMakefile* makefile = target->Target->GetMakefile(); std::string qtMajorVersion = makefile->GetSafeDefinition("QT_VERSION_MAJOR"); if (qtMajorVersion == "") @@ -825,9 +814,7 @@ void cmQtAutoGeneratorInitializer::InitializeAutogenTarget( ) { std::vector srcFiles; - cmGeneratorTarget* gtgt = - lg->GetGlobalGenerator()->GetGeneratorTarget(target); - gtgt->GetConfigCommonSourceFiles(srcFiles); + target->GetConfigCommonSourceFiles(srcFiles); for(std::vector::const_iterator fileIt = srcFiles.begin(); fileIt != srcFiles.end(); ++fileIt) @@ -846,7 +833,7 @@ void cmQtAutoGeneratorInitializer::InitializeAutogenTarget( std::string basename = cmsys::SystemTools:: GetFilenameWithoutLastExtension(absFile); - std::string rcc_output_dir = target->GetSupportDirectory(); + std::string rcc_output_dir = target->Target->GetSupportDirectory(); cmSystemTools::MakeDirectory(rcc_output_dir.c_str()); std::string rcc_output_file = rcc_output_dir; rcc_output_file += "/qrc_" + basename + ".cpp"; @@ -887,7 +874,7 @@ void cmQtAutoGeneratorInitializer::InitializeAutogenTarget( workingDirectory.c_str()); cc.SetEscapeOldStyle(false); cc.SetEscapeAllowMakeVars(true); - target->AddPreBuildCommand(cc); + target->Target->AddPreBuildCommand(cc); } else #endif @@ -916,17 +903,17 @@ void cmQtAutoGeneratorInitializer::InitializeAutogenTarget( else { // inherit FOLDER property from target (#13688) - copyTargetProperty(autogenTarget, target, "FOLDER"); + copyTargetProperty(gt->Target, target->Target, "FOLDER"); } - target->AddUtility(autogenTargetName); + target->Target->AddUtility(autogenTargetName); } } void cmQtAutoGeneratorInitializer::SetupAutoGenerateTarget( - cmTarget const* target) + cmGeneratorTarget const* target) { - cmMakefile* makefile = target->GetMakefile(); + cmMakefile* makefile = target->Target->GetMakefile(); // forget the variables added here afterwards again: cmMakefile::ScopePushPop varScope(makefile); @@ -947,11 +934,8 @@ void cmQtAutoGeneratorInitializer::SetupAutoGenerateTarget( { qtVersion = makefile->GetDefinition("QT_VERSION_MAJOR"); } - cmGeneratorTarget *gtgt = target->GetMakefile() - ->GetGlobalGenerator() - ->GetGeneratorTarget(target); if (const char *targetQtVersion = - gtgt->GetLinkInterfaceDependentStringProperty("QT_MAJOR_VERSION", "")) + target->GetLinkInterfaceDependentStringProperty("QT_MAJOR_VERSION", "")) { qtVersion = targetQtVersion; } diff --git a/Source/cmQtAutoGeneratorInitializer.h b/Source/cmQtAutoGeneratorInitializer.h index ad5c85c73..eaf140d26 100644 --- a/Source/cmQtAutoGeneratorInitializer.h +++ b/Source/cmQtAutoGeneratorInitializer.h @@ -21,15 +21,16 @@ #include class cmSourceFile; -class cmTarget; +class cmGeneratorTarget; class cmLocalGenerator; class cmQtAutoGeneratorInitializer { public: - static void InitializeAutogenSources(cmTarget* target); - static void InitializeAutogenTarget(cmLocalGenerator* lg, cmTarget* target); - static void SetupAutoGenerateTarget(cmTarget const* target); + static void InitializeAutogenSources(cmGeneratorTarget* target); + static void InitializeAutogenTarget(cmLocalGenerator* lg, + cmGeneratorTarget* target); + static void SetupAutoGenerateTarget(cmGeneratorTarget const* target); }; #endif From 6b575dec8d393c4a38c587ee97afa068eeb4b432 Mon Sep 17 00:00:00 2001 From: Wayne Stambaugh Date: Sat, 3 Oct 2015 11:40:00 -0400 Subject: [PATCH 041/486] FindOpenSSL: Tolerate tabs in header while parsing version (#15765) Tolerate tabs instead of spaces in the "# define" line. --- Modules/FindOpenSSL.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Modules/FindOpenSSL.cmake b/Modules/FindOpenSSL.cmake index a0f4c524b..3aea6954e 100644 --- a/Modules/FindOpenSSL.cmake +++ b/Modules/FindOpenSSL.cmake @@ -325,7 +325,7 @@ endfunction() if (OPENSSL_INCLUDE_DIR) if(OPENSSL_INCLUDE_DIR AND EXISTS "${OPENSSL_INCLUDE_DIR}/openssl/opensslv.h") file(STRINGS "${OPENSSL_INCLUDE_DIR}/openssl/opensslv.h" openssl_version_str - REGEX "^# *define[\t ]+OPENSSL_VERSION_NUMBER[\t ]+0x([0-9a-fA-F])+.*") + REGEX "^#[\t ]*define[\t ]+OPENSSL_VERSION_NUMBER[\t ]+0x([0-9a-fA-F])+.*") # The version number is encoded as 0xMNNFFPPS: major minor fix patch status # The status gives if this is a developer or prerelease and is ignored here. From 1bf66fed674bc1b7c463bd230f7c66df8aa86e79 Mon Sep 17 00:00:00 2001 From: Wayne Stambaugh Date: Sat, 3 Oct 2015 11:40:00 -0400 Subject: [PATCH 042/486] FindOpenSSL: Search for unix-named libraries first on MinGW (#15765) Generalize the change made by commit v2.8.10~228^2~4 (FindOpenSSL: find cross-compiled OpenSSL from MinGW, 2012-07-23) to be used on builds hosted on Windows too. When building for MinGW, consider library names that come with MinGW before looking for the main Windows distribution of OpenSSL. --- Modules/FindOpenSSL.cmake | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/Modules/FindOpenSSL.cmake b/Modules/FindOpenSSL.cmake index 3aea6954e..8b4b9883a 100644 --- a/Modules/FindOpenSSL.cmake +++ b/Modules/FindOpenSSL.cmake @@ -200,12 +200,8 @@ if(WIN32 AND NOT CYGWIN) set(OPENSSL_LIBRARIES ${SSL_EAY_LIBRARY} ${LIB_EAY_LIBRARY} ) elseif(MINGW) # same player, for MinGW - set(LIB_EAY_NAMES libeay32) - set(SSL_EAY_NAMES ssleay32) - if(CMAKE_CROSSCOMPILING) - list(APPEND LIB_EAY_NAMES crypto) - list(APPEND SSL_EAY_NAMES ssl) - endif() + set(LIB_EAY_NAMES crypto libeay32) + set(SSL_EAY_NAMES ssl ssleay32) find_library(LIB_EAY NAMES ${LIB_EAY_NAMES} From 26a0b52dfe94bad42e1f249aa0341dd1fbbc38cc Mon Sep 17 00:00:00 2001 From: Brad King Date: Tue, 6 Oct 2015 13:56:19 -0400 Subject: [PATCH 043/486] Tests: Rename Linux nightly release binary test to Linux32 Distinguish the name from a future 64-bit nightly binary. --- Tests/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt index 1861d82e9..2b23360d3 100644 --- a/Tests/CMakeLists.txt +++ b/Tests/CMakeLists.txt @@ -689,7 +689,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DDIR=dev -P ${CMake_SOURCE_DIR}/Utilities/Release dash2win64_release.cmake) ADD_NIGHTLY_BUILD_TEST(CMakeNightlyOSX dashmacmini5_release.cmake) - ADD_NIGHTLY_BUILD_TEST(CMakeNightlyLinux + ADD_NIGHTLY_BUILD_TEST(CMakeNightlyLinux32 magrathea_release.cmake) endif() From b520b1ca4ec3d51a031d44a25080931c5bb73b83 Mon Sep 17 00:00:00 2001 From: Brad King Date: Tue, 6 Oct 2015 13:58:45 -0400 Subject: [PATCH 044/486] Tests: Add a nightly Linux 64-bit binary --- Tests/CMakeLists.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt index 2b23360d3..3f28c2522 100644 --- a/Tests/CMakeLists.txt +++ b/Tests/CMakeLists.txt @@ -691,6 +691,8 @@ ${CMake_BINARY_DIR}/bin/cmake -DDIR=dev -P ${CMake_SOURCE_DIR}/Utilities/Release dashmacmini5_release.cmake) ADD_NIGHTLY_BUILD_TEST(CMakeNightlyLinux32 magrathea_release.cmake) + ADD_NIGHTLY_BUILD_TEST(CMakeNightlyLinux64 + linux64_release.cmake) endif() # add tests with more complex invocations From 9d653f9c1cc129be4fdce7f0e93c282760c7603e Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Sat, 29 Aug 2015 18:05:46 +0200 Subject: [PATCH 045/486] cmFLTKWrapUI: Remove CMake 2.2 compat code. CMake 3.0 dropped CMake <= 2.4 compatibility. --- Source/cmFLTKWrapUICommand.cxx | 39 ---------------------------------- 1 file changed, 39 deletions(-) diff --git a/Source/cmFLTKWrapUICommand.cxx b/Source/cmFLTKWrapUICommand.cxx index 12adfd929..d17d6646f 100644 --- a/Source/cmFLTKWrapUICommand.cxx +++ b/Source/cmFLTKWrapUICommand.cxx @@ -129,45 +129,6 @@ void cmFLTKWrapUICommand::FinalPass() cmSystemTools::Message(msg.c_str(),"Warning"); return; } - std::vector srcs; - target->GetSourceFiles(srcs, ""); - bool found = false; - for (unsigned int i = 0; i < srcs.size(); ++i) - { - if (srcs[i]->GetFullPath() == - this->GeneratedSourcesClasses[0]->GetFullPath()) - { - found = true; - break; - } - } - if (!found) - { - std::string msg = - "In CMake 2.2 the FLTK_WRAP_UI command sets a variable to the list of " - "source files that should be added to your executable or library. It " - "appears that you have not added these source files to your target. " - "You should change your CMakeLists.txt file to " - "directly add the generated files to the target. " - "For example FTLK_WRAP_UI(foo src1 src2 src3) " - "will create a variable named foo_FLTK_UI_SRCS that contains the list " - "of sources to add to your target when you call ADD_LIBRARY or " - "ADD_EXECUTABLE. For now CMake will add the sources to your target " - "for you as was done in CMake 2.0 and earlier. In the future this may " - "become an error."; - msg +="The problem was found while processing the source directory: "; - msg += this->Makefile->GetCurrentSourceDirectory(); - cmSystemTools::Message(msg.c_str(),"Warning"); - // first we add the rules for all the .fl to .h and .cxx files - size_t lastHeadersClass = this->GeneratedSourcesClasses.size(); - - // Generate code for all the .fl files - for(size_t classNum = 0; classNum < lastHeadersClass; classNum++) - { - this->Makefile->GetTargets()[this->Target] - .AddSource(this->GeneratedSourcesClasses[classNum]->GetFullPath()); - } - } } From bf28b7874b999224782fac72c5a74020bd6c47d3 Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Sat, 29 Aug 2015 18:47:14 +0200 Subject: [PATCH 046/486] cmGeneratorTarget: Rename internal member. Leave the old name available for another use. --- Source/cmGeneratorTarget.cxx | 6 +++--- Source/cmGeneratorTarget.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx index 62598f439..4ed293919 100644 --- a/Source/cmGeneratorTarget.cxx +++ b/Source/cmGeneratorTarget.cxx @@ -406,8 +406,8 @@ std::string cmGeneratorTarget::GetOutputName(const std::string& config, std::vector const* cmGeneratorTarget::GetSourceDepends(cmSourceFile const* sf) const { - SourceEntriesType::const_iterator i = this->SourceEntries.find(sf); - if(i != this->SourceEntries.end()) + SourceEntriesType::const_iterator i = this->SourceDepends.find(sf); + if(i != this->SourceDepends.end()) { return &i->second.Depends; } @@ -1723,7 +1723,7 @@ void cmTargetTraceDependencies::Trace() // Get the next source from the queue. cmSourceFile* sf = this->SourceQueue.front(); this->SourceQueue.pop(); - this->CurrentEntry = &this->GeneratorTarget->SourceEntries[sf]; + this->CurrentEntry = &this->GeneratorTarget->SourceDepends[sf]; // Queue dependencies added explicitly by the user. if(const char* additionalDeps = sf->GetProperty("OBJECT_DEPENDS")) diff --git a/Source/cmGeneratorTarget.h b/Source/cmGeneratorTarget.h index 916f2819c..6d5641b5d 100644 --- a/Source/cmGeneratorTarget.h +++ b/Source/cmGeneratorTarget.h @@ -370,7 +370,7 @@ private: friend class cmTargetTraceDependencies; struct SourceEntry { std::vector Depends; }; typedef std::map SourceEntriesType; - SourceEntriesType SourceEntries; + SourceEntriesType SourceDepends; mutable std::map Objects; std::set ExplicitObjectName; mutable std::map > SystemIncludesCache; From 01e666c70e9c83ebd8c200d121b706868f69e617 Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Sat, 29 Aug 2015 18:32:24 +0200 Subject: [PATCH 047/486] cmTarget: Join strings conditionally. --- Source/cmTarget.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx index bb4495678..7fd8d86a4 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -768,9 +768,9 @@ void cmTarget::GetSourceFiles(std::vector &files, //---------------------------------------------------------------------------- void cmTarget::AddTracedSources(std::vector const& srcs) { - std::string srcFiles = cmJoin(srcs, ";"); - if (!srcFiles.empty()) + if (!srcs.empty()) { + std::string srcFiles = cmJoin(srcs, ";"); this->Internal->SourceFilesMap.clear(); this->LinkImplementationLanguageIsContextDependent = true; cmListFileBacktrace lfbt = this->Makefile->GetBacktrace(); From 156bd2c983b439478dff5fe84629b5a93e780a92 Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Thu, 24 Sep 2015 22:03:12 +0200 Subject: [PATCH 048/486] Xcode: Port away from unnecessary CMP0049 compatibility. The input does not need the conversion. --- Source/cmGlobalXCodeGenerator.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx index 746e1a73c..64fa12a71 100644 --- a/Source/cmGlobalXCodeGenerator.cxx +++ b/Source/cmGlobalXCodeGenerator.cxx @@ -463,7 +463,7 @@ cmGlobalXCodeGenerator::AddExtraTargets(cmLocalGenerator* root, std::string listfile = mf->GetCurrentSourceDirectory(); listfile += "/"; listfile += "CMakeLists.txt"; - allbuild->AddSourceCMP0049(listfile.c_str()); + allbuild->AddSource(listfile.c_str()); // Add XCODE depend helper std::string dir = mf->GetCurrentBinaryDirectory(); @@ -557,7 +557,7 @@ cmGlobalXCodeGenerator::AddExtraTargets(cmLocalGenerator* root, listfile = lg->GetMakefile()->GetCurrentSourceDirectory(); listfile += "/"; listfile += "CMakeLists.txt"; - target.AddSourceCMP0049(listfile.c_str()); + target.AddSource(listfile.c_str()); } } } From f716460ed82134bd1ca09f49bfa507cb2645d96c Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Tue, 6 Oct 2015 00:04:30 +0200 Subject: [PATCH 049/486] cmMakefile: Move invokation to initialize snapshot. --- Source/cmMakefile.cxx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index 077470da9..e52232050 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -1472,8 +1472,6 @@ void cmMakefile::AddLinkLibrary(const std::string& lib) void cmMakefile::InitializeFromParent(cmMakefile* parent) { - this->StateSnapshot.InitializeFromParent(); - this->AddDefinition("CMAKE_CURRENT_SOURCE_DIR", this->GetCurrentSourceDirectory()); this->AddDefinition("CMAKE_CURRENT_BINARY_DIR", @@ -1755,6 +1753,9 @@ void cmMakefile::AddSubDirectory(const std::string& srcPath, // set the subdirs start dirs subMf->SetCurrentSourceDirectory(srcPath); subMf->SetCurrentBinaryDirectory(binPath); + + subMf->StateSnapshot.InitializeFromParent(); + if(excludeFromAll) { subMf->SetProperty("EXCLUDE_FROM_ALL", "TRUE"); From 2c4f9023360103ca7489ef821038c3b64a5415fc Mon Sep 17 00:00:00 2001 From: Kitware Robot Date: Wed, 7 Oct 2015 00:01:07 -0400 Subject: [PATCH 050/486] CMake Nightly Date Stamp --- Source/CMakeVersion.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index d36e648ef..a4b06d472 100644 --- a/Source/CMakeVersion.cmake +++ b/Source/CMakeVersion.cmake @@ -1,5 +1,5 @@ # CMake version number components. set(CMake_VERSION_MAJOR 3) set(CMake_VERSION_MINOR 4) -set(CMake_VERSION_PATCH 20151006) +set(CMake_VERSION_PATCH 20151007) #set(CMake_VERSION_RC 1) From 7ce0991a7a29e244aee3f61e9e8b1879e59d156c Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Tue, 6 Oct 2015 22:35:28 +0200 Subject: [PATCH 051/486] GHS: Port API to cmGeneratorTarget. --- Source/cmGhsMultiTargetGenerator.cxx | 14 ++++++++------ Source/cmGhsMultiTargetGenerator.h | 4 ++-- Source/cmGlobalGhsMultiGenerator.cxx | 3 ++- 3 files changed, 12 insertions(+), 9 deletions(-) diff --git a/Source/cmGhsMultiTargetGenerator.cxx b/Source/cmGhsMultiTargetGenerator.cxx index cae5c2f46..46ea2f3e8 100644 --- a/Source/cmGhsMultiTargetGenerator.cxx +++ b/Source/cmGhsMultiTargetGenerator.cxx @@ -27,7 +27,7 @@ cmGhsMultiTargetGenerator::cmGhsMultiTargetGenerator(cmGeneratorTarget *target) , LocalGenerator(static_cast( target->GetLocalGenerator())) , Makefile(target->Target->GetMakefile()) - , TargetGroup(DetermineIfTargetGroup(target->Target)) + , TargetGroup(DetermineIfTargetGroup(target)) , DynamicDownload(false) { this->RelBuildFilePath = this->GetRelBuildFilePath(target->Target); @@ -178,10 +178,11 @@ std::vector cmGhsMultiTargetGenerator::GetSources() const GhsMultiGpj::Types cmGhsMultiTargetGenerator::GetGpjTag() const { - return cmGhsMultiTargetGenerator::GetGpjTag(this->Target); + return cmGhsMultiTargetGenerator::GetGpjTag(this->GeneratorTarget); } -GhsMultiGpj::Types cmGhsMultiTargetGenerator::GetGpjTag(const cmTarget *target) +GhsMultiGpj::Types cmGhsMultiTargetGenerator::GetGpjTag( + const cmGeneratorTarget *target) { GhsMultiGpj::Types output; if (cmGhsMultiTargetGenerator::DetermineIfTargetGroup(target)) @@ -566,13 +567,14 @@ bool cmGhsMultiTargetGenerator::IsNotKernel(std::string const &config, return output; } -bool cmGhsMultiTargetGenerator::DetermineIfTargetGroup(const cmTarget *target) +bool cmGhsMultiTargetGenerator::DetermineIfTargetGroup( + const cmGeneratorTarget *target) { bool output = false; std::vector sources; std::string config = - target->GetMakefile()->GetSafeDefinition("CMAKE_BUILD_TYPE"); - target->GetSourceFiles(sources, config); + target->Target->GetMakefile()->GetSafeDefinition("CMAKE_BUILD_TYPE"); + target->Target->GetSourceFiles(sources, config); for (std::vector::const_iterator sources_i = sources.begin(); sources.end() != sources_i; ++sources_i) { diff --git a/Source/cmGhsMultiTargetGenerator.h b/Source/cmGhsMultiTargetGenerator.h index c29a31ead..d1c17f4e1 100644 --- a/Source/cmGhsMultiTargetGenerator.h +++ b/Source/cmGhsMultiTargetGenerator.h @@ -36,7 +36,7 @@ public: bool IncludeThisTarget(); std::vector GetSources() const; GhsMultiGpj::Types GetGpjTag() const; - static GhsMultiGpj::Types GetGpjTag(const cmTarget *target); + static GhsMultiGpj::Types GetGpjTag(const cmGeneratorTarget* target); const char *GetAbsBuildFilePath() const { return this->AbsBuildFilePath.c_str(); @@ -95,7 +95,7 @@ private: std::string GetOutputFilename(const std::string &config) const; bool IsNotKernel(std::string const &config, const std::string &language); - static bool DetermineIfTargetGroup(const cmTarget *target); + static bool DetermineIfTargetGroup(const cmGeneratorTarget* target); bool DetermineIfDynamicDownload(std::string const &config, const std::string &language); diff --git a/Source/cmGlobalGhsMultiGenerator.cxx b/Source/cmGlobalGhsMultiGenerator.cxx index 6dde1e387..1ad727a0c 100644 --- a/Source/cmGlobalGhsMultiGenerator.cxx +++ b/Source/cmGlobalGhsMultiGenerator.cxx @@ -509,7 +509,8 @@ void cmGlobalGhsMultiGenerator::UpdateBuildFiles( splitPath.back()); *this->TargetFolderBuildStreams[folderName] << foldNameRelBuildFile << " "; - GhsMultiGpj::WriteGpjTag(cmGhsMultiTargetGenerator::GetGpjTag(tgt), + GhsMultiGpj::WriteGpjTag(cmGhsMultiTargetGenerator::GetGpjTag( + tgtsI->second), this->TargetFolderBuildStreams[folderName]); } } From 5d3776a7ebb718ae6ed4724e0a8961cda68b6316 Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Sat, 29 Aug 2015 17:51:15 +0200 Subject: [PATCH 052/486] Access sources through cmGeneratorTarget. --- Source/cmExtraCodeBlocksGenerator.cxx | 4 +++- Source/cmExtraCodeLiteGenerator.cxx | 4 +++- Source/cmExtraEclipseCDT4Generator.cxx | 4 +++- Source/cmExtraSublimeTextGenerator.cxx | 2 +- Source/cmGeneratorTarget.cxx | 8 ++++---- Source/cmGhsMultiTargetGenerator.cxx | 4 ++-- Source/cmGlobalGenerator.cxx | 4 +++- Source/cmGlobalGhsMultiGenerator.cxx | 3 ++- Source/cmGlobalKdevelopGenerator.cxx | 4 +++- Source/cmMakefileTargetGenerator.cxx | 2 +- Source/cmNinjaNormalTargetGenerator.cxx | 2 +- Source/cmNinjaUtilityTargetGenerator.cxx | 2 +- 12 files changed, 27 insertions(+), 16 deletions(-) diff --git a/Source/cmExtraCodeBlocksGenerator.cxx b/Source/cmExtraCodeBlocksGenerator.cxx index dfd51c754..7915a6e25 100644 --- a/Source/cmExtraCodeBlocksGenerator.cxx +++ b/Source/cmExtraCodeBlocksGenerator.cxx @@ -401,7 +401,9 @@ void cmExtraCodeBlocksGenerator case cmTarget::UTILITY: // can have sources since 2.6.3 { std::vector sources; - ti->second.GetSourceFiles(sources, + cmGeneratorTarget* gt = + this->GlobalGenerator->GetGeneratorTarget(&ti->second); + gt->GetSourceFiles(sources, makefile->GetSafeDefinition("CMAKE_BUILD_TYPE")); for (std::vector::const_iterator si=sources.begin(); si!=sources.end(); si++) diff --git a/Source/cmExtraCodeLiteGenerator.cxx b/Source/cmExtraCodeLiteGenerator.cxx index c2cff14a1..496c1a8d4 100644 --- a/Source/cmExtraCodeLiteGenerator.cxx +++ b/Source/cmExtraCodeLiteGenerator.cxx @@ -196,7 +196,9 @@ void cmExtraCodeLiteGenerator case cmTarget::MODULE_LIBRARY: { std::vector sources; - ti->second.GetSourceFiles(sources, + cmGeneratorTarget* gt = + this->GlobalGenerator->GetGeneratorTarget(&ti->second); + gt->GetSourceFiles(sources, makefile->GetSafeDefinition("CMAKE_BUILD_TYPE")); for (std::vector::const_iterator si=sources.begin(); si!=sources.end(); si++) diff --git a/Source/cmExtraEclipseCDT4Generator.cxx b/Source/cmExtraEclipseCDT4Generator.cxx index 44bf586ef..6dc18c2cf 100644 --- a/Source/cmExtraEclipseCDT4Generator.cxx +++ b/Source/cmExtraEclipseCDT4Generator.cxx @@ -562,7 +562,9 @@ void cmExtraEclipseCDT4Generator::CreateLinksForTargets( // get the files from the source lists then add them to the groups cmTarget* tgt = const_cast(&ti->second); std::vector files; - tgt->GetSourceFiles(files, + cmGeneratorTarget* gt = + this->GlobalGenerator->GetGeneratorTarget(tgt); + gt->GetSourceFiles(files, makefile->GetSafeDefinition("CMAKE_BUILD_TYPE")); for(std::vector::const_iterator sfIt = files.begin(); sfIt != files.end(); diff --git a/Source/cmExtraSublimeTextGenerator.cxx b/Source/cmExtraSublimeTextGenerator.cxx index 163a75bb4..11410a7ef 100644 --- a/Source/cmExtraSublimeTextGenerator.cxx +++ b/Source/cmExtraSublimeTextGenerator.cxx @@ -237,7 +237,7 @@ void cmExtraSublimeTextGenerator:: cmGeneratorTarget *gtgt = this->GlobalGenerator ->GetGeneratorTarget(target); std::vector sourceFiles; - target->GetSourceFiles(sourceFiles, + gtgt->GetSourceFiles(sourceFiles, makefile->GetSafeDefinition("CMAKE_BUILD_TYPE")); std::vector::const_iterator sourceFilesEnd = sourceFiles.end(); diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx index 4ed293919..3a865fcd1 100644 --- a/Source/cmGeneratorTarget.cxx +++ b/Source/cmGeneratorTarget.cxx @@ -449,7 +449,7 @@ static void handleSystemIncludesDep(cmMakefile *mf, cmTarget const* depTgt, #define IMPLEMENT_VISIT_IMPL(DATA, DATATYPE) \ { \ std::vector sourceFiles; \ - this->Target->GetSourceFiles(sourceFiles, config); \ + this->GetSourceFiles(sourceFiles, config); \ TagVisitor visitor(this, data); \ for(std::vector::const_iterator si = sourceFiles.begin(); \ si != sourceFiles.end(); ++si) \ @@ -1683,7 +1683,7 @@ cmTargetTraceDependencies ci != configs.end(); ++ci) { std::vector sources; - this->Target->GetSourceFiles(sources, *ci); + this->GeneratorTarget->GetSourceFiles(sources, *ci); for(std::vector::const_iterator si = sources.begin(); si != sources.end(); ++si) { @@ -4444,12 +4444,12 @@ bool cmGeneratorTarget::GetConfigCommonSourceFiles( std::vector::const_iterator it = configs.begin(); const std::string& firstConfig = *it; - this->Target->GetSourceFiles(files, firstConfig); + this->GetSourceFiles(files, firstConfig); for ( ; it != configs.end(); ++it) { std::vector configFiles; - this->Target->GetSourceFiles(configFiles, *it); + this->GetSourceFiles(configFiles, *it); if (configFiles != files) { std::string firstConfigFiles; diff --git a/Source/cmGhsMultiTargetGenerator.cxx b/Source/cmGhsMultiTargetGenerator.cxx index 46ea2f3e8..bfcef4303 100644 --- a/Source/cmGhsMultiTargetGenerator.cxx +++ b/Source/cmGhsMultiTargetGenerator.cxx @@ -172,7 +172,7 @@ std::vector cmGhsMultiTargetGenerator::GetSources() const { std::vector output; std::string config = this->Makefile->GetSafeDefinition("CMAKE_BUILD_TYPE"); - this->Target->GetSourceFiles(output, config); + this->GeneratorTarget->GetSourceFiles(output, config); return output; } @@ -574,7 +574,7 @@ bool cmGhsMultiTargetGenerator::DetermineIfTargetGroup( std::vector sources; std::string config = target->Target->GetMakefile()->GetSafeDefinition("CMAKE_BUILD_TYPE"); - target->Target->GetSourceFiles(sources, config); + target->GetSourceFiles(sources, config); for (std::vector::const_iterator sources_i = sources.begin(); sources.end() != sources_i; ++sources_i) { diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx index 05f10292d..db842b032 100644 --- a/Source/cmGlobalGenerator.cxx +++ b/Source/cmGlobalGenerator.cxx @@ -2949,10 +2949,12 @@ void cmGlobalGenerator::WriteSummary(cmTarget* target) { configs.push_back(""); } + cmGeneratorTarget* gt = + this->GetGeneratorTarget(target); for(std::vector::const_iterator ci = configs.begin(); ci != configs.end(); ++ci) { - target->GetSourceFiles(sources, *ci); + gt->GetSourceFiles(sources, *ci); } std::vector::const_iterator sourcesEnd = cmRemoveDuplicates(sources); diff --git a/Source/cmGlobalGhsMultiGenerator.cxx b/Source/cmGlobalGhsMultiGenerator.cxx index 1ad727a0c..87cf58f36 100644 --- a/Source/cmGlobalGhsMultiGenerator.cxx +++ b/Source/cmGlobalGhsMultiGenerator.cxx @@ -521,7 +521,8 @@ bool cmGlobalGhsMultiGenerator::IsTgtForBuild(const cmTarget *tgt) const std::string config = tgt->GetMakefile()->GetSafeDefinition("CMAKE_BUILD_TYPE"); std::vector tgtSources; - tgt->GetSourceFiles(tgtSources, config); + cmGeneratorTarget* gt = this->GetGeneratorTarget(tgt); + gt->GetSourceFiles(tgtSources, config); bool tgtInBuild = true; char const *excludeFromAll = tgt->GetProperty("EXCLUDE_FROM_ALL"); if (NULL != excludeFromAll && '1' == excludeFromAll[0] && diff --git a/Source/cmGlobalKdevelopGenerator.cxx b/Source/cmGlobalKdevelopGenerator.cxx index 138ddbbbc..c40f846ae 100644 --- a/Source/cmGlobalKdevelopGenerator.cxx +++ b/Source/cmGlobalKdevelopGenerator.cxx @@ -139,7 +139,9 @@ bool cmGlobalKdevelopGenerator ti != targets.end(); ti++) { std::vector sources; - ti->second.GetSourceFiles(sources, ti->second.GetMakefile() + cmGeneratorTarget* gt = + this->GlobalGenerator->GetGeneratorTarget(&ti->second); + gt->GetSourceFiles(sources, ti->second.GetMakefile() ->GetSafeDefinition("CMAKE_BUILD_TYPE")); for (std::vector::const_iterator si=sources.begin(); si!=sources.end(); si++) diff --git a/Source/cmMakefileTargetGenerator.cxx b/Source/cmMakefileTargetGenerator.cxx index b278087ff..cd499f685 100644 --- a/Source/cmMakefileTargetGenerator.cxx +++ b/Source/cmMakefileTargetGenerator.cxx @@ -1149,7 +1149,7 @@ cmMakefileTargetGenerator { // Depend on all custom command outputs. std::vector sources; - this->Target->GetSourceFiles(sources, + this->GeneratorTarget->GetSourceFiles(sources, this->Makefile->GetSafeDefinition("CMAKE_BUILD_TYPE")); for(std::vector::const_iterator source = sources.begin(); source != sources.end(); ++source) diff --git a/Source/cmNinjaNormalTargetGenerator.cxx b/Source/cmNinjaNormalTargetGenerator.cxx index 84c19a30a..24fcaf4c9 100644 --- a/Source/cmNinjaNormalTargetGenerator.cxx +++ b/Source/cmNinjaNormalTargetGenerator.cxx @@ -112,7 +112,7 @@ void cmNinjaNormalTargetGenerator::WriteLanguagesRules() // Write rules for languages compiled in this target. std::set languages; std::vector sourceFiles; - this->GetTarget()->GetSourceFiles(sourceFiles, + this->GetGeneratorTarget()->GetSourceFiles(sourceFiles, this->GetMakefile()->GetSafeDefinition("CMAKE_BUILD_TYPE")); for(std::vector::const_iterator i = sourceFiles.begin(); i != sourceFiles.end(); ++i) diff --git a/Source/cmNinjaUtilityTargetGenerator.cxx b/Source/cmNinjaUtilityTargetGenerator.cxx index 58b901a9f..df43c6195 100644 --- a/Source/cmNinjaUtilityTargetGenerator.cxx +++ b/Source/cmNinjaUtilityTargetGenerator.cxx @@ -58,7 +58,7 @@ void cmNinjaUtilityTargetGenerator::Generate() std::vector sources; std::string config = this->GetMakefile() ->GetSafeDefinition("CMAKE_BUILD_TYPE"); - this->GetTarget()->GetSourceFiles(sources, config); + this->GetGeneratorTarget()->GetSourceFiles(sources, config); for(std::vector::const_iterator source = sources.begin(); source != sources.end(); ++source) { From c38e30f68c7beffdc65af0f3799ae82ce60aaf67 Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Sat, 29 Aug 2015 18:10:19 +0200 Subject: [PATCH 053/486] cmGeneratorTarget: Add methods for generate-time source addition. --- Source/cmGeneratorTarget.cxx | 12 +++++++++++- Source/cmGeneratorTarget.h | 3 +++ Source/cmGlobalVisualStudio8Generator.cxx | 2 +- Source/cmGlobalXCodeGenerator.cxx | 13 ++++++++----- Source/cmLocalVisualStudio6Generator.cxx | 6 ++++-- Source/cmLocalVisualStudio7Generator.cxx | 8 ++++++-- Source/cmQtAutoGeneratorInitializer.cxx | 4 ++-- 7 files changed, 35 insertions(+), 13 deletions(-) diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx index 3a865fcd1..dc399d8c8 100644 --- a/Source/cmGeneratorTarget.cxx +++ b/Source/cmGeneratorTarget.cxx @@ -402,6 +402,16 @@ std::string cmGeneratorTarget::GetOutputName(const std::string& config, return i->second; } +void cmGeneratorTarget::AddSource(const std::string& src) +{ + this->Target->AddSource(src); +} + +void cmGeneratorTarget::AddTracedSources(std::vector const& srcs) +{ + this->Target->AddTracedSources(srcs); +} + //---------------------------------------------------------------------------- std::vector const* cmGeneratorTarget::GetSourceDepends(cmSourceFile const* sf) const @@ -1755,7 +1765,7 @@ void cmTargetTraceDependencies::Trace() } this->CurrentEntry = 0; - this->Target->AddTracedSources(this->NewSources); + this->GeneratorTarget->AddTracedSources(this->NewSources); } //---------------------------------------------------------------------------- diff --git a/Source/cmGeneratorTarget.h b/Source/cmGeneratorTarget.h index 6d5641b5d..0c6ad8299 100644 --- a/Source/cmGeneratorTarget.h +++ b/Source/cmGeneratorTarget.h @@ -296,6 +296,9 @@ public: // Get the target base name. std::string GetOutputName(const std::string& config, bool implib) const; + void AddSource(const std::string& src); + void AddTracedSources(std::vector const& srcs); + /** * Flags for a given source file as used in this target. Typically assigned * via SET_TARGET_PROPERTIES when the property is a list of source files. diff --git a/Source/cmGlobalVisualStudio8Generator.cxx b/Source/cmGlobalVisualStudio8Generator.cxx index 86a8f8799..ab9d7e72e 100644 --- a/Source/cmGlobalVisualStudio8Generator.cxx +++ b/Source/cmGlobalVisualStudio8Generator.cxx @@ -336,7 +336,7 @@ bool cmGlobalVisualStudio8Generator::AddCheckTarget() no_main_dependency, commandLines, "Checking Build System", no_working_directory, true)) { - tgt->AddSource(file->GetFullPath()); + gt->AddSource(file->GetFullPath()); } else { diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx index 64fa12a71..3d52e3af5 100644 --- a/Source/cmGlobalXCodeGenerator.cxx +++ b/Source/cmGlobalXCodeGenerator.cxx @@ -463,7 +463,7 @@ cmGlobalXCodeGenerator::AddExtraTargets(cmLocalGenerator* root, std::string listfile = mf->GetCurrentSourceDirectory(); listfile += "/"; listfile += "CMakeLists.txt"; - allbuild->AddSource(listfile.c_str()); + allBuildGt->AddSource(listfile.c_str()); // Add XCODE depend helper std::string dir = mf->GetCurrentBinaryDirectory(); @@ -553,11 +553,13 @@ cmGlobalXCodeGenerator::AddExtraTargets(cmLocalGenerator* root, allbuild->AddUtility(target.GetName()); } + cmGeneratorTarget* targetGT = this->GetGeneratorTarget(&target); + // Refer to the build configuration file for easy editing. listfile = lg->GetMakefile()->GetCurrentSourceDirectory(); listfile += "/"; listfile += "CMakeLists.txt"; - target.AddSource(listfile.c_str()); + targetGT->AddSource(listfile.c_str()); } } } @@ -1401,7 +1403,7 @@ void cmGlobalXCodeGenerator::ForceLinkerLanguage(cmTarget& cmtarget) if(cmSourceFile* sf = mf->GetOrCreateSource(fname.c_str())) { sf->SetProperty("LANGUAGE", llang.c_str()); - cmtarget.AddSource(fname); + gtgt->AddSource(fname); } } @@ -3069,17 +3071,18 @@ bool cmGlobalXCodeGenerator::CreateGroups(cmLocalGenerator* root, continue; } + cmGeneratorTarget* gtgt = this->GetGeneratorTarget(&cmtarget); + // add the soon to be generated Info.plist file as a source for a // MACOSX_BUNDLE file if(cmtarget.GetPropertyAsBool("MACOSX_BUNDLE")) { std::string plist = this->ComputeInfoPListLocation(cmtarget); mf->GetOrCreateSource(plist, true); - cmtarget.AddSource(plist); + gtgt->AddSource(plist); } std::vector classes; - cmGeneratorTarget* gtgt = this->GetGeneratorTarget(&cmtarget); if (!gtgt->GetConfigCommonSourceFiles(classes)) { return false; diff --git a/Source/cmLocalVisualStudio6Generator.cxx b/Source/cmLocalVisualStudio6Generator.cxx index cc94cd474..ab215d142 100644 --- a/Source/cmLocalVisualStudio6Generator.cxx +++ b/Source/cmLocalVisualStudio6Generator.cxx @@ -243,7 +243,8 @@ void cmLocalVisualStudio6Generator::AddDSPBuildRule(cmTarget& tgt) no_working_directory, true); if(this->Makefile->GetSource(makefileIn.c_str())) { - tgt.AddSource(makefileIn); + cmGeneratorTarget* gt = this->GlobalGenerator->GetGeneratorTarget(&tgt); + gt->AddSource(makefileIn); } else { @@ -595,7 +596,8 @@ cmLocalVisualStudio6Generator origCommand.GetCommandLines(), comment, origCommand.GetWorkingDirectory().c_str())) { - target.AddSource(outsf->GetFullPath()); + cmGeneratorTarget* gt = this->GlobalGenerator->GetGeneratorTarget(&target); + gt->AddSource(outsf->GetFullPath()); } // Replace the dependencies with the output of this rule so that the diff --git a/Source/cmLocalVisualStudio7Generator.cxx b/Source/cmLocalVisualStudio7Generator.cxx index a4bce8aa9..892456460 100644 --- a/Source/cmLocalVisualStudio7Generator.cxx +++ b/Source/cmLocalVisualStudio7Generator.cxx @@ -112,7 +112,9 @@ void cmLocalVisualStudio7Generator::AddCMakeListsRules() } if(l->first != CMAKE_CHECK_BUILD_SYSTEM_TARGET) { - l->second.AddSource(sf->GetFullPath()); + cmGeneratorTarget* gt = + this->GlobalGenerator->GetGeneratorTarget(&l->second); + gt->AddSource(sf->GetFullPath()); } } } @@ -148,7 +150,9 @@ void cmLocalVisualStudio7Generator::FixGlobalTargets() force.c_str(), no_depends, no_main_dependency, force_commands, " ", 0, true)) { - tgt.AddSource(file->GetFullPath()); + cmGeneratorTarget* gt = + this->GlobalGenerator->GetGeneratorTarget(&tgt); + gt->AddSource(file->GetFullPath()); } } } diff --git a/Source/cmQtAutoGeneratorInitializer.cxx b/Source/cmQtAutoGeneratorInitializer.cxx index 2703f4c99..378f13254 100644 --- a/Source/cmQtAutoGeneratorInitializer.cxx +++ b/Source/cmQtAutoGeneratorInitializer.cxx @@ -101,7 +101,7 @@ static void SetupSourceFiles(cmGeneratorTarget const* target, fileIt != newRccFiles.end(); ++fileIt) { - const_cast(target->Target)->AddSource(*fileIt); + const_cast(target)->AddSource(*fileIt); } } @@ -709,7 +709,7 @@ void cmQtAutoGeneratorInitializer::InitializeAutogenSources( makefile->AppendProperty("ADDITIONAL_MAKE_CLEAN_FILES", mocCppFile.c_str(), false); - target->Target->AddSource(mocCppFile); + target->AddSource(mocCppFile); } } From 64f73150b8e5e5cad216444c0468e8e59434d973 Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Sat, 12 Sep 2015 21:29:33 +0200 Subject: [PATCH 054/486] cmTarget: Add API for generate-time source addition. This method is a refactoring artifact. It will be removed in a follow-up. --- Source/cmGeneratorTarget.cxx | 2 +- Source/cmTarget.cxx | 5 +++++ Source/cmTarget.h | 1 + 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx index dc399d8c8..83f9cd27a 100644 --- a/Source/cmGeneratorTarget.cxx +++ b/Source/cmGeneratorTarget.cxx @@ -404,7 +404,7 @@ std::string cmGeneratorTarget::GetOutputName(const std::string& config, void cmGeneratorTarget::AddSource(const std::string& src) { - this->Target->AddSource(src); + this->Target->AddGenerateTimeSource(src); } void cmGeneratorTarget::AddTracedSources(std::vector const& srcs) diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx index 7fd8d86a4..16378cc21 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -960,6 +960,11 @@ cmSourceFile* cmTarget::AddSource(const std::string& src) return this->Makefile->GetOrCreateSource(src); } +void cmTarget::AddGenerateTimeSource(const std::string& src) +{ + this->AddSource(src); +} + //---------------------------------------------------------------------------- void cmTarget::MergeLinkLibraries( cmMakefile& mf, const std::string& selfname, diff --git a/Source/cmTarget.h b/Source/cmTarget.h index 3e71dbd1a..cbf2ca95c 100644 --- a/Source/cmTarget.h +++ b/Source/cmTarget.h @@ -145,6 +145,7 @@ public: void AddTracedSources(std::vector const& srcs); cmSourceFile* AddSourceCMP0049(const std::string& src); cmSourceFile* AddSource(const std::string& src); + void AddGenerateTimeSource(const std::string& src); enum LinkLibraryType {GENERAL, DEBUG, OPTIMIZED}; From 776ff8eb0b8d790c63f8ad6bb6689620e6e04cb4 Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Sat, 12 Sep 2015 21:44:52 +0200 Subject: [PATCH 055/486] cmTarget: Add Compute API for sources. This method is a refactoring artifact. It will be removed in a follow-up. --- Source/cmGlobalGenerator.cxx | 1 + Source/cmGlobalVisualStudio8Generator.cxx | 1 + Source/cmGlobalVisualStudioGenerator.cxx | 1 + Source/cmGlobalXCodeGenerator.cxx | 2 ++ Source/cmQtAutoGeneratorInitializer.cxx | 2 ++ Source/cmTarget.cxx | 4 ++++ Source/cmTarget.h | 2 ++ 7 files changed, 13 insertions(+) diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx index db842b032..a62d534a1 100644 --- a/Source/cmGlobalGenerator.cxx +++ b/Source/cmGlobalGenerator.cxx @@ -1538,6 +1538,7 @@ void cmGlobalGenerator::CreateGeneratorTargets(TargetTypes targetTypes, ti != targets.end(); ++ti) { cmTarget* t = &ti->second; + t->Compute(); cmGeneratorTarget* gt = new cmGeneratorTarget(t, lg); this->GeneratorTargets[t] = gt; generatorTargets[t] = gt; diff --git a/Source/cmGlobalVisualStudio8Generator.cxx b/Source/cmGlobalVisualStudio8Generator.cxx index ab9d7e72e..5bace4728 100644 --- a/Source/cmGlobalVisualStudio8Generator.cxx +++ b/Source/cmGlobalVisualStudio8Generator.cxx @@ -254,6 +254,7 @@ bool cmGlobalVisualStudio8Generator::AddCheckTarget() mf->AddUtilityCommand(CMAKE_CHECK_BUILD_SYSTEM_TARGET, false, no_working_directory, no_depends, noCommandLines); + tgt->Compute(); cmGeneratorTarget* gt = new cmGeneratorTarget(tgt, lg); mf->AddGeneratorTarget(tgt, gt); diff --git a/Source/cmGlobalVisualStudioGenerator.cxx b/Source/cmGlobalVisualStudioGenerator.cxx index d45aa2780..fd2d33adf 100644 --- a/Source/cmGlobalVisualStudioGenerator.cxx +++ b/Source/cmGlobalVisualStudioGenerator.cxx @@ -86,6 +86,7 @@ void cmGlobalVisualStudioGenerator::AddExtraIDETargets() no_depends, no_commands, false, "Build all projects"); + allBuild->Compute(); cmGeneratorTarget* gt = new cmGeneratorTarget(allBuild, gen[0]); allBuild->GetMakefile()->AddGeneratorTarget(allBuild, gt); diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx index 3d52e3af5..14bc340a2 100644 --- a/Source/cmGlobalXCodeGenerator.cxx +++ b/Source/cmGlobalXCodeGenerator.cxx @@ -456,6 +456,7 @@ cmGlobalXCodeGenerator::AddExtraTargets(cmLocalGenerator* root, no_working_directory, "echo", "Build all projects"); + allbuild->Compute(); cmGeneratorTarget* allBuildGt = new cmGeneratorTarget(allbuild, root); mf->AddGeneratorTarget(allbuild, allBuildGt); @@ -491,6 +492,7 @@ cmGlobalXCodeGenerator::AddExtraTargets(cmLocalGenerator* root, no_working_directory, "make", "-f", file.c_str()); + check->Compute(); cmGeneratorTarget* checkGt = new cmGeneratorTarget(check, root); mf->AddGeneratorTarget(check, checkGt); } diff --git a/Source/cmQtAutoGeneratorInitializer.cxx b/Source/cmQtAutoGeneratorInitializer.cxx index 378f13254..1b1b98e3b 100644 --- a/Source/cmQtAutoGeneratorInitializer.cxx +++ b/Source/cmQtAutoGeneratorInitializer.cxx @@ -885,6 +885,8 @@ void cmQtAutoGeneratorInitializer::InitializeAutogenTarget( /*byproducts=*/rcc_output, depends, commandLines, false, autogenComment.c_str()); + autogenTarget->Compute(); + cmGeneratorTarget* gt = new cmGeneratorTarget(autogenTarget, lg); makefile->AddGeneratorTarget(autogenTarget, gt); diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx index 16378cc21..515b261c0 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -397,6 +397,10 @@ void CreatePropertyGeneratorExpressions( } } +void cmTarget::Compute() +{ +} + //---------------------------------------------------------------------------- void cmTarget::AddUtility(const std::string& u, cmMakefile *makefile) { diff --git a/Source/cmTarget.h b/Source/cmTarget.h index cbf2ca95c..2f1671d9c 100644 --- a/Source/cmTarget.h +++ b/Source/cmTarget.h @@ -133,6 +133,8 @@ public: void AddPostBuildCommand(cmCustomCommand const &cmd) {this->PostBuildCommands.push_back(cmd);} + void Compute(); + /** * Get the list of the source files used by this target */ From fe113f0fd40696e50ac9aac48297466e3b649ad5 Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Tue, 4 Aug 2015 21:46:15 +0200 Subject: [PATCH 056/486] cmTarget: Split storage of sources from genexes. --- Source/cmTarget.cxx | 89 +++++++++++++++++++++++++-------------------- 1 file changed, 50 insertions(+), 39 deletions(-) diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx index 515b261c0..6e1c4889e 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -126,7 +126,9 @@ public: std::vector CompileFeaturesBacktraces; std::vector CompileDefinitionsEntries; std::vector CompileDefinitionsBacktraces; - std::vector SourceEntries; + std::vector SourceEntries; + std::vector SourceBacktraces; + std::vector SourceItems; std::vector LinkImplementationPropertyEntries; void AddInterfaceEntries( @@ -385,7 +387,8 @@ void cmTarget::SetMakefile(cmMakefile* mf) void CreatePropertyGeneratorExpressions( std::vector const& entries, std::vector const& backtraces, - std::vector& items) + std::vector& items, + bool evaluateForBuildsystem = false) { std::vector::const_iterator btIt = backtraces.begin(); for (std::vector::const_iterator it = entries.begin(); @@ -393,12 +396,17 @@ void CreatePropertyGeneratorExpressions( { cmGeneratorExpression ge(*btIt); cmsys::auto_ptr cge = ge.Parse(*it); + cge->SetEvaluateForBuildsystem(evaluateForBuildsystem); items.push_back(new cmTargetInternals::TargetPropertyEntry(cge)); } } void cmTarget::Compute() { + CreatePropertyGeneratorExpressions( + this->Internal->SourceEntries, + this->Internal->SourceBacktraces, + this->Internal->SourceItems, true); } //---------------------------------------------------------------------------- @@ -649,13 +657,11 @@ void cmTarget::GetSourceFiles(std::vector &files, // for TARGET_OBJECTS instead for backwards compatibility with OLD // behavior of CMP0024 and CMP0026 only. - typedef cmTargetInternals::TargetPropertyEntry - TargetPropertyEntry; - for(std::vector::const_iterator + for(std::vector::const_iterator i = this->Internal->SourceEntries.begin(); i != this->Internal->SourceEntries.end(); ++i) { - std::string entry = (*i)->ge->GetInput(); + std::string const& entry = *i; std::vector items; cmSystemTools::ExpandListArgument(entry, items); @@ -697,7 +703,7 @@ void cmTarget::GetSourceFiles(std::vector &files, UNORDERED_SET uniqueSrcs; bool contextDependentDirectSources = processSources(this, - this->Internal->SourceEntries, + this->Internal->SourceItems, files, uniqueSrcs, &dagChecker, @@ -778,10 +784,12 @@ void cmTarget::AddTracedSources(std::vector const& srcs) this->Internal->SourceFilesMap.clear(); this->LinkImplementationLanguageIsContextDependent = true; cmListFileBacktrace lfbt = this->Makefile->GetBacktrace(); + this->Internal->SourceEntries.push_back(srcFiles); + this->Internal->SourceBacktraces.push_back(lfbt); cmGeneratorExpression ge(lfbt); cmsys::auto_ptr cge = ge.Parse(srcFiles); cge->SetEvaluateForBuildsystem(true); - this->Internal->SourceEntries.push_back( + this->Internal->SourceItems.push_back( new cmTargetInternals::TargetPropertyEntry(cge)); } } @@ -818,11 +826,8 @@ void cmTarget::AddSources(std::vector const& srcs) this->Internal->SourceFilesMap.clear(); this->LinkImplementationLanguageIsContextDependent = true; cmListFileBacktrace lfbt = this->Makefile->GetBacktrace(); - cmGeneratorExpression ge(lfbt); - cmsys::auto_ptr cge = ge.Parse(srcFiles); - cge->SetEvaluateForBuildsystem(true); - this->Internal->SourceEntries.push_back( - new cmTargetInternals::TargetPropertyEntry(cge)); + this->Internal->SourceEntries.push_back(srcFiles); + this->Internal->SourceBacktraces.push_back(lfbt); } } @@ -926,10 +931,10 @@ public: } - bool operator()(cmTargetInternals::TargetPropertyEntry* entry) + bool operator()(std::string const& entry) { std::vector files; - cmSystemTools::ExpandListArgument(entry->ge->GetInput(), files); + cmSystemTools::ExpandListArgument(entry, files); std::vector locations(files.size()); std::transform(files.begin(), files.end(), locations.begin(), CreateLocation(this->Needle.GetMakefile())); @@ -951,11 +956,8 @@ cmSourceFile* cmTarget::AddSource(const std::string& src) this->Internal->SourceFilesMap.clear(); this->LinkImplementationLanguageIsContextDependent = true; cmListFileBacktrace lfbt = this->Makefile->GetBacktrace(); - cmGeneratorExpression ge(lfbt); - cmsys::auto_ptr cge = ge.Parse(src); - cge->SetEvaluateForBuildsystem(true); - this->Internal->SourceEntries.push_back( - new cmTargetInternals::TargetPropertyEntry(cge)); + this->Internal->SourceEntries.push_back(src); + this->Internal->SourceBacktraces.push_back(lfbt); } if (cmGeneratorExpression::Find(src) != std::string::npos) { @@ -966,6 +968,19 @@ cmSourceFile* cmTarget::AddSource(const std::string& src) void cmTarget::AddGenerateTimeSource(const std::string& src) { + cmSourceFileLocation sfl(this->Makefile, src); + if (std::find_if(this->Internal->SourceEntries.begin(), + this->Internal->SourceEntries.end(), + TargetPropertyEntryFinder(sfl)) + == this->Internal->SourceEntries.end()) + { + cmListFileBacktrace lfbt = this->Makefile->GetBacktrace(); + cmGeneratorExpression ge(lfbt); + cmsys::auto_ptr cge = ge.Parse(src); + cge->SetEvaluateForBuildsystem(true); + this->Internal->SourceItems.push_back( + new cmTargetInternals::TargetPropertyEntry(cge)); + } this->AddSource(src); } @@ -1679,13 +1694,15 @@ void cmTarget::SetProperty(const std::string& prop, const char* value) return; } this->Internal->SourceFilesMap.clear(); - cmListFileBacktrace lfbt = this->Makefile->GetBacktrace(); - cmGeneratorExpression ge(lfbt); - cmDeleteAll(this->Internal->SourceEntries); + this->Internal->SourceEntries.clear(); - cmsys::auto_ptr cge = ge.Parse(value); - this->Internal->SourceEntries.push_back( - new cmTargetInternals::TargetPropertyEntry(cge)); + this->Internal->SourceBacktraces.clear(); + if (value) + { + cmListFileBacktrace lfbt = this->Makefile->GetBacktrace(); + this->Internal->SourceEntries.push_back(value); + this->Internal->SourceBacktraces.push_back(lfbt); + } } else { @@ -1778,10 +1795,8 @@ void cmTarget::AppendProperty(const std::string& prop, const char* value, } this->Internal->SourceFilesMap.clear(); cmListFileBacktrace lfbt = this->Makefile->GetBacktrace(); - cmGeneratorExpression ge(lfbt); - cmsys::auto_ptr cge = ge.Parse(value); - this->Internal->SourceEntries.push_back( - new cmTargetInternals::TargetPropertyEntry(cge)); + this->Internal->SourceEntries.push_back(value); + this->Internal->SourceBacktraces.push_back(lfbt); } else { @@ -2418,13 +2433,11 @@ const char *cmTarget::GetProperty(const std::string& prop, std::ostringstream ss; const char* sep = ""; - typedef cmTargetInternals::TargetPropertyEntry - TargetPropertyEntry; - for(std::vector::const_iterator + for(std::vector::const_iterator i = this->Internal->SourceEntries.begin(); i != this->Internal->SourceEntries.end(); ++i) { - std::string entry = (*i)->ge->GetInput(); + std::string const& entry = *i; std::vector files; cmSystemTools::ExpandListArgument(entry, files); @@ -3076,13 +3089,11 @@ cmTarget::GetObjectLibrariesCMP0026(std::vector& objlibs) const // there is no cmGeneratorTarget at configure-time, so search the SOURCES // for TARGET_OBJECTS instead for backwards compatibility with OLD // behavior of CMP0024 and CMP0026 only. - typedef cmTargetInternals::TargetPropertyEntry - TargetPropertyEntry; - for(std::vector::const_iterator + for(std::vector::const_iterator i = this->Internal->SourceEntries.begin(); i != this->Internal->SourceEntries.end(); ++i) { - std::string entry = (*i)->ge->GetInput(); + std::string const& entry = *i; std::vector files; cmSystemTools::ExpandListArgument(entry, files); @@ -3745,7 +3756,7 @@ cmTargetInternalPointer //---------------------------------------------------------------------------- cmTargetInternalPointer::~cmTargetInternalPointer() { - cmDeleteAll(this->Pointer->SourceEntries); + cmDeleteAll(this->Pointer->SourceItems); delete this->Pointer; } From da1b0449d96d4044bc4633a40ac87b6d4a19912d Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Sat, 12 Sep 2015 21:51:10 +0200 Subject: [PATCH 057/486] cmTarget: Remove a conditional for generate-time source addition. It is not really necessary. --- Source/cmTarget.cxx | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx index 6e1c4889e..fc9e96315 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -968,19 +968,12 @@ cmSourceFile* cmTarget::AddSource(const std::string& src) void cmTarget::AddGenerateTimeSource(const std::string& src) { - cmSourceFileLocation sfl(this->Makefile, src); - if (std::find_if(this->Internal->SourceEntries.begin(), - this->Internal->SourceEntries.end(), - TargetPropertyEntryFinder(sfl)) - == this->Internal->SourceEntries.end()) - { - cmListFileBacktrace lfbt = this->Makefile->GetBacktrace(); - cmGeneratorExpression ge(lfbt); - cmsys::auto_ptr cge = ge.Parse(src); - cge->SetEvaluateForBuildsystem(true); - this->Internal->SourceItems.push_back( - new cmTargetInternals::TargetPropertyEntry(cge)); - } + cmListFileBacktrace lfbt = this->Makefile->GetBacktrace(); + cmGeneratorExpression ge(lfbt); + cmsys::auto_ptr cge = ge.Parse(src); + cge->SetEvaluateForBuildsystem(true); + this->Internal->SourceItems.push_back( + new cmTargetInternals::TargetPropertyEntry(cge)); this->AddSource(src); } From 33f87bb1f503c09a6b8018edf97b615f0e7f713d Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Sun, 13 Sep 2015 09:45:41 +0200 Subject: [PATCH 058/486] cmGeneratorTarget: Move AddInterfaceEntries method. It will be needed here in a follow-up commit. --- Source/cmGeneratorTarget.cxx | 55 ++++++++++++++++++------------------ 1 file changed, 27 insertions(+), 28 deletions(-) diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx index 83f9cd27a..357b972b1 100644 --- a/Source/cmGeneratorTarget.cxx +++ b/Source/cmGeneratorTarget.cxx @@ -811,6 +811,33 @@ bool cmGeneratorTarget::GetPropertyAsBool(const std::string& prop) const return this->Target->GetPropertyAsBool(prop); } +//---------------------------------------------------------------------------- +static void AddInterfaceEntries( + cmGeneratorTarget const* thisTarget, std::string const& config, + std::string const& prop, + std::vector& entries) +{ + if(cmLinkImplementationLibraries const* impl = + thisTarget->Target->GetLinkImplementationLibraries(config)) + { + for (std::vector::const_iterator + it = impl->Libraries.begin(), end = impl->Libraries.end(); + it != end; ++it) + { + if(it->Target) + { + std::string genex = + "$"; + cmGeneratorExpression ge(it->Backtrace); + cmsys::auto_ptr cge = ge.Parse(genex); + cge->SetEvaluateForBuildsystem(true); + entries.push_back( + new cmGeneratorTarget::TargetPropertyEntry(cge, *it)); + } + } + } +} + //---------------------------------------------------------------------------- void cmGeneratorTarget::GetSourceFiles(std::vector &files, const std::string& config) const @@ -2177,34 +2204,6 @@ static void processIncludeDirectories(cmGeneratorTarget const* tgt, } } - -//---------------------------------------------------------------------------- -static void AddInterfaceEntries( - cmGeneratorTarget const* thisTarget, std::string const& config, - std::string const& prop, - std::vector& entries) -{ - if(cmLinkImplementationLibraries const* impl = - thisTarget->Target->GetLinkImplementationLibraries(config)) - { - for (std::vector::const_iterator - it = impl->Libraries.begin(), end = impl->Libraries.end(); - it != end; ++it) - { - if(it->Target) - { - std::string genex = - "$"; - cmGeneratorExpression ge(it->Backtrace); - cmsys::auto_ptr cge = ge.Parse(genex); - cge->SetEvaluateForBuildsystem(true); - entries.push_back( - new cmGeneratorTarget::TargetPropertyEntry(cge, *it)); - } - } - } -} - //---------------------------------------------------------------------------- std::vector cmGeneratorTarget::GetIncludeDirectories(const std::string& config, From 7b6dc0fe45c7064ad741461bfaf19028e8539c78 Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Sun, 13 Sep 2015 09:57:43 +0200 Subject: [PATCH 059/486] cmGeneratorTarget: Inline GetSourceFiles from cmTarget. --- Source/cmGeneratorTarget.cxx | 35 +++++++++++++++++++++++++- Source/cmTarget.cxx | 49 +++++------------------------------- Source/cmTarget.h | 14 +++++++---- 3 files changed, 49 insertions(+), 49 deletions(-) diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx index 357b972b1..43ce88242 100644 --- a/Source/cmGeneratorTarget.cxx +++ b/Source/cmGeneratorTarget.cxx @@ -842,7 +842,40 @@ static void AddInterfaceEntries( void cmGeneratorTarget::GetSourceFiles(std::vector &files, const std::string& config) const { - this->Target->GetSourceFiles(files, config); + // Lookup any existing link implementation for this configuration. + std::string key = cmSystemTools::UpperCase(config); + + cmTarget::SourceFilesMapType& sfm = this->Target->GetSourceFilesMap(); + if(!this->Target->GetLinkImplementationLanguageIsContextDependent()) + { + files = sfm.begin()->second; + return; + } + + cmTarget::SourceFilesMapType::iterator + it = sfm.find(key); + if(it != sfm.end()) + { + files = it->second; + } + else + { + std::vector srcs; + this->Target->GetSourceFiles(srcs, config); + + std::set emitted; + + for(std::vector::const_iterator i = srcs.begin(); + i != srcs.end(); ++i) + { + cmSourceFile* sf = this->Makefile->GetOrCreateSource(*i); + if (emitted.insert(sf).second) + { + files.push_back(sf); + } + } + sfm[key] = files; + } } //---------------------------------------------------------------------------- diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx index fc9e96315..8ff729f83 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -101,9 +101,7 @@ public: HeadToLinkImplementationMap> LinkImplMapType; LinkImplMapType LinkImplMap; - typedef std::map > - SourceFilesMapType; - SourceFilesMapType SourceFilesMap; + cmTarget::SourceFilesMapType SourceFilesMap; std::set UtilityItems; bool UtilityItemsDone; @@ -409,6 +407,11 @@ void cmTarget::Compute() this->Internal->SourceItems, true); } +cmTarget::SourceFilesMapType& cmTarget::GetSourceFilesMap() const +{ + return this->Internal->SourceFilesMap; +} + //---------------------------------------------------------------------------- void cmTarget::AddUtility(const std::string& u, cmMakefile *makefile) { @@ -735,46 +738,6 @@ void cmTarget::GetSourceFiles(std::vector &files, cmDeleteAll(linkInterfaceSourcesEntries); } -//---------------------------------------------------------------------------- -void cmTarget::GetSourceFiles(std::vector &files, - const std::string& config) const -{ - - // Lookup any existing link implementation for this configuration. - std::string key = cmSystemTools::UpperCase(config); - - if(!this->LinkImplementationLanguageIsContextDependent) - { - files = this->Internal->SourceFilesMap.begin()->second; - return; - } - - cmTargetInternals::SourceFilesMapType::iterator - it = this->Internal->SourceFilesMap.find(key); - if(it != this->Internal->SourceFilesMap.end()) - { - files = it->second; - } - else - { - std::vector srcs; - this->GetSourceFiles(srcs, config); - - std::set emitted; - - for(std::vector::const_iterator i = srcs.begin(); - i != srcs.end(); ++i) - { - cmSourceFile* sf = this->Makefile->GetOrCreateSource(*i); - if (emitted.insert(sf).second) - { - files.push_back(sf); - } - } - this->Internal->SourceFilesMap[key] = files; - } -} - //---------------------------------------------------------------------------- void cmTarget::AddTracedSources(std::vector const& srcs) { diff --git a/Source/cmTarget.h b/Source/cmTarget.h index 2f1671d9c..6024c38c5 100644 --- a/Source/cmTarget.h +++ b/Source/cmTarget.h @@ -135,11 +135,15 @@ public: void Compute(); - /** - * Get the list of the source files used by this target - */ - void GetSourceFiles(std::vector &files, - const std::string& config) const; + typedef std::map > + SourceFilesMapType; + + SourceFilesMapType& GetSourceFilesMap() const; + + bool GetLinkImplementationLanguageIsContextDependent() const { + return this->LinkImplementationLanguageIsContextDependent; + } + /** * Add sources to the target. */ From dce6581b7b58c346796c8d3045f4ce70d9672755 Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Sun, 13 Sep 2015 10:18:15 +0200 Subject: [PATCH 060/486] cmGeneratorTarget: Move computed sources from cmTarget. --- Source/cmGeneratorTarget.cxx | 243 ++++++++++++++++++++++++++-- Source/cmGeneratorTarget.h | 10 ++ Source/cmTarget.cxx | 299 ++--------------------------------- Source/cmTarget.h | 18 +-- 4 files changed, 253 insertions(+), 317 deletions(-) diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx index 43ce88242..3fb0dc7fa 100644 --- a/Source/cmGeneratorTarget.cxx +++ b/Source/cmGeneratorTarget.cxx @@ -269,7 +269,9 @@ cmGeneratorTarget::cmGeneratorTarget(cmTarget* t, cmLocalGenerator* lg) DebugIncludesDone(false), DebugCompileOptionsDone(false), DebugCompileFeaturesDone(false), - DebugCompileDefinitionsDone(false) + DebugCompileDefinitionsDone(false), + DebugSourcesDone(false), + LinkImplementationLanguageIsContextDependent(true) { this->Makefile = this->Target->GetMakefile(); this->LocalGenerator = lg; @@ -296,6 +298,11 @@ cmGeneratorTarget::cmGeneratorTarget(cmTarget* t, cmLocalGenerator* lg) t->GetCompileDefinitionsEntries(), t->GetCompileDefinitionsBacktraces(), this->CompileDefinitionsEntries); + + CreatePropertyGeneratorExpressions( + t->GetSourceEntries(), + t->GetSourceBacktraces(), + this->SourceEntries, true); } cmGeneratorTarget::~cmGeneratorTarget() @@ -304,6 +311,7 @@ cmGeneratorTarget::~cmGeneratorTarget() cmDeleteAll(this->CompileOptionsEntries); cmDeleteAll(this->CompileFeaturesEntries); cmDeleteAll(this->CompileDefinitionsEntries); + cmDeleteAll(this->SourceEntries); cmDeleteAll(this->LinkInformation); this->LinkInformation.clear(); } @@ -404,12 +412,32 @@ std::string cmGeneratorTarget::GetOutputName(const std::string& config, void cmGeneratorTarget::AddSource(const std::string& src) { - this->Target->AddGenerateTimeSource(src); + this->Target->AddSource(src); + cmListFileBacktrace lfbt = this->Makefile->GetBacktrace(); + cmGeneratorExpression ge(lfbt); + cmsys::auto_ptr cge = ge.Parse(src); + cge->SetEvaluateForBuildsystem(true); + this->SourceEntries.push_back( + new TargetPropertyEntry(cge)); + this->SourceFilesMap.clear(); + this->LinkImplementationLanguageIsContextDependent = true; } void cmGeneratorTarget::AddTracedSources(std::vector const& srcs) { this->Target->AddTracedSources(srcs); + if (!srcs.empty()) + { + std::string srcFiles = cmJoin(srcs, ";"); + this->SourceFilesMap.clear(); + this->LinkImplementationLanguageIsContextDependent = true; + cmListFileBacktrace lfbt = this->Makefile->GetBacktrace(); + cmGeneratorExpression ge(lfbt); + cmsys::auto_ptr cge = ge.Parse(srcFiles); + cge->SetEvaluateForBuildsystem(true); + this->SourceEntries.push_back( + new cmGeneratorTarget::TargetPropertyEntry(cge)); + } } //---------------------------------------------------------------------------- @@ -839,29 +867,216 @@ static void AddInterfaceEntries( } //---------------------------------------------------------------------------- -void cmGeneratorTarget::GetSourceFiles(std::vector &files, - const std::string& config) const +static bool processSources(cmGeneratorTarget const* tgt, + const std::vector &entries, + std::vector &srcs, + UNORDERED_SET &uniqueSrcs, + cmGeneratorExpressionDAGChecker *dagChecker, + std::string const& config, bool debugSources) { - // Lookup any existing link implementation for this configuration. - std::string key = cmSystemTools::UpperCase(config); + cmMakefile *mf = tgt->Target->GetMakefile(); - cmTarget::SourceFilesMapType& sfm = this->Target->GetSourceFilesMap(); - if(!this->Target->GetLinkImplementationLanguageIsContextDependent()) + bool contextDependent = false; + + for (std::vector::const_iterator + it = entries.begin(), end = entries.end(); it != end; ++it) { - files = sfm.begin()->second; + cmLinkImplItem const& item = (*it)->LinkImplItem; + std::string const& targetName = item; + std::vector entrySources; + cmSystemTools::ExpandListArgument((*it)->ge->Evaluate(mf, + config, + false, + tgt->Target, + tgt->Target, + dagChecker), + entrySources); + + if ((*it)->ge->GetHadContextSensitiveCondition()) + { + contextDependent = true; + } + + for(std::vector::iterator i = entrySources.begin(); + i != entrySources.end(); ++i) + { + std::string& src = *i; + cmSourceFile* sf = mf->GetOrCreateSource(src); + std::string e; + std::string fullPath = sf->GetFullPath(&e); + if(fullPath.empty()) + { + if(!e.empty()) + { + cmake* cm = mf->GetCMakeInstance(); + cm->IssueMessage(cmake::FATAL_ERROR, e, + tgt->Target->GetBacktrace()); + } + return contextDependent; + } + + if (!targetName.empty() && !cmSystemTools::FileIsFullPath(src.c_str())) + { + std::ostringstream err; + if (!targetName.empty()) + { + err << "Target \"" << targetName << "\" contains relative " + "path in its INTERFACE_SOURCES:\n" + " \"" << src << "\""; + } + else + { + err << "Found relative path while evaluating sources of " + "\"" << tgt->GetName() << "\":\n \"" << src << "\"\n"; + } + tgt->GetLocalGenerator()->IssueMessage(cmake::FATAL_ERROR, err.str()); + return contextDependent; + } + src = fullPath; + } + std::string usedSources; + for(std::vector::iterator + li = entrySources.begin(); li != entrySources.end(); ++li) + { + std::string src = *li; + + if(uniqueSrcs.insert(src).second) + { + srcs.push_back(src); + if (debugSources) + { + usedSources += " * " + src + "\n"; + } + } + } + if (!usedSources.empty()) + { + mf->GetCMakeInstance()->IssueMessage(cmake::LOG, + std::string("Used sources for target ") + + tgt->GetName() + ":\n" + + usedSources, (*it)->ge->GetBacktrace()); + } + } + return contextDependent; +} + +//---------------------------------------------------------------------------- +void cmGeneratorTarget::GetSourceFiles(std::vector &files, + const std::string& config) const +{ + assert(this->GetType() != cmTarget::INTERFACE_LIBRARY); + + if (!this->Makefile->GetGlobalGenerator()->GetConfigureDoneCMP0026()) + { + // At configure-time, this method can be called as part of getting the + // LOCATION property or to export() a file to be include()d. However + // there is no cmGeneratorTarget at configure-time, so search the SOURCES + // for TARGET_OBJECTS instead for backwards compatibility with OLD + // behavior of CMP0024 and CMP0026 only. + + cmStringRange sourceEntries = this->Target->GetSourceEntries(); + for(cmStringRange::const_iterator + i = sourceEntries.begin(); + i != sourceEntries.end(); ++i) + { + std::string const& entry = *i; + + std::vector items; + cmSystemTools::ExpandListArgument(entry, items); + for (std::vector::const_iterator + li = items.begin(); li != items.end(); ++li) + { + if(cmHasLiteralPrefix(*li, "$size() - 1] == '>') + { + continue; + } + files.push_back(*li); + } + } return; } - cmTarget::SourceFilesMapType::iterator - it = sfm.find(key); - if(it != sfm.end()) + std::vector debugProperties; + const char *debugProp = + this->Makefile->GetDefinition("CMAKE_DEBUG_TARGET_PROPERTIES"); + if (debugProp) + { + cmSystemTools::ExpandListArgument(debugProp, debugProperties); + } + + bool debugSources = !this->DebugSourcesDone + && std::find(debugProperties.begin(), + debugProperties.end(), + "SOURCES") + != debugProperties.end(); + + if (this->Makefile->GetGlobalGenerator()->GetConfigureDoneCMP0026()) + { + this->DebugSourcesDone = true; + } + + cmGeneratorExpressionDAGChecker dagChecker(this->GetName(), + "SOURCES", 0, 0); + + UNORDERED_SET uniqueSrcs; + bool contextDependentDirectSources = processSources(this, + this->SourceEntries, + files, + uniqueSrcs, + &dagChecker, + config, + debugSources); + + std::vector + linkInterfaceSourcesEntries; + + AddInterfaceEntries( + this, config, "INTERFACE_SOURCES", + linkInterfaceSourcesEntries); + + std::vector::size_type numFilesBefore = files.size(); + bool contextDependentInterfaceSources = processSources(this, + linkInterfaceSourcesEntries, + files, + uniqueSrcs, + &dagChecker, + config, + debugSources); + + if (!contextDependentDirectSources + && !(contextDependentInterfaceSources && numFilesBefore < files.size())) + { + this->LinkImplementationLanguageIsContextDependent = false; + } + + cmDeleteAll(linkInterfaceSourcesEntries); +} + +//---------------------------------------------------------------------------- +void cmGeneratorTarget::GetSourceFiles(std::vector &files, + const std::string& config) const +{ + + // Lookup any existing link implementation for this configuration. + std::string key = cmSystemTools::UpperCase(config); + + if(!this->LinkImplementationLanguageIsContextDependent) + { + files = this->SourceFilesMap.begin()->second; + return; + } + + SourceFilesMapType::iterator + it = this->SourceFilesMap.find(key); + if(it != this->SourceFilesMap.end()) { files = it->second; } else { std::vector srcs; - this->Target->GetSourceFiles(srcs, config); + this->GetSourceFiles(srcs, config); std::set emitted; @@ -874,7 +1089,7 @@ void cmGeneratorTarget::GetSourceFiles(std::vector &files, files.push_back(sf); } } - sfm[key] = files; + this->SourceFilesMap[key] = files; } } diff --git a/Source/cmGeneratorTarget.h b/Source/cmGeneratorTarget.h index 0c6ad8299..e8c5e0479 100644 --- a/Source/cmGeneratorTarget.h +++ b/Source/cmGeneratorTarget.h @@ -441,10 +441,15 @@ private: GetImportLinkInterface(const std::string& config, cmTarget const* head, bool usage_requirements_only) const; + typedef std::map > + SourceFilesMapType; + mutable SourceFilesMapType SourceFilesMap; + std::vector IncludeDirectoriesEntries; std::vector CompileOptionsEntries; std::vector CompileFeaturesEntries; std::vector CompileDefinitionsEntries; + std::vector SourceEntries; void ExpandLinkItems(std::string const& prop, std::string const& value, std::string const& config, cmTarget const* headTarget, @@ -454,6 +459,9 @@ private: void LookupLinkItems(std::vector const& names, std::vector& items) const; + void GetSourceFiles(std::vector& files, + const std::string& config) const; + typedef std::pair OutputNameKey; typedef std::map OutputNameMapType; mutable OutputNameMapType OutputNameMap; @@ -462,6 +470,8 @@ private: mutable bool DebugCompileOptionsDone; mutable bool DebugCompileFeaturesDone; mutable bool DebugCompileDefinitionsDone; + mutable bool DebugSourcesDone; + mutable bool LinkImplementationLanguageIsContextDependent; public: std::vector const& diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx index 8ff729f83..e87aa16fd 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -101,21 +101,9 @@ public: HeadToLinkImplementationMap> LinkImplMapType; LinkImplMapType LinkImplMap; - cmTarget::SourceFilesMapType SourceFilesMap; - std::set UtilityItems; bool UtilityItemsDone; - class TargetPropertyEntry { - static cmLinkImplItem NoLinkImplItem; - public: - TargetPropertyEntry(cmsys::auto_ptr cge, - cmLinkImplItem const& item = NoLinkImplItem) - : ge(cge), LinkImplItem(item) - {} - const cmsys::auto_ptr ge; - cmLinkImplItem const& LinkImplItem; - }; std::vector IncludeDirectoriesEntries; std::vector IncludeDirectoriesBacktraces; std::vector CompileOptionsEntries; @@ -126,16 +114,9 @@ public: std::vector CompileDefinitionsBacktraces; std::vector SourceEntries; std::vector SourceBacktraces; - std::vector SourceItems; std::vector LinkImplementationPropertyEntries; - - void AddInterfaceEntries( - cmTarget const* thisTarget, std::string const& config, - std::string const& prop, std::vector& entries); }; -cmLinkImplItem cmTargetInternals::TargetPropertyEntry::NoLinkImplItem; - //---------------------------------------------------------------------------- cmTargetInternals::~cmTargetInternals() { @@ -154,8 +135,6 @@ cmTarget::cmTarget() this->IsApple = false; this->IsImportedTarget = false; this->BuildInterfaceIncludesAppended = false; - this->DebugSourcesDone = false; - this->LinkImplementationLanguageIsContextDependent = true; } void cmTarget::SetType(TargetType type, const std::string& name) @@ -382,34 +361,8 @@ void cmTarget::SetMakefile(cmMakefile* mf) } } -void CreatePropertyGeneratorExpressions( - std::vector const& entries, - std::vector const& backtraces, - std::vector& items, - bool evaluateForBuildsystem = false) -{ - std::vector::const_iterator btIt = backtraces.begin(); - for (std::vector::const_iterator it = entries.begin(); - it != entries.end(); ++it, ++btIt) - { - cmGeneratorExpression ge(*btIt); - cmsys::auto_ptr cge = ge.Parse(*it); - cge->SetEvaluateForBuildsystem(evaluateForBuildsystem); - items.push_back(new cmTargetInternals::TargetPropertyEntry(cge)); - } -} - void cmTarget::Compute() { - CreatePropertyGeneratorExpressions( - this->Internal->SourceEntries, - this->Internal->SourceBacktraces, - this->Internal->SourceItems, true); -} - -cmTarget::SourceFilesMapType& cmTarget::GetSourceFilesMap() const -{ - return this->Internal->SourceFilesMap; } //---------------------------------------------------------------------------- @@ -469,9 +422,7 @@ void cmTarget::FinishConfigure() //---------------------------------------------------------------------------- void cmTarget::ClearLinkMaps() { - this->LinkImplementationLanguageIsContextDependent = true; this->Internal->LinkImplMap.clear(); - this->Internal->SourceFilesMap.clear(); } //---------------------------------------------------------------------------- @@ -552,208 +503,14 @@ bool cmTarget::IsXCTestOnApple() const this->GetPropertyAsBool("XCTEST")); } -//---------------------------------------------------------------------------- -static bool processSources(cmTarget const* tgt, - const std::vector &entries, - std::vector &srcs, - UNORDERED_SET &uniqueSrcs, - cmGeneratorExpressionDAGChecker *dagChecker, - std::string const& config, bool debugSources) -{ - cmMakefile *mf = tgt->GetMakefile(); - - bool contextDependent = false; - - for (std::vector::const_iterator - it = entries.begin(), end = entries.end(); it != end; ++it) - { - cmLinkImplItem const& item = (*it)->LinkImplItem; - std::string const& targetName = item; - std::vector entrySources; - cmSystemTools::ExpandListArgument((*it)->ge->Evaluate(mf, - config, - false, - tgt, - tgt, - dagChecker), - entrySources); - - if ((*it)->ge->GetHadContextSensitiveCondition()) - { - contextDependent = true; - } - - for(std::vector::iterator i = entrySources.begin(); - i != entrySources.end(); ++i) - { - std::string& src = *i; - cmSourceFile* sf = mf->GetOrCreateSource(src); - std::string e; - std::string fullPath = sf->GetFullPath(&e); - if(fullPath.empty()) - { - if(!e.empty()) - { - cmake* cm = mf->GetCMakeInstance(); - cm->IssueMessage(cmake::FATAL_ERROR, e, - tgt->GetBacktrace()); - } - return contextDependent; - } - - if (!targetName.empty() && !cmSystemTools::FileIsFullPath(src.c_str())) - { - std::ostringstream err; - if (!targetName.empty()) - { - err << "Target \"" << targetName << "\" contains relative " - "path in its INTERFACE_SOURCES:\n" - " \"" << src << "\""; - } - else - { - err << "Found relative path while evaluating sources of " - "\"" << tgt->GetName() << "\":\n \"" << src << "\"\n"; - } - tgt->GetMakefile()->IssueMessage(cmake::FATAL_ERROR, err.str()); - return contextDependent; - } - src = fullPath; - } - std::string usedSources; - for(std::vector::iterator - li = entrySources.begin(); li != entrySources.end(); ++li) - { - std::string src = *li; - - if(uniqueSrcs.insert(src).second) - { - srcs.push_back(src); - if (debugSources) - { - usedSources += " * " + src + "\n"; - } - } - } - if (!usedSources.empty()) - { - mf->GetCMakeInstance()->IssueMessage(cmake::LOG, - std::string("Used sources for target ") - + tgt->GetName() + ":\n" - + usedSources, (*it)->ge->GetBacktrace()); - } - } - return contextDependent; -} - -//---------------------------------------------------------------------------- -void cmTarget::GetSourceFiles(std::vector &files, - const std::string& config) const -{ - assert(this->GetType() != INTERFACE_LIBRARY); - - if (!this->GetMakefile()->GetGlobalGenerator()->GetConfigureDoneCMP0026()) - { - // At configure-time, this method can be called as part of getting the - // LOCATION property or to export() a file to be include()d. However - // there is no cmGeneratorTarget at configure-time, so search the SOURCES - // for TARGET_OBJECTS instead for backwards compatibility with OLD - // behavior of CMP0024 and CMP0026 only. - - for(std::vector::const_iterator - i = this->Internal->SourceEntries.begin(); - i != this->Internal->SourceEntries.end(); ++i) - { - std::string const& entry = *i; - - std::vector items; - cmSystemTools::ExpandListArgument(entry, items); - for (std::vector::const_iterator - li = items.begin(); li != items.end(); ++li) - { - if(cmHasLiteralPrefix(*li, "$size() - 1] == '>') - { - continue; - } - files.push_back(*li); - } - } - return; - } - - std::vector debugProperties; - const char *debugProp = - this->Makefile->GetDefinition("CMAKE_DEBUG_TARGET_PROPERTIES"); - if (debugProp) - { - cmSystemTools::ExpandListArgument(debugProp, debugProperties); - } - - bool debugSources = !this->DebugSourcesDone - && std::find(debugProperties.begin(), - debugProperties.end(), - "SOURCES") - != debugProperties.end(); - - if (this->GetMakefile()->GetGlobalGenerator()->GetConfigureDoneCMP0026()) - { - this->DebugSourcesDone = true; - } - - cmGeneratorExpressionDAGChecker dagChecker(this->GetName(), - "SOURCES", 0, 0); - - UNORDERED_SET uniqueSrcs; - bool contextDependentDirectSources = processSources(this, - this->Internal->SourceItems, - files, - uniqueSrcs, - &dagChecker, - config, - debugSources); - - std::vector - linkInterfaceSourcesEntries; - - this->Internal->AddInterfaceEntries( - this, config, "INTERFACE_SOURCES", - linkInterfaceSourcesEntries); - - std::vector::size_type numFilesBefore = files.size(); - bool contextDependentInterfaceSources = processSources(this, - linkInterfaceSourcesEntries, - files, - uniqueSrcs, - &dagChecker, - config, - debugSources); - - if (!contextDependentDirectSources - && !(contextDependentInterfaceSources && numFilesBefore < files.size())) - { - this->LinkImplementationLanguageIsContextDependent = false; - } - - cmDeleteAll(linkInterfaceSourcesEntries); -} - //---------------------------------------------------------------------------- void cmTarget::AddTracedSources(std::vector const& srcs) { if (!srcs.empty()) { - std::string srcFiles = cmJoin(srcs, ";"); - this->Internal->SourceFilesMap.clear(); - this->LinkImplementationLanguageIsContextDependent = true; cmListFileBacktrace lfbt = this->Makefile->GetBacktrace(); - this->Internal->SourceEntries.push_back(srcFiles); + this->Internal->SourceEntries.push_back(cmJoin(srcs, ";")); this->Internal->SourceBacktraces.push_back(lfbt); - cmGeneratorExpression ge(lfbt); - cmsys::auto_ptr cge = ge.Parse(srcFiles); - cge->SetEvaluateForBuildsystem(true); - this->Internal->SourceItems.push_back( - new cmTargetInternals::TargetPropertyEntry(cge)); } } @@ -786,8 +543,6 @@ void cmTarget::AddSources(std::vector const& srcs) } if (!srcFiles.empty()) { - this->Internal->SourceFilesMap.clear(); - this->LinkImplementationLanguageIsContextDependent = true; cmListFileBacktrace lfbt = this->Makefile->GetBacktrace(); this->Internal->SourceEntries.push_back(srcFiles); this->Internal->SourceBacktraces.push_back(lfbt); @@ -916,8 +671,6 @@ cmSourceFile* cmTarget::AddSource(const std::string& src) TargetPropertyEntryFinder(sfl)) == this->Internal->SourceEntries.end()) { - this->Internal->SourceFilesMap.clear(); - this->LinkImplementationLanguageIsContextDependent = true; cmListFileBacktrace lfbt = this->Makefile->GetBacktrace(); this->Internal->SourceEntries.push_back(src); this->Internal->SourceBacktraces.push_back(lfbt); @@ -929,17 +682,6 @@ cmSourceFile* cmTarget::AddSource(const std::string& src) return this->Makefile->GetOrCreateSource(src); } -void cmTarget::AddGenerateTimeSource(const std::string& src) -{ - cmListFileBacktrace lfbt = this->Makefile->GetBacktrace(); - cmGeneratorExpression ge(lfbt); - cmsys::auto_ptr cge = ge.Parse(src); - cge->SetEvaluateForBuildsystem(true); - this->Internal->SourceItems.push_back( - new cmTargetInternals::TargetPropertyEntry(cge)); - this->AddSource(src); -} - //---------------------------------------------------------------------------- void cmTarget::MergeLinkLibraries( cmMakefile& mf, const std::string& selfname, @@ -1234,6 +976,16 @@ cmBacktraceRange cmTarget::GetCompileDefinitionsBacktraces() const return cmMakeRange(this->Internal->CompileDefinitionsBacktraces); } +cmStringRange cmTarget::GetSourceEntries() const +{ + return cmMakeRange(this->Internal->SourceEntries); +} + +cmBacktraceRange cmTarget::GetSourceBacktraces() const +{ + return cmMakeRange(this->Internal->SourceBacktraces); +} + #if defined(_WIN32) && !defined(__CYGWIN__) //---------------------------------------------------------------------------- void @@ -1649,7 +1401,6 @@ void cmTarget::SetProperty(const std::string& prop, const char* value) this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str()); return; } - this->Internal->SourceFilesMap.clear(); this->Internal->SourceEntries.clear(); this->Internal->SourceBacktraces.clear(); @@ -1749,7 +1500,6 @@ void cmTarget::AppendProperty(const std::string& prop, const char* value, this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str()); return; } - this->Internal->SourceFilesMap.clear(); cmListFileBacktrace lfbt = this->Makefile->GetBacktrace(); this->Internal->SourceEntries.push_back(value); this->Internal->SourceBacktraces.push_back(lfbt); @@ -3424,32 +3174,6 @@ void cmTarget::ComputeImportInfo(std::string const& desired_config, } } -//---------------------------------------------------------------------------- -void cmTargetInternals::AddInterfaceEntries( - cmTarget const* thisTarget, std::string const& config, - std::string const& prop, std::vector& entries) -{ - if(cmLinkImplementationLibraries const* impl = - thisTarget->GetLinkImplementationLibraries(config)) - { - for (std::vector::const_iterator - it = impl->Libraries.begin(), end = impl->Libraries.end(); - it != end; ++it) - { - if(it->Target) - { - std::string genex = - "$"; - cmGeneratorExpression ge(it->Backtrace); - cmsys::auto_ptr cge = ge.Parse(genex); - cge->SetEvaluateForBuildsystem(true); - entries.push_back( - new cmTargetInternals::TargetPropertyEntry(cge, *it)); - } - } - } -} - cmOptionalLinkImplementation& cmTarget::GetLinkImplMap(std::string const& config) const { @@ -3712,7 +3436,6 @@ cmTargetInternalPointer //---------------------------------------------------------------------------- cmTargetInternalPointer::~cmTargetInternalPointer() { - cmDeleteAll(this->Pointer->SourceItems); delete this->Pointer; } diff --git a/Source/cmTarget.h b/Source/cmTarget.h index 6024c38c5..71f0d1f22 100644 --- a/Source/cmTarget.h +++ b/Source/cmTarget.h @@ -135,15 +135,6 @@ public: void Compute(); - typedef std::map > - SourceFilesMapType; - - SourceFilesMapType& GetSourceFilesMap() const; - - bool GetLinkImplementationLanguageIsContextDependent() const { - return this->LinkImplementationLanguageIsContextDependent; - } - /** * Add sources to the target. */ @@ -151,7 +142,6 @@ public: void AddTracedSources(std::vector const& srcs); cmSourceFile* AddSourceCMP0049(const std::string& src); cmSourceFile* AddSource(const std::string& src); - void AddGenerateTimeSource(const std::string& src); enum LinkLibraryType {GENERAL, DEBUG, OPTIMIZED}; @@ -395,6 +385,9 @@ public: cmStringRange GetCompileDefinitionsEntries() const; cmBacktraceRange GetCompileDefinitionsBacktraces() const; + cmStringRange GetSourceEntries() const; + cmBacktraceRange GetSourceBacktraces() const; + #if defined(_WIN32) && !defined(__CYGWIN__) const LinkLibraryVectorType &GetLinkLibrariesForVS6() const { return this->LinkLibrariesForVS6;} @@ -473,9 +466,6 @@ private: std::string ImportedGetFullPath(const std::string& config, bool implib) const; - - void GetSourceFiles(std::vector &files, - const std::string& config) const; private: mutable cmPropertyMap Properties; std::set SystemIncludeDirectories; @@ -509,8 +499,6 @@ private: bool IsApple; bool IsImportedTarget; bool BuildInterfaceIncludesAppended; - mutable bool DebugSourcesDone; - mutable bool LinkImplementationLanguageIsContextDependent; #if defined(_WIN32) && !defined(__CYGWIN__) bool LinkLibrariesForVS6Analyzed; #endif From af71c7b47947860d06c659647c6ff33ab3676284 Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Sat, 12 Sep 2015 21:54:02 +0200 Subject: [PATCH 061/486] cmTarget: Remove Compute method. --- Source/cmGlobalGenerator.cxx | 1 - Source/cmGlobalVisualStudio8Generator.cxx | 1 - Source/cmGlobalVisualStudioGenerator.cxx | 1 - Source/cmGlobalXCodeGenerator.cxx | 2 -- Source/cmQtAutoGeneratorInitializer.cxx | 2 -- Source/cmTarget.cxx | 4 ---- Source/cmTarget.h | 2 -- 7 files changed, 13 deletions(-) diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx index a62d534a1..db842b032 100644 --- a/Source/cmGlobalGenerator.cxx +++ b/Source/cmGlobalGenerator.cxx @@ -1538,7 +1538,6 @@ void cmGlobalGenerator::CreateGeneratorTargets(TargetTypes targetTypes, ti != targets.end(); ++ti) { cmTarget* t = &ti->second; - t->Compute(); cmGeneratorTarget* gt = new cmGeneratorTarget(t, lg); this->GeneratorTargets[t] = gt; generatorTargets[t] = gt; diff --git a/Source/cmGlobalVisualStudio8Generator.cxx b/Source/cmGlobalVisualStudio8Generator.cxx index 5bace4728..ab9d7e72e 100644 --- a/Source/cmGlobalVisualStudio8Generator.cxx +++ b/Source/cmGlobalVisualStudio8Generator.cxx @@ -254,7 +254,6 @@ bool cmGlobalVisualStudio8Generator::AddCheckTarget() mf->AddUtilityCommand(CMAKE_CHECK_BUILD_SYSTEM_TARGET, false, no_working_directory, no_depends, noCommandLines); - tgt->Compute(); cmGeneratorTarget* gt = new cmGeneratorTarget(tgt, lg); mf->AddGeneratorTarget(tgt, gt); diff --git a/Source/cmGlobalVisualStudioGenerator.cxx b/Source/cmGlobalVisualStudioGenerator.cxx index fd2d33adf..d45aa2780 100644 --- a/Source/cmGlobalVisualStudioGenerator.cxx +++ b/Source/cmGlobalVisualStudioGenerator.cxx @@ -86,7 +86,6 @@ void cmGlobalVisualStudioGenerator::AddExtraIDETargets() no_depends, no_commands, false, "Build all projects"); - allBuild->Compute(); cmGeneratorTarget* gt = new cmGeneratorTarget(allBuild, gen[0]); allBuild->GetMakefile()->AddGeneratorTarget(allBuild, gt); diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx index 14bc340a2..3d52e3af5 100644 --- a/Source/cmGlobalXCodeGenerator.cxx +++ b/Source/cmGlobalXCodeGenerator.cxx @@ -456,7 +456,6 @@ cmGlobalXCodeGenerator::AddExtraTargets(cmLocalGenerator* root, no_working_directory, "echo", "Build all projects"); - allbuild->Compute(); cmGeneratorTarget* allBuildGt = new cmGeneratorTarget(allbuild, root); mf->AddGeneratorTarget(allbuild, allBuildGt); @@ -492,7 +491,6 @@ cmGlobalXCodeGenerator::AddExtraTargets(cmLocalGenerator* root, no_working_directory, "make", "-f", file.c_str()); - check->Compute(); cmGeneratorTarget* checkGt = new cmGeneratorTarget(check, root); mf->AddGeneratorTarget(check, checkGt); } diff --git a/Source/cmQtAutoGeneratorInitializer.cxx b/Source/cmQtAutoGeneratorInitializer.cxx index 1b1b98e3b..378f13254 100644 --- a/Source/cmQtAutoGeneratorInitializer.cxx +++ b/Source/cmQtAutoGeneratorInitializer.cxx @@ -885,8 +885,6 @@ void cmQtAutoGeneratorInitializer::InitializeAutogenTarget( /*byproducts=*/rcc_output, depends, commandLines, false, autogenComment.c_str()); - autogenTarget->Compute(); - cmGeneratorTarget* gt = new cmGeneratorTarget(autogenTarget, lg); makefile->AddGeneratorTarget(autogenTarget, gt); diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx index e87aa16fd..abfc40b8c 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -361,10 +361,6 @@ void cmTarget::SetMakefile(cmMakefile* mf) } } -void cmTarget::Compute() -{ -} - //---------------------------------------------------------------------------- void cmTarget::AddUtility(const std::string& u, cmMakefile *makefile) { diff --git a/Source/cmTarget.h b/Source/cmTarget.h index 71f0d1f22..354eda292 100644 --- a/Source/cmTarget.h +++ b/Source/cmTarget.h @@ -133,8 +133,6 @@ public: void AddPostBuildCommand(cmCustomCommand const &cmd) {this->PostBuildCommands.push_back(cmd);} - void Compute(); - /** * Add sources to the target. */ From 360e4e1db0cc89ea4f092eeb1ba1e6df8ee782b7 Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Sun, 31 May 2015 01:57:04 +0200 Subject: [PATCH 062/486] Set the current dirs on the snapshot before creating the cmMakefile. The cmMakefile should get a fully prepared snapshot and not clobber its definitions. It should eventually be able to process list files from any starting-point snapshot, though that is some refactoring away still. --- Source/CTest/cmCTestScriptHandler.cxx | 9 ++--- Source/cmGlobalGenerator.cxx | 12 +++--- Source/cmGlobalUnixMakefileGenerator3.cxx | 7 ++-- Source/cmMakefile.cxx | 47 +++++++++++++++-------- Source/cmQtAutoGenerators.cxx | 5 ++- Source/cmake.cxx | 16 ++++---- Source/cmcmd.cxx | 6 ++- 7 files changed, 57 insertions(+), 45 deletions(-) diff --git a/Source/CTest/cmCTestScriptHandler.cxx b/Source/CTest/cmCTestScriptHandler.cxx index 2f125aaa6..b9016af23 100644 --- a/Source/CTest/cmCTestScriptHandler.cxx +++ b/Source/CTest/cmCTestScriptHandler.cxx @@ -318,16 +318,13 @@ void cmCTestScriptHandler::CreateCMake() this->GlobalGenerator = new cmGlobalGenerator(this->CMake); cmState::Snapshot snapshot = this->CMake->GetCurrentSnapshot(); + std::string cwd = cmSystemTools::GetCurrentWorkingDirectory(); + snapshot.GetDirectory().SetCurrentSource(cwd); + snapshot.GetDirectory().SetCurrentBinary(cwd); this->Makefile = new cmMakefile(this->GlobalGenerator, snapshot); this->CMake->SetProgressCallback(ctestScriptProgressCallback, this->CTest); - // Set CMAKE_CURRENT_SOURCE_DIR and CMAKE_CURRENT_BINARY_DIR. - // Also, some commands need Makefile->GetCurrentSourceDirectory(). - std::string cwd = cmSystemTools::GetCurrentWorkingDirectory(); - this->Makefile->SetCurrentSourceDirectory(cwd); - this->Makefile->SetCurrentBinaryDirectory(cwd); - // remove all cmake commands which are not scriptable, since they can't be // used in ctest scripts this->CMake->GetState()->RemoveUnscriptableCommands(); diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx index 05f10292d..715a927b0 100644 --- a/Source/cmGlobalGenerator.cxx +++ b/Source/cmGlobalGenerator.cxx @@ -1108,16 +1108,16 @@ void cmGlobalGenerator::Configure() this->FirstTimeProgress = 0.0f; this->ClearGeneratorMembers(); - cmMakefile* dirMf = - new cmMakefile(this, this->GetCMakeInstance()->GetCurrentSnapshot()); - this->Makefiles.push_back(dirMf); + cmState::Snapshot snapshot = this->CMakeInstance->GetCurrentSnapshot(); - // set the Start directories - dirMf->SetCurrentSourceDirectory + snapshot.GetDirectory().SetCurrentSource (this->CMakeInstance->GetHomeDirectory()); - dirMf->SetCurrentBinaryDirectory + snapshot.GetDirectory().SetCurrentBinary (this->CMakeInstance->GetHomeOutputDirectory()); + cmMakefile* dirMf = new cmMakefile(this, snapshot); + this->Makefiles.push_back(dirMf); + this->BinaryDirectories.insert( this->CMakeInstance->GetHomeOutputDirectory()); diff --git a/Source/cmGlobalUnixMakefileGenerator3.cxx b/Source/cmGlobalUnixMakefileGenerator3.cxx index 0064713f2..cb13fcfbd 100644 --- a/Source/cmGlobalUnixMakefileGenerator3.cxx +++ b/Source/cmGlobalUnixMakefileGenerator3.cxx @@ -585,12 +585,11 @@ void cmGlobalUnixMakefileGenerator3 else { cmState::Snapshot snapshot = this->CMakeInstance->GetCurrentSnapshot(); - mf = new cmMakefile(this, snapshot); - // set the Start directories - mf->SetCurrentSourceDirectory + snapshot.GetDirectory().SetCurrentSource (this->CMakeInstance->GetHomeDirectory()); - mf->SetCurrentBinaryDirectory + snapshot.GetDirectory().SetCurrentBinary (this->CMakeInstance->GetHomeOutputDirectory()); + mf = new cmMakefile(this, snapshot); } std::string tname = targetName; diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index e52232050..11a949fe5 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -120,15 +120,34 @@ cmMakefile::cmMakefile(cmGlobalGenerator* globalGenerator, this->AddSourceGroup("Object Files", "\\.(lo|o|obj)$"); #endif + this->AddDefinition("CMAKE_SOURCE_DIR", + this->GetCMakeInstance()->GetHomeDirectory()); + this->AddDefinition("CMAKE_BINARY_DIR", + this->GetCMakeInstance()->GetHomeOutputDirectory()); { - const char* dir = this->GetCMakeInstance()->GetHomeDirectory(); - this->AddDefinition("CMAKE_SOURCE_DIR", dir); - this->AddDefinition("CMAKE_CURRENT_SOURCE_DIR", dir); + const char* dir = this->StateSnapshot.GetDirectory().GetCurrentSource(); + if (dir) + { + this->AddDefinition("CMAKE_CURRENT_SOURCE_DIR", dir); + } + else + { + this->AddDefinition("CMAKE_CURRENT_SOURCE_DIR", + this->GetCMakeInstance()->GetHomeDirectory()); + } } { - const char* dir = this->GetCMakeInstance()->GetHomeOutputDirectory(); - this->AddDefinition("CMAKE_BINARY_DIR", dir); - this->AddDefinition("CMAKE_CURRENT_BINARY_DIR", dir); + const char* dir = this->StateSnapshot.GetDirectory().GetCurrentBinary(); + if (dir) + { + cmSystemTools::MakeDirectory(dir); + this->AddDefinition("CMAKE_CURRENT_BINARY_DIR", dir); + } + else + { + this->AddDefinition("CMAKE_CURRENT_BINARY_DIR", + this->GetCMakeInstance()->GetHomeOutputDirectory()); + } } } @@ -1472,11 +1491,6 @@ void cmMakefile::AddLinkLibrary(const std::string& lib) void cmMakefile::InitializeFromParent(cmMakefile* parent) { - this->AddDefinition("CMAKE_CURRENT_SOURCE_DIR", - this->GetCurrentSourceDirectory()); - this->AddDefinition("CMAKE_CURRENT_BINARY_DIR", - this->GetCurrentBinaryDirectory()); - this->SystemIncludeDirectories = parent->SystemIncludeDirectories; // define flags @@ -1747,15 +1761,14 @@ void cmMakefile::AddSubDirectory(const std::string& srcPath, this->ContextStack.back()->Name, this->ContextStack.back()->Line); + newSnapshot.InitializeFromParent(); + + newSnapshot.GetDirectory().SetCurrentSource(srcPath); + newSnapshot.GetDirectory().SetCurrentBinary(binPath); + cmMakefile* subMf = new cmMakefile(this->GlobalGenerator, newSnapshot); this->GetGlobalGenerator()->AddMakefile(subMf); - // set the subdirs start dirs - subMf->SetCurrentSourceDirectory(srcPath); - subMf->SetCurrentBinaryDirectory(binPath); - - subMf->StateSnapshot.InitializeFromParent(); - if(excludeFromAll) { subMf->SetProperty("EXCLUDE_FROM_ALL", "TRUE"); diff --git a/Source/cmQtAutoGenerators.cxx b/Source/cmQtAutoGenerators.cxx index bbeb3dcc3..36b130570 100644 --- a/Source/cmQtAutoGenerators.cxx +++ b/Source/cmQtAutoGenerators.cxx @@ -178,9 +178,10 @@ bool cmQtAutoGenerators::Run(const std::string& targetDirectory, cmGlobalGenerator gg(&cm); cmState::Snapshot snapshot = cm.GetCurrentSnapshot(); + snapshot.GetDirectory().SetCurrentBinary(targetDirectory); + snapshot.GetDirectory().SetCurrentSource(targetDirectory); + cmsys::auto_ptr mf(new cmMakefile(&gg, snapshot)); - mf->SetCurrentBinaryDirectory(targetDirectory); - mf->SetCurrentSourceDirectory(targetDirectory); gg.SetCurrentMakefile(mf.get()); this->ReadAutogenInfoFile(mf.get(), targetDirectory, config); diff --git a/Source/cmake.cxx b/Source/cmake.cxx index 2aa092a96..fececfd20 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -377,11 +377,11 @@ void cmake::ReadListFile(const std::vector& args, this->SetHomeDirectory(cmSystemTools::GetCurrentWorkingDirectory()); this->SetHomeOutputDirectory(cmSystemTools::GetCurrentWorkingDirectory()); cmState::Snapshot snapshot = this->GetCurrentSnapshot(); + snapshot.GetDirectory().SetCurrentBinary + (cmSystemTools::GetCurrentWorkingDirectory()); + snapshot.GetDirectory().SetCurrentSource + (cmSystemTools::GetCurrentWorkingDirectory()); cmsys::auto_ptr mf(new cmMakefile(gg, snapshot)); - mf->SetCurrentBinaryDirectory - (cmSystemTools::GetCurrentWorkingDirectory()); - mf->SetCurrentSourceDirectory - (cmSystemTools::GetCurrentWorkingDirectory()); if (this->GetWorkingMode() != NORMAL_MODE) { std::string file(cmSystemTools::CollapseFullPath(path)); @@ -418,13 +418,13 @@ bool cmake::FindPackage(const std::vector& args) this->SetGlobalGenerator(gg); cmState::Snapshot snapshot = this->GetCurrentSnapshot(); + snapshot.GetDirectory().SetCurrentBinary + (cmSystemTools::GetCurrentWorkingDirectory()); + snapshot.GetDirectory().SetCurrentSource + (cmSystemTools::GetCurrentWorkingDirectory()); // read in the list file to fill the cache cmsys::auto_ptr mf(new cmMakefile(gg, snapshot)); cmsys::auto_ptr lg(gg->CreateLocalGenerator(mf.get())); - mf->SetCurrentBinaryDirectory - (cmSystemTools::GetCurrentWorkingDirectory()); - mf->SetCurrentSourceDirectory - (cmSystemTools::GetCurrentWorkingDirectory()); mf->SetArgcArgv(args); diff --git a/Source/cmcmd.cxx b/Source/cmcmd.cxx index f44c77d6e..ca4611148 100644 --- a/Source/cmcmd.cxx +++ b/Source/cmcmd.cxx @@ -769,11 +769,13 @@ int cmcmd::ExecuteCMakeCommand(std::vector& args) { cm.SetGlobalGenerator(ggd); cmState::Snapshot snapshot = cm.GetCurrentSnapshot(); + snapshot.GetDirectory().SetCurrentBinary + (cmSystemTools::GetCurrentWorkingDirectory()); + snapshot.GetDirectory().SetCurrentSource + (cmSystemTools::GetCurrentWorkingDirectory()); cmsys::auto_ptr mf(new cmMakefile(ggd, snapshot)); cmsys::auto_ptr lgd( ggd->CreateLocalGenerator(mf.get())); - lgd->GetMakefile()->SetCurrentSourceDirectory(startDir); - lgd->GetMakefile()->SetCurrentBinaryDirectory(startOutDir); // Actually scan dependencies. return lgd->UpdateDependencies(depInfo.c_str(), From 6c02f62f75735f6e60549ef53b06bd87e843bc35 Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Tue, 6 Oct 2015 00:24:26 +0200 Subject: [PATCH 063/486] Remove now-unused directory setters. --- Source/cmMakefile.cxx | 15 --------------- Source/cmMakefile.h | 2 -- 2 files changed, 17 deletions(-) diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index 11a949fe5..2c9dfbb1a 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -1784,26 +1784,11 @@ void cmMakefile::AddSubDirectory(const std::string& srcPath, } } -void cmMakefile::SetCurrentSourceDirectory(const std::string& dir) -{ - this->StateSnapshot.GetDirectory().SetCurrentSource(dir); - this->AddDefinition("CMAKE_CURRENT_SOURCE_DIR", - this->StateSnapshot.GetDirectory().GetCurrentSource()); -} - const char* cmMakefile::GetCurrentSourceDirectory() const { return this->StateSnapshot.GetDirectory().GetCurrentSource(); } -void cmMakefile::SetCurrentBinaryDirectory(const std::string& dir) -{ - this->StateSnapshot.GetDirectory().SetCurrentBinary(dir); - const char* binDir = this->StateSnapshot.GetDirectory().GetCurrentBinary(); - cmSystemTools::MakeDirectory(binDir); - this->AddDefinition("CMAKE_CURRENT_BINARY_DIR", binDir); -} - const char* cmMakefile::GetCurrentBinaryDirectory() const { return this->StateSnapshot.GetDirectory().GetCurrentBinary(); diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h index 8724c6e4c..459d34ca6 100644 --- a/Source/cmMakefile.h +++ b/Source/cmMakefile.h @@ -353,9 +353,7 @@ public: */ void SetArgcArgv(const std::vector& args); - void SetCurrentSourceDirectory(const std::string& dir); const char* GetCurrentSourceDirectory() const; - void SetCurrentBinaryDirectory(const std::string& dir); const char* GetCurrentBinaryDirectory() const; //@} From 28749903b67d71b35f6ff74dab7c6db1a648a1c8 Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Tue, 6 Oct 2015 00:33:49 +0200 Subject: [PATCH 064/486] cmState: Internalize the initialization of a snapshot from its parent. --- Source/cmMakefile.cxx | 2 -- Source/cmState.cxx | 2 ++ Source/cmState.h | 5 +++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index 2c9dfbb1a..c06050557 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -1761,8 +1761,6 @@ void cmMakefile::AddSubDirectory(const std::string& srcPath, this->ContextStack.back()->Name, this->ContextStack.back()->Line); - newSnapshot.InitializeFromParent(); - newSnapshot.GetDirectory().SetCurrentSource(srcPath); newSnapshot.GetDirectory().SetCurrentBinary(binPath); diff --git a/Source/cmState.cxx b/Source/cmState.cxx index ce9ff323b..db7519b89 100644 --- a/Source/cmState.cxx +++ b/Source/cmState.cxx @@ -805,8 +805,10 @@ cmState::CreateBuildsystemDirectorySnapshot(Snapshot originSnapshot, pos->Parent = origin; pos->Root = origin; pos->Vars = this->VarTree.Extend(origin); + cmState::Snapshot snapshot = cmState::Snapshot(this, pos); originSnapshot.Position->BuildSystemDirectory->Children.push_back(snapshot); + snapshot.InitializeFromParent(); return snapshot; } diff --git a/Source/cmState.h b/Source/cmState.h index 99e537c07..1ffc4bf44 100644 --- a/Source/cmState.h +++ b/Source/cmState.h @@ -75,8 +75,6 @@ public: Snapshot GetCallStackParent() const; SnapshotType GetType() const; - void InitializeFromParent(); - void SetPolicy(cmPolicies::PolicyID id, cmPolicies::PolicyStatus status); cmPolicies::PolicyStatus GetPolicy(cmPolicies::PolicyID id) const; bool HasDefinedPolicyCMP0011(); @@ -105,6 +103,9 @@ public: friend class cmState; friend class Directory; friend struct StrictWeakOrder; + + void InitializeFromParent(); + cmState* State; cmState::PositionType Position; }; From 24c97529ca98649576e2f98e56dc6830d8a5b3d8 Mon Sep 17 00:00:00 2001 From: Kitware Robot Date: Thu, 8 Oct 2015 00:01:05 -0400 Subject: [PATCH 065/486] CMake Nightly Date Stamp --- Source/CMakeVersion.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index a4b06d472..852d36078 100644 --- a/Source/CMakeVersion.cmake +++ b/Source/CMakeVersion.cmake @@ -1,5 +1,5 @@ # CMake version number components. set(CMake_VERSION_MAJOR 3) set(CMake_VERSION_MINOR 4) -set(CMake_VERSION_PATCH 20151007) +set(CMake_VERSION_PATCH 20151008) #set(CMake_VERSION_RC 1) From 13c22d280e3b4d4f73e607617d18a3d55b509099 Mon Sep 17 00:00:00 2001 From: KWSys Robot Date: Tue, 6 Oct 2015 10:29:47 -0400 Subject: [PATCH 066/486] KWSys 2015-10-06 (ed82989c) Extract upstream KWSys using the following shell commands. $ git archive --prefix=upstream-kwsys/ ed82989c | tar x $ git shortlog --no-merges --abbrev=8 --format='%h %s' d79801bb..ed82989c Brad King (3): 9baab632 SystemTools: Keep stat st_mtim field existence private 39475e20 SystemTools: Refactor utimes invocation ed82989c SystemTools: Implement nanosecond file times on OS X --- CMakeLists.txt | 11 ++++++----- Configure.hxx.in | 4 ---- SystemTools.cxx | 37 +++++++++++++++++++++++++++++-------- kwsysPlatformTestsCXX.cxx | 15 ++++++++++++++- 4 files changed, 49 insertions(+), 18 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 84010d8b4..ce7f5635d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -342,11 +342,6 @@ ENDIF() # capabilities and parent project's request. Enforce 0/1 as only # possible values for configuration into Configure.hxx. -IF(UNIX) - KWSYS_PLATFORM_CXX_TEST(KWSYS_STAT_HAS_ST_MTIM - "Checking whether struct stat has st_mtim member" DIRECT) -ENDIF() - # Check existence and uniqueness of long long and __int64. KWSYS_PLATFORM_CXX_TEST(KWSYS_CXX_HAS_LONG_LONG "Checking whether C++ compiler has 'long long'" DIRECT) @@ -511,12 +506,18 @@ IF(KWSYS_USE_SystemTools) "Checking whether CXX compiler has utimes" DIRECT) KWSYS_PLATFORM_CXX_TEST(KWSYS_CXX_HAS_UTIMENSAT "Checking whether CXX compiler has utimensat" DIRECT) + KWSYS_PLATFORM_CXX_TEST(KWSYS_CXX_STAT_HAS_ST_MTIM + "Checking whether CXX compiler struct stat has st_mtim member" DIRECT) + KWSYS_PLATFORM_CXX_TEST(KWSYS_CXX_STAT_HAS_ST_MTIMESPEC + "Checking whether CXX compiler struct stat has st_mtimespec member" DIRECT) SET_PROPERTY(SOURCE SystemTools.cxx APPEND PROPERTY COMPILE_DEFINITIONS KWSYS_CXX_HAS_SETENV=${KWSYS_CXX_HAS_SETENV} KWSYS_CXX_HAS_UNSETENV=${KWSYS_CXX_HAS_UNSETENV} KWSYS_CXX_HAS_ENVIRON_IN_STDLIB_H=${KWSYS_CXX_HAS_ENVIRON_IN_STDLIB_H} KWSYS_CXX_HAS_UTIMES=${KWSYS_CXX_HAS_UTIMES} KWSYS_CXX_HAS_UTIMENSAT=${KWSYS_CXX_HAS_UTIMENSAT} + KWSYS_CXX_STAT_HAS_ST_MTIM=${KWSYS_CXX_STAT_HAS_ST_MTIM} + KWSYS_CXX_STAT_HAS_ST_MTIMESPEC=${KWSYS_CXX_STAT_HAS_ST_MTIMESPEC} ) ENDIF() diff --git a/Configure.hxx.in b/Configure.hxx.in index 3faf8620e..ff8e49dba 100644 --- a/Configure.hxx.in +++ b/Configure.hxx.in @@ -18,9 +18,6 @@ /* Whether wstring is available. */ #define @KWSYS_NAMESPACE@_STL_HAS_WSTRING @KWSYS_STL_HAS_WSTRING@ -/* Whether struct stat has the st_mtim member for high resolution times. */ -#define @KWSYS_NAMESPACE@_STAT_HAS_ST_MTIM @KWSYS_STAT_HAS_ST_MTIM@ - /* If building a C++ file in kwsys itself, give the source file access to the macros without a configured namespace. */ #if defined(KWSYS_NAMESPACE) @@ -28,7 +25,6 @@ # define kwsys @KWSYS_NAMESPACE@ # endif # define KWSYS_NAME_IS_KWSYS @KWSYS_NAMESPACE@_NAME_IS_KWSYS -# define KWSYS_STAT_HAS_ST_MTIM @KWSYS_NAMESPACE@_STAT_HAS_ST_MTIM # define KWSYS_STL_HAS_WSTRING @KWSYS_NAMESPACE@_STL_HAS_WSTRING #endif diff --git a/SystemTools.cxx b/SystemTools.cxx index 262af278e..da34eb943 100644 --- a/SystemTools.cxx +++ b/SystemTools.cxx @@ -1366,15 +1366,18 @@ bool SystemTools::Touch(const std::string& filename, bool create) struct timeval mtime; gettimeofday(&mtime, 0); # if KWSYS_CXX_HAS_UTIMES - struct timeval times[2] = - { -# if KWSYS_STAT_HAS_ST_MTIM - {st.st_atim.tv_sec, st.st_atim.tv_nsec/1000}, /* tv_sec, tv_usec */ + struct timeval atime; +# if KWSYS_CXX_STAT_HAS_ST_MTIM + atime.tv_sec = st.st_atim.tv_sec; + atime.tv_usec = st.st_atim.tv_nsec/1000; +# elif KWSYS_CXX_STAT_HAS_ST_MTIMESPEC + atime.tv_sec = st.st_atimespec.tv_sec; + atime.tv_usec = st.st_atimespec.tv_nsec/1000; # else - {st.st_atime, 0}, + atime.tv_sec = st.st_atime; + atime.tv_usec = 0; # endif - mtime - }; + struct timeval times[2] = { atime, mtime }; if(utimes(filename.c_str(), times) < 0) { return false; @@ -1408,7 +1411,7 @@ bool SystemTools::FileTimeCompare(const std::string& f1, { return false; } -# if KWSYS_STAT_HAS_ST_MTIM +# if KWSYS_CXX_STAT_HAS_ST_MTIM // Compare using nanosecond resolution. if(s1.st_mtim.tv_sec < s2.st_mtim.tv_sec) { @@ -1426,6 +1429,24 @@ bool SystemTools::FileTimeCompare(const std::string& f1, { *result = 1; } +# elif KWSYS_CXX_STAT_HAS_ST_MTIMESPEC + // Compare using nanosecond resolution. + if(s1.st_mtimespec.tv_sec < s2.st_mtimespec.tv_sec) + { + *result = -1; + } + else if(s1.st_mtimespec.tv_sec > s2.st_mtimespec.tv_sec) + { + *result = 1; + } + else if(s1.st_mtimespec.tv_nsec < s2.st_mtimespec.tv_nsec) + { + *result = -1; + } + else if(s1.st_mtimespec.tv_nsec > s2.st_mtimespec.tv_nsec) + { + *result = 1; + } # else // Compare using 1 second resolution. if(s1.st_mtime < s2.st_mtime) diff --git a/kwsysPlatformTestsCXX.cxx b/kwsysPlatformTestsCXX.cxx index 94579b3f8..962693705 100644 --- a/kwsysPlatformTestsCXX.cxx +++ b/kwsysPlatformTestsCXX.cxx @@ -32,7 +32,7 @@ int main() } #endif -#ifdef TEST_KWSYS_STAT_HAS_ST_MTIM +#ifdef TEST_KWSYS_CXX_STAT_HAS_ST_MTIM #include #include #include @@ -45,6 +45,19 @@ int main() } #endif +#ifdef TEST_KWSYS_CXX_STAT_HAS_ST_MTIMESPEC +#include +#include +#include +int main() +{ + struct stat stat1; + (void)stat1.st_mtimespec.tv_sec; + (void)stat1.st_mtimespec.tv_nsec; + return 0; +} +#endif + #ifdef TEST_KWSYS_CXX_SAME_LONG_AND___INT64 void function(long**) {} int main() From 265fb0cdc72fc46347ae0b8964078ca6d0a978e1 Mon Sep 17 00:00:00 2001 From: Brad King Date: Thu, 8 Oct 2015 13:26:44 -0400 Subject: [PATCH 067/486] cmFileTimeComparison: Update for lack of cmsys_STAT_HAS_ST_MTIM The KWSys Configure.hxx header no longer exposes this value. Take the value from the KWSys try compile result variable instead. --- Source/CMakeLists.txt | 12 ++++++++++++ Source/cmFileTimeComparison.cxx | 4 ++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/Source/CMakeLists.txt b/Source/CMakeLists.txt index ae5b03ff9..28a3fd143 100644 --- a/Source/CMakeLists.txt +++ b/Source/CMakeLists.txt @@ -548,6 +548,18 @@ foreach(v CURL_CA_BUNDLE CURL_CA_PATH) endif() endforeach() +foreach(check + STAT_HAS_ST_MTIM + ) + if(KWSYS_CXX_${check}_COMPILED) # abuse KWSys check cache entry + set(CMake_${check} 1) + else() + set(CMake_${check} 0) + endif() + set_property(SOURCE cmFileTimeComparison.cxx APPEND PROPERTY + COMPILE_DEFINITIONS CMake_${check}=${CMake_${check}}) +endforeach() + # create a library used by the command line and the GUI add_library(CMakeLib ${SRCS}) target_link_libraries(CMakeLib cmsys diff --git a/Source/cmFileTimeComparison.cxx b/Source/cmFileTimeComparison.cxx index 13e2a66e0..8d5e08daa 100644 --- a/Source/cmFileTimeComparison.cxx +++ b/Source/cmFileTimeComparison.cxx @@ -148,7 +148,7 @@ int cmFileTimeComparisonInternal::Compare(cmFileTimeComparison_Type* s1, cmFileTimeComparison_Type* s2) { #if !defined(_WIN32) || defined(__CYGWIN__) -# if cmsys_STAT_HAS_ST_MTIM +# if CMake_STAT_HAS_ST_MTIM // Compare using nanosecond resolution. if(s1->st_mtim.tv_sec < s2->st_mtim.tv_sec) { @@ -190,7 +190,7 @@ bool cmFileTimeComparisonInternal::TimesDiffer(cmFileTimeComparison_Type* s1, cmFileTimeComparison_Type* s2) { #if !defined(_WIN32) || defined(__CYGWIN__) -# if cmsys_STAT_HAS_ST_MTIM +# if CMake_STAT_HAS_ST_MTIM // Times are integers in units of 1ns. long long bil = 1000000000; long long t1 = s1->st_mtim.tv_sec * bil + s1->st_mtim.tv_nsec; From 0faccb839a75ab94f1ab39681a1ebe567647be6b Mon Sep 17 00:00:00 2001 From: Brad King Date: Thu, 8 Oct 2015 13:27:07 -0400 Subject: [PATCH 068/486] bootstrap: Drop unnecessary KWSys platform check The KWSys Configure.hxx header no longer needs KWSYS_STAT_HAS_ST_MTIM. Our bootstrap-built CMake does not need to handle nanosecond precision file times anyway. --- bootstrap | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/bootstrap b/bootstrap index ca4fd5ecc..ca86528ef 100755 --- a/bootstrap +++ b/bootstrap @@ -493,7 +493,7 @@ cmake_kwsys_config_replace_string () s/@KWSYS_LFS_REQUESTED@/${KWSYS_LFS_REQUESTED}/g; s/@KWSYS_NAME_IS_KWSYS@/${KWSYS_NAME_IS_KWSYS}/g; s/@KWSYS_STL_HAS_WSTRING@/${KWSYS_STL_HAS_WSTRING}/g; - s/@KWSYS_STAT_HAS_ST_MTIM@/${KWSYS_STAT_HAS_ST_MTIM}/g;}" >> "${OUTFILE}${_tmp}" + }" >> "${OUTFILE}${_tmp}" if [ -f "${OUTFILE}${_tmp}" ]; then if "${_diff}" "${OUTFILE}" "${OUTFILE}${_tmp}" > /dev/null 2> /dev/null ; then #echo "Files are the same" @@ -1173,7 +1173,6 @@ KWSYS_NAME_IS_KWSYS=0 KWSYS_BUILD_SHARED=0 KWSYS_LFS_AVAILABLE=0 KWSYS_LFS_REQUESTED=0 -KWSYS_STAT_HAS_ST_MTIM=0 KWSYS_STL_HAS_WSTRING=0 KWSYS_CXX_HAS_SETENV=0 KWSYS_CXX_HAS_UNSETENV=0 @@ -1217,15 +1216,6 @@ else echo "${cmake_cxx_compiler} does not have stl wstring" fi -if cmake_try_run "${cmake_cxx_compiler}" \ - "${cmake_cxx_flags} -DTEST_KWSYS_STAT_HAS_ST_MTIM" \ - "${cmake_source_dir}/Source/kwsys/kwsysPlatformTestsCXX.cxx" >> cmake_bootstrap.log 2>&1; then - KWSYS_STAT_HAS_ST_MTIM=1 - echo "${cmake_cxx_compiler} has struct stat with st_mtim member" -else - echo "${cmake_cxx_compiler} does not have struct stat with st_mtim member" -fi - # Just to be safe, let us store compiler and flags to the header file cmake_bootstrap_version='$Revision$' From 8d27b407787549a90d47d273a753bb0000e5e73e Mon Sep 17 00:00:00 2001 From: Brad King Date: Thu, 8 Oct 2015 13:37:37 -0400 Subject: [PATCH 069/486] cmFileTimeComparison: Port to OS X nanosecond times (#15769) --- Source/CMakeLists.txt | 1 + Source/cmFileTimeComparison.cxx | 35 +++++++++++++++++++++++++++++++++ 2 files changed, 36 insertions(+) diff --git a/Source/CMakeLists.txt b/Source/CMakeLists.txt index 28a3fd143..ee690e68a 100644 --- a/Source/CMakeLists.txt +++ b/Source/CMakeLists.txt @@ -550,6 +550,7 @@ endforeach() foreach(check STAT_HAS_ST_MTIM + STAT_HAS_ST_MTIMESPEC ) if(KWSYS_CXX_${check}_COMPILED) # abuse KWSys check cache entry set(CMake_${check} 1) diff --git a/Source/cmFileTimeComparison.cxx b/Source/cmFileTimeComparison.cxx index 8d5e08daa..279b61da9 100644 --- a/Source/cmFileTimeComparison.cxx +++ b/Source/cmFileTimeComparison.cxx @@ -166,6 +166,24 @@ int cmFileTimeComparisonInternal::Compare(cmFileTimeComparison_Type* s1, { return 1; } +# elif CMake_STAT_HAS_ST_MTIMESPEC + // Compare using nanosecond resolution. + if(s1->st_mtimespec.tv_sec < s2->st_mtimespec.tv_sec) + { + return -1; + } + else if(s1->st_mtimespec.tv_sec > s2->st_mtimespec.tv_sec) + { + return 1; + } + else if(s1->st_mtimespec.tv_nsec < s2->st_mtimespec.tv_nsec) + { + return -1; + } + else if(s1->st_mtimespec.tv_nsec > s2->st_mtimespec.tv_nsec) + { + return 1; + } # else // Compare using 1 second resolution. if(s1->st_mtime < s2->st_mtime) @@ -207,6 +225,23 @@ bool cmFileTimeComparisonInternal::TimesDiffer(cmFileTimeComparison_Type* s1, { return false; } +# elif CMake_STAT_HAS_ST_MTIMESPEC + // Times are integers in units of 1ns. + long long bil = 1000000000; + long long t1 = s1->st_mtimespec.tv_sec * bil + s1->st_mtimespec.tv_nsec; + long long t2 = s2->st_mtimespec.tv_sec * bil + s2->st_mtimespec.tv_nsec; + if(t1 < t2) + { + return (t2 - t1) >= bil; + } + else if(t2 < t1) + { + return (t1 - t2) >= bil; + } + else + { + return false; + } # else // Times are integers in units of 1s. if(s1->st_mtime < s2->st_mtime) From 47f4b3b662da7f49fd0353b978eaf781608e9282 Mon Sep 17 00:00:00 2001 From: Kevin Burge Date: Thu, 8 Oct 2015 13:27:54 -0500 Subject: [PATCH 070/486] cmake-mode.el: unscreamify symbols instead of words cmake-unscreamify-buffer should unscream more than just words. For example: CHECK_FUNCTION_EXISTS (...) --- Auxiliary/cmake-mode.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Auxiliary/cmake-mode.el b/Auxiliary/cmake-mode.el index e50ae7b95..08ac4905e 100644 --- a/Auxiliary/cmake-mode.el +++ b/Auxiliary/cmake-mode.el @@ -177,7 +177,7 @@ the indentation. Otherwise it retains the same position on the line" (interactive) (save-excursion (goto-char (point-min)) - (while (re-search-forward "^\\([ \t]*\\)\\(\\w+\\)\\([ \t]*(\\)" nil t) + (while (re-search-forward "^\\([ \t]*\\)\\_<\\(\\(?:\\w\\|\\s_\\)+\\)\\_>\\([ \t]*(\\)" nil t) (replace-match (concat (match-string 1) From 27916f2cd10904deda1a44bf221fbdef7ba1af66 Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Wed, 7 Oct 2015 00:37:31 +0200 Subject: [PATCH 071/486] cmLocalGenerator: Add cmake instance accessor. --- Source/cmLocalGenerator.cxx | 5 +++++ Source/cmLocalGenerator.h | 2 ++ 2 files changed, 7 insertions(+) diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx index b26151ccf..6647894d1 100644 --- a/Source/cmLocalGenerator.cxx +++ b/Source/cmLocalGenerator.cxx @@ -2858,6 +2858,11 @@ cmLocalGenerator return source.GetLanguage(); } +cmake* cmLocalGenerator::GetCMakeInstance() const +{ + return this->GlobalGenerator->GetCMakeInstance(); +} + //---------------------------------------------------------------------------- std::string cmLocalGenerator::GetTargetDirectory(cmTarget const&) const diff --git a/Source/cmLocalGenerator.h b/Source/cmLocalGenerator.h index 33fede14a..d9623cb36 100644 --- a/Source/cmLocalGenerator.h +++ b/Source/cmLocalGenerator.h @@ -251,6 +251,8 @@ public: */ bool NeedBackwardsCompatibility_2_4(); + cmake* GetCMakeInstance() const; + /** * Generate a Mac OS X application bundle Info.plist file. */ From 370bb92c10cd8fec7770267c93515623e4168012 Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Thu, 8 Oct 2015 23:28:46 +0200 Subject: [PATCH 072/486] cmGeneratorTarget: Issue messages through the local generator. --- Source/cmGeneratorTarget.cxx | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx index 3fb0dc7fa..1a0bbe8cd 100644 --- a/Source/cmGeneratorTarget.cxx +++ b/Source/cmGeneratorTarget.cxx @@ -402,7 +402,8 @@ std::string cmGeneratorTarget::GetOutputName(const std::string& config, { // An empty map entry indicates we have been called recursively // from the above block. - this->Makefile->GetCMakeInstance()->IssueMessage( + this->LocalGenerator->GetCMakeInstance() + ->IssueMessage( cmake::FATAL_ERROR, "Target '" + this->GetName() + "' OUTPUT_NAME depends on itself.", this->Target->GetBacktrace()); @@ -951,7 +952,7 @@ static bool processSources(cmGeneratorTarget const* tgt, } if (!usedSources.empty()) { - mf->GetCMakeInstance()->IssueMessage(cmake::LOG, + tgt->GetLocalGenerator()->GetCMakeInstance()->IssueMessage(cmake::LOG, std::string("Used sources for target ") + tgt->GetName() + ":\n" + usedSources, (*it)->ge->GetBacktrace()); @@ -1521,7 +1522,7 @@ public: << "\" but the target was not found. Perhaps a find_package() " "call is missing for an IMPORTED target, or an ALIAS target is " "missing?"; - this->Makefile->GetCMakeInstance()->IssueMessage( + this->Target->GetLocalGenerator()->GetCMakeInstance()->IssueMessage( messageType, e.str(), this->Target->Target->GetBacktrace()); } } @@ -2444,7 +2445,7 @@ static void processIncludeDirectories(cmGeneratorTarget const* tgt, } if (!usedIncludes.empty()) { - mf->GetCMakeInstance()->IssueMessage(cmake::LOG, + tgt->GetLocalGenerator()->GetCMakeInstance()->IssueMessage(cmake::LOG, std::string("Used includes for target ") + tgt->GetName() + ":\n" + usedIncludes, (*it)->ge->GetBacktrace()); @@ -2577,7 +2578,7 @@ static void processCompileOptionsInternal(cmGeneratorTarget const* tgt, } if (!usedOptions.empty()) { - mf->GetCMakeInstance()->IssueMessage(cmake::LOG, + tgt->GetLocalGenerator()->GetCMakeInstance()->IssueMessage(cmake::LOG, std::string("Used compile ") + logName + std::string(" for target ") + tgt->GetName() + ":\n" @@ -4212,7 +4213,7 @@ cmGeneratorTarget::ReportPropertyOrigin(const std::string &p, areport += result; areport += "\"):\n" + report; - this->Makefile->GetCMakeInstance()->IssueMessage(cmake::LOG, areport); + this->LocalGenerator->GetCMakeInstance()->IssueMessage(cmake::LOG, areport); } //---------------------------------------------------------------------------- From a8429a402da4aeb717f4af234c8d14d1c4e10ed7 Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Wed, 5 Aug 2015 17:37:51 +0200 Subject: [PATCH 073/486] cmTarget: Split storage of link implementation from backtraces. --- Source/cmListFileCache.h | 9 --------- Source/cmTarget.cxx | 36 +++++++++++++++--------------------- 2 files changed, 15 insertions(+), 30 deletions(-) diff --git a/Source/cmListFileCache.h b/Source/cmListFileCache.h index 0afd7f5d3..5f1a3108e 100644 --- a/Source/cmListFileCache.h +++ b/Source/cmListFileCache.h @@ -111,13 +111,4 @@ struct cmListFile std::vector Functions; }; -struct cmValueWithOrigin { - cmValueWithOrigin(const std::string &value, - const cmListFileBacktrace &bt) - : Value(value), Backtrace(bt) - {} - std::string Value; - cmListFileBacktrace Backtrace; -}; - #endif diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx index abfc40b8c..63c7740e5 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -114,7 +114,8 @@ public: std::vector CompileDefinitionsBacktraces; std::vector SourceEntries; std::vector SourceBacktraces; - std::vector LinkImplementationPropertyEntries; + std::vector LinkImplementationPropertyEntries; + std::vector LinkImplementationPropertyBacktraces; }; //---------------------------------------------------------------------------- @@ -1380,11 +1381,12 @@ void cmTarget::SetProperty(const std::string& prop, const char* value) else if (prop == "LINK_LIBRARIES") { this->Internal->LinkImplementationPropertyEntries.clear(); + this->Internal->LinkImplementationPropertyBacktraces.clear(); if (value) { cmListFileBacktrace lfbt = this->Makefile->GetBacktrace(); - cmValueWithOrigin entry(value, lfbt); - this->Internal->LinkImplementationPropertyEntries.push_back(entry); + this->Internal->LinkImplementationPropertyEntries.push_back(value); + this->Internal->LinkImplementationPropertyBacktraces.push_back(lfbt); } } else if (prop == "SOURCES") @@ -1482,8 +1484,8 @@ void cmTarget::AppendProperty(const std::string& prop, const char* value, if (value && *value) { cmListFileBacktrace lfbt = this->Makefile->GetBacktrace(); - cmValueWithOrigin entry(value, lfbt); - this->Internal->LinkImplementationPropertyEntries.push_back(entry); + this->Internal->LinkImplementationPropertyEntries.push_back(value); + this->Internal->LinkImplementationPropertyBacktraces.push_back(lfbt); } } else if (prop == "SOURCES") @@ -2048,17 +2050,7 @@ const char *cmTarget::GetProperty(const std::string& prop, } static std::string output; - output = ""; - std::string sep; - for (std::vector::const_iterator - it = this->Internal->LinkImplementationPropertyEntries.begin(), - end = this->Internal->LinkImplementationPropertyEntries.end(); - it != end; ++it) - { - output += sep; - output += it->Value; - sep = ";"; - } + output = cmJoin(this->Internal->LinkImplementationPropertyEntries, ";"); return output.c_str(); } // the type property returns what type the target is @@ -3223,19 +3215,21 @@ void cmTarget::ComputeLinkImplementationLibraries( cmOptionalLinkImplementation& impl, cmTarget const* head) const { + std::vector::const_iterator btIt = + this->Internal->LinkImplementationPropertyBacktraces.begin(); // Collect libraries directly linked in this configuration. - for (std::vector::const_iterator + for (std::vector::const_iterator le = this->Internal->LinkImplementationPropertyEntries.begin(), end = this->Internal->LinkImplementationPropertyEntries.end(); - le != end; ++le) + le != end; ++le, ++btIt) { std::vector llibs; cmGeneratorExpressionDAGChecker dagChecker( this->GetName(), "LINK_LIBRARIES", 0, 0); - cmGeneratorExpression ge(le->Backtrace); + cmGeneratorExpression ge(*btIt); cmsys::auto_ptr const cge = - ge.Parse(le->Value); + ge.Parse(*le); std::string const evaluated = cge->Evaluate(this->Makefile, config, false, head, &dagChecker); cmSystemTools::ExpandListArgument(evaluated, llibs); @@ -3290,7 +3284,7 @@ void cmTarget::ComputeLinkImplementationLibraries( // The entry is meant for this configuration. impl.Libraries.push_back( cmLinkImplItem(name, this->FindTargetToLink(name), - le->Backtrace, evaluated != le->Value)); + *btIt, evaluated != *le)); } std::set const& seenProps = cge->GetSeenTargetProperties(); From df42dbb3558a6ba604ab584b21dfe7f8722eb025 Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Wed, 5 Aug 2015 18:17:55 +0200 Subject: [PATCH 074/486] cmGeneratorTarget: Move link implementation from cmTarget. --- Source/cmGeneratorExpressionNode.cxx | 2 +- Source/cmGeneratorTarget.cxx | 172 +++++++++++++++++++++++-- Source/cmGeneratorTarget.h | 23 ++++ Source/cmLocalGenerator.cxx | 4 +- Source/cmTarget.cxx | 185 ++------------------------- Source/cmTarget.h | 26 +--- 6 files changed, 200 insertions(+), 212 deletions(-) diff --git a/Source/cmGeneratorExpressionNode.cxx b/Source/cmGeneratorExpressionNode.cxx index 1c350ab2d..b61e26f2a 100644 --- a/Source/cmGeneratorExpressionNode.cxx +++ b/Source/cmGeneratorExpressionNode.cxx @@ -1122,7 +1122,7 @@ static const struct TargetPropertyNode : public cmGeneratorExpressionNode else if(!interfacePropertyName.empty()) { if(cmLinkImplementationLibraries const* impl = - target->GetLinkImplementationLibraries(context->Config)) + gtgt->GetLinkImplementationLibraries(context->Config)) { linkedTargetsContent = getLinkedTargetsContent(impl->Libraries, target, diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx index 1a0bbe8cd..278194e5c 100644 --- a/Source/cmGeneratorTarget.cxx +++ b/Source/cmGeneratorTarget.cxx @@ -847,7 +847,7 @@ static void AddInterfaceEntries( std::vector& entries) { if(cmLinkImplementationLibraries const* impl = - thisTarget->Target->GetLinkImplementationLibraries(config)) + thisTarget->GetLinkImplementationLibraries(config)) { for (std::vector::const_iterator it = impl->Libraries.begin(), end = impl->Libraries.end(); @@ -1901,7 +1901,7 @@ cmGeneratorTarget::GetLinkImplementationClosure( std::set emitted; cmLinkImplementationLibraries const* impl - = this->Target->GetLinkImplementationLibraries(config); + = this->GetLinkImplementationLibraries(config); for(std::vector::const_iterator it = impl->Libraries.begin(); @@ -2501,7 +2501,7 @@ cmGeneratorTarget::GetIncludeDirectories(const std::string& config, if(this->Makefile->IsOn("APPLE")) { cmLinkImplementationLibraries const* impl = - this->Target->GetLinkImplementationLibraries(config); + this->GetLinkImplementationLibraries(config); for(std::vector::const_iterator it = impl->Libraries.begin(); it != impl->Libraries.end(); ++it) @@ -4363,8 +4363,7 @@ void cmGeneratorTarget::ComputeLinkInterface(const std::string& config, { // The link implementation is the default link interface. cmLinkImplementationLibraries const* - impl = this->Target->GetLinkImplementationLibrariesInternal(config, - headTarget); + impl = this->GetLinkImplementationLibrariesInternal(config, headTarget); iface.ImplementationIsInterface = true; iface.WrongConfigLibraries = impl->WrongConfigLibraries; } @@ -4558,8 +4557,7 @@ cmGeneratorTarget::ComputeLinkInterfaceLibraries( { // The link implementation is the default link interface. cmLinkImplementationLibraries const* impl = - this->Target->GetLinkImplementationLibrariesInternal(config, - headTarget); + this->GetLinkImplementationLibrariesInternal(config, headTarget); iface.Libraries.insert(iface.Libraries.end(), impl->Libraries.begin(), impl->Libraries.end()); if(this->Target->GetPolicyStatusCMP0022() == cmPolicies::WARN && @@ -4674,12 +4672,12 @@ cmGeneratorTarget::GetLinkImplementation(const std::string& config) const return 0; } - cmOptionalLinkImplementation& impl = this->Target->GetLinkImplMap(config); + std::string CONFIG = cmSystemTools::UpperCase(config); + cmOptionalLinkImplementation& impl = this->LinkImplMap[CONFIG][this->Target]; if(!impl.LibrariesDone) { impl.LibrariesDone = true; - this->Target->ComputeLinkImplementationLibraries(config, impl, - this->Target); + this->ComputeLinkImplementationLibraries(config, impl, this->Target); } if(!impl.LanguagesDone) { @@ -4819,9 +4817,161 @@ bool cmGeneratorTarget::HaveBuildTreeRPATH(const std::string& config) const return false; } if(cmLinkImplementationLibraries const* impl = - this->Target->GetLinkImplementationLibraries(config)) + this->GetLinkImplementationLibraries(config)) { return !impl->Libraries.empty(); } return false; } + +//---------------------------------------------------------------------------- +cmLinkImplementationLibraries const* +cmGeneratorTarget::GetLinkImplementationLibraries( + const std::string& config) const +{ + return this->GetLinkImplementationLibrariesInternal(config, this->Target); +} + +//---------------------------------------------------------------------------- +cmLinkImplementationLibraries const* +cmGeneratorTarget::GetLinkImplementationLibrariesInternal( + const std::string& config, cmTarget const* head) const +{ + // There is no link implementation for imported targets. + if(this->IsImported()) + { + return 0; + } + + // Populate the link implementation libraries for this configuration. + std::string CONFIG = cmSystemTools::UpperCase(config); + HeadToLinkImplementationMap& hm = + this->LinkImplMap[CONFIG]; + + // If the link implementation does not depend on the head target + // then return the one we computed first. + if(!hm.empty() && !hm.begin()->second.HadHeadSensitiveCondition) + { + return &hm.begin()->second; + } + + cmOptionalLinkImplementation& impl = hm[head]; + if(!impl.LibrariesDone) + { + impl.LibrariesDone = true; + this->ComputeLinkImplementationLibraries(config, impl, head); + } + return &impl; +} + +//---------------------------------------------------------------------------- +void cmGeneratorTarget::ComputeLinkImplementationLibraries( + const std::string& config, + cmOptionalLinkImplementation& impl, + cmTarget const* head) const +{ + cmStringRange entryRange = + this->Target->GetLinkImplementationEntries(); + cmBacktraceRange btRange = + this->Target->GetLinkImplementationBacktraces(); + cmBacktraceRange::const_iterator btIt = btRange.begin(); + // Collect libraries directly linked in this configuration. + for (cmStringRange::const_iterator le = entryRange.begin(), + end = entryRange.end(); le != end; ++le, ++btIt) + { + std::vector llibs; + cmGeneratorExpressionDAGChecker dagChecker( + this->GetName(), + "LINK_LIBRARIES", 0, 0); + cmGeneratorExpression ge(*btIt); + cmsys::auto_ptr const cge = + ge.Parse(*le); + std::string const evaluated = + cge->Evaluate(this->Makefile, config, false, head, &dagChecker); + cmSystemTools::ExpandListArgument(evaluated, llibs); + if(cge->GetHadHeadSensitiveCondition()) + { + impl.HadHeadSensitiveCondition = true; + } + + for(std::vector::const_iterator li = llibs.begin(); + li != llibs.end(); ++li) + { + // Skip entries that resolve to the target itself or are empty. + std::string name = this->Target->CheckCMP0004(*li); + if(name == this->GetName() || name.empty()) + { + if(name == this->GetName()) + { + bool noMessage = false; + cmake::MessageType messageType = cmake::FATAL_ERROR; + std::ostringstream e; + switch(this->Target->GetPolicyStatusCMP0038()) + { + case cmPolicies::WARN: + { + e << cmPolicies::GetPolicyWarning(cmPolicies::CMP0038) << "\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 itself."; + this->LocalGenerator->GetCMakeInstance()->IssueMessage( + messageType, e.str(), this->Target->GetBacktrace()); + if (messageType == cmake::FATAL_ERROR) + { + return; + } + } + } + continue; + } + + // The entry is meant for this configuration. + impl.Libraries.push_back( + cmLinkImplItem(name, this->Target->FindTargetToLink(name), + *btIt, evaluated != *le)); + } + + std::set const& seenProps = cge->GetSeenTargetProperties(); + for (std::set::const_iterator it = seenProps.begin(); + it != seenProps.end(); ++it) + { + if (!this->GetProperty(*it)) + { + this->Target->LinkImplicitNullProperties.insert(*it); + } + } + cge->GetMaxLanguageStandard(this->Target, + this->MaxLanguageStandards); + } + + cmTarget::LinkLibraryType linkType = this->Target->ComputeLinkType(config); + cmTarget::LinkLibraryVectorType const& oldllibs = + this->Target->GetOriginalLinkLibraries(); + for(cmTarget::LinkLibraryVectorType::const_iterator li = oldllibs.begin(); + li != oldllibs.end(); ++li) + { + if(li->second != cmTarget::GENERAL && li->second != linkType) + { + std::string name = this->Target->CheckCMP0004(li->first); + if(name == this->GetName() || name.empty()) + { + continue; + } + // Support OLD behavior for CMP0003. + impl.WrongConfigLibraries.push_back( + cmLinkItem(name, this->Target->FindTargetToLink(name))); + } + } +} diff --git a/Source/cmGeneratorTarget.h b/Source/cmGeneratorTarget.h index e8c5e0479..f5805f1cd 100644 --- a/Source/cmGeneratorTarget.h +++ b/Source/cmGeneratorTarget.h @@ -207,6 +207,13 @@ public: cmOptionalLinkImplementation& impl ) const; + cmLinkImplementationLibraries const* + GetLinkImplementationLibraries(const std::string& config) const; + + void ComputeLinkImplementationLibraries(const std::string& config, + cmOptionalLinkImplementation& impl, + cmTarget const* head) const; + // Compute the set of languages compiled by the target. This is // computed every time it is called because the languages can change // when source file properties are changed and we do not have enough @@ -462,6 +469,16 @@ private: void GetSourceFiles(std::vector& files, const std::string& config) const; + struct HeadToLinkImplementationMap: + public std::map {}; + typedef std::map LinkImplMapType; + mutable LinkImplMapType LinkImplMap; + + cmLinkImplementationLibraries const* + GetLinkImplementationLibrariesInternal(const std::string& config, + cmTarget const* head) const; + typedef std::pair OutputNameKey; typedef std::map OutputNameMapType; mutable OutputNameMapType OutputNameMap; @@ -477,6 +494,12 @@ public: std::vector const& GetLinkImplementationClosure(const std::string& config) const; + mutable std::map MaxLanguageStandards; + std::map const& + GetMaxLanguageStandards() const + { + return this->MaxLanguageStandards; + } }; struct cmStrictTargetComparison { diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx index 6647894d1..06eb004e0 100644 --- a/Source/cmLocalGenerator.cxx +++ b/Source/cmLocalGenerator.cxx @@ -1152,8 +1152,8 @@ void cmLocalGenerator::AddCompileOptions( } for(std::map::const_iterator it - = target->GetMaxLanguageStandards().begin(); - it != target->GetMaxLanguageStandards().end(); ++it) + = gtgt->GetMaxLanguageStandards().begin(); + it != gtgt->GetMaxLanguageStandards().end(); ++it) { const char* standard = target->GetProperty(it->first + "_STANDARD"); if(!standard) diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx index 63c7740e5..e1642cc95 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -95,12 +95,6 @@ public: typedef std::map ImportInfoMapType; ImportInfoMapType ImportInfoMap; - struct HeadToLinkImplementationMap: - public std::map {}; - typedef std::map LinkImplMapType; - LinkImplMapType LinkImplMap; - std::set UtilityItems; bool UtilityItemsDone; @@ -405,7 +399,6 @@ void cmTarget::FinishConfigure() // on-demand during the configuration. This ensures that build // system generation uses up-to-date information even if other cache // invalidation code in this source file is buggy. - this->ClearLinkMaps(); #if defined(_WIN32) && !defined(__CYGWIN__) // Do old-style link dependency analysis only for CM_USE_OLD_VS6. @@ -416,12 +409,6 @@ void cmTarget::FinishConfigure() #endif } -//---------------------------------------------------------------------------- -void cmTarget::ClearLinkMaps() -{ - this->Internal->LinkImplMap.clear(); -} - //---------------------------------------------------------------------------- cmListFileBacktrace const& cmTarget::GetBacktrace() const { @@ -884,7 +871,6 @@ void cmTarget::AddLinkLibrary(cmMakefile& mf, this->LinkLibrariesForVS6.push_back( tmp ); #endif this->OriginalLinkLibraries.push_back(tmp); - this->ClearLinkMaps(); // Add the explicit dependency information for this target. This is // simply a set of libraries separated by ";". There should always @@ -983,6 +969,16 @@ cmBacktraceRange cmTarget::GetSourceBacktraces() const return cmMakeRange(this->Internal->SourceBacktraces); } +cmStringRange cmTarget::GetLinkImplementationEntries() const +{ + return cmMakeRange(this->Internal->LinkImplementationPropertyEntries); +} + +cmBacktraceRange cmTarget::GetLinkImplementationBacktraces() const +{ + return cmMakeRange(this->Internal->LinkImplementationPropertyBacktraces); +} + #if defined(_WIN32) && !defined(__CYGWIN__) //---------------------------------------------------------------------------- void @@ -1611,10 +1607,6 @@ void cmTarget::MaybeInvalidatePropertyCache(const std::string& prop) { this->Internal->ImportInfoMap.clear(); } - if(!this->IsImported() && cmHasLiteralPrefix(prop, "LINK_INTERFACE_")) - { - this->ClearLinkMaps(); - } } //---------------------------------------------------------------------------- @@ -3162,163 +3154,6 @@ void cmTarget::ComputeImportInfo(std::string const& desired_config, } } -cmOptionalLinkImplementation& -cmTarget::GetLinkImplMap(std::string const& config) const -{ - // Populate the link implementation for this configuration. - std::string CONFIG = cmSystemTools::UpperCase(config); - return Internal->LinkImplMap[CONFIG][this]; -} - -//---------------------------------------------------------------------------- -cmLinkImplementationLibraries const* -cmTarget::GetLinkImplementationLibraries(const std::string& config) const -{ - return this->GetLinkImplementationLibrariesInternal(config, this); -} - -//---------------------------------------------------------------------------- -cmLinkImplementationLibraries const* -cmTarget::GetLinkImplementationLibrariesInternal(const std::string& config, - cmTarget const* head) const -{ - // There is no link implementation for imported targets. - if(this->IsImported()) - { - return 0; - } - - // Populate the link implementation libraries for this configuration. - std::string CONFIG = cmSystemTools::UpperCase(config); - cmTargetInternals::HeadToLinkImplementationMap& hm = - this->Internal->LinkImplMap[CONFIG]; - - // If the link implementation does not depend on the head target - // then return the one we computed first. - if(!hm.empty() && !hm.begin()->second.HadHeadSensitiveCondition) - { - return &hm.begin()->second; - } - - cmOptionalLinkImplementation& impl = hm[head]; - if(!impl.LibrariesDone) - { - impl.LibrariesDone = true; - this->ComputeLinkImplementationLibraries(config, impl, head); - } - return &impl; -} - -//---------------------------------------------------------------------------- -void cmTarget::ComputeLinkImplementationLibraries( - const std::string& config, - cmOptionalLinkImplementation& impl, - cmTarget const* head) const -{ - std::vector::const_iterator btIt = - this->Internal->LinkImplementationPropertyBacktraces.begin(); - // Collect libraries directly linked in this configuration. - for (std::vector::const_iterator - le = this->Internal->LinkImplementationPropertyEntries.begin(), - end = this->Internal->LinkImplementationPropertyEntries.end(); - le != end; ++le, ++btIt) - { - std::vector llibs; - cmGeneratorExpressionDAGChecker dagChecker( - this->GetName(), - "LINK_LIBRARIES", 0, 0); - cmGeneratorExpression ge(*btIt); - cmsys::auto_ptr const cge = - ge.Parse(*le); - std::string const evaluated = - cge->Evaluate(this->Makefile, config, false, head, &dagChecker); - cmSystemTools::ExpandListArgument(evaluated, llibs); - if(cge->GetHadHeadSensitiveCondition()) - { - impl.HadHeadSensitiveCondition = true; - } - - for(std::vector::const_iterator li = llibs.begin(); - li != llibs.end(); ++li) - { - // Skip entries that resolve to the target itself or are empty. - std::string name = this->CheckCMP0004(*li); - if(name == this->GetName() || name.empty()) - { - if(name == this->GetName()) - { - bool noMessage = false; - cmake::MessageType messageType = cmake::FATAL_ERROR; - std::ostringstream e; - switch(this->GetPolicyStatusCMP0038()) - { - case cmPolicies::WARN: - { - e << cmPolicies::GetPolicyWarning(cmPolicies::CMP0038) << "\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 itself."; - this->Makefile->GetCMakeInstance()->IssueMessage( - messageType, e.str(), this->GetBacktrace()); - if (messageType == cmake::FATAL_ERROR) - { - return; - } - } - } - continue; - } - - // The entry is meant for this configuration. - impl.Libraries.push_back( - cmLinkImplItem(name, this->FindTargetToLink(name), - *btIt, evaluated != *le)); - } - - std::set const& seenProps = cge->GetSeenTargetProperties(); - for (std::set::const_iterator it = seenProps.begin(); - it != seenProps.end(); ++it) - { - if (!this->GetProperty(*it)) - { - this->LinkImplicitNullProperties.insert(*it); - } - } - cge->GetMaxLanguageStandard(this, this->MaxLanguageStandards); - } - - cmTarget::LinkLibraryType linkType = this->ComputeLinkType(config); - cmTarget::LinkLibraryVectorType const& oldllibs = - this->GetOriginalLinkLibraries(); - for(cmTarget::LinkLibraryVectorType::const_iterator li = oldllibs.begin(); - li != oldllibs.end(); ++li) - { - if(li->second != cmTarget::GENERAL && li->second != linkType) - { - std::string name = this->CheckCMP0004(li->first); - if(name == this->GetName() || name.empty()) - { - continue; - } - // Support OLD behavior for CMP0003. - impl.WrongConfigLibraries.push_back( - cmLinkItem(name, this->FindTargetToLink(name))); - } - } -} - //---------------------------------------------------------------------------- cmTarget const* cmTarget::FindTargetToLink(std::string const& name) const { diff --git a/Source/cmTarget.h b/Source/cmTarget.h index 354eda292..aab9582bb 100644 --- a/Source/cmTarget.h +++ b/Source/cmTarget.h @@ -225,16 +225,6 @@ public: void GetObjectLibrariesCMP0026(std::vector& objlibs) const; - cmLinkImplementationLibraries const* - GetLinkImplementationLibraries(const std::string& config) const; - - void ComputeLinkImplementationLibraries(const std::string& config, - cmOptionalLinkImplementation& impl, - cmTarget const* head) const; - - cmOptionalLinkImplementation& - GetLinkImplMap(std::string const& config) const; - cmTarget const* FindTargetToLink(std::string const& name) const; /** Strip off leading and trailing whitespace from an item named in @@ -365,12 +355,6 @@ public: bool LinkLanguagePropagatesToDependents() const { return this->TargetTypeValue == STATIC_LIBRARY; } - std::map const& - GetMaxLanguageStandards() const - { - return this->MaxLanguageStandards; - } - cmStringRange GetIncludeDirectoriesEntries() const; cmBacktraceRange GetIncludeDirectoriesBacktraces() const; @@ -385,6 +369,9 @@ public: cmStringRange GetSourceEntries() const; cmBacktraceRange GetSourceBacktraces() const; + cmStringRange GetLinkImplementationEntries() const; + cmBacktraceRange GetLinkImplementationBacktraces() const; + #if defined(_WIN32) && !defined(__CYGWIN__) const LinkLibraryVectorType &GetLinkLibrariesForVS6() const { @@ -471,7 +458,6 @@ private: std::set Utilities; mutable std::set LinkImplicitNullProperties; std::map UtilityBacktraces; - mutable std::map MaxLanguageStandards; cmPolicies::PolicyMap PolicyMap; std::string Name; std::string InstallPath; @@ -529,14 +515,8 @@ private: void ComputeImportInfo(std::string const& desired_config, ImportInfo& info) const; - cmLinkImplementationLibraries const* - GetLinkImplementationLibrariesInternal(const std::string& config, - cmTarget const* head) const; - std::string ProcessSourceItemCMP0049(const std::string& s); - void ClearLinkMaps(); - void MaybeInvalidatePropertyCache(const std::string& prop); // Internal representation details. From e0261a1e20f14cc2ca593bb978479b52954397d8 Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Thu, 8 Oct 2015 23:00:30 +0200 Subject: [PATCH 075/486] cmTarget: Make OutputInfo definition public. --- Source/cmTarget.cxx | 10 ---------- Source/cmTarget.h | 10 +++++++++- 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx index e1642cc95..825f3ebcf 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -60,16 +60,6 @@ const char* cmTarget::GetTargetTypeName(TargetType targetType) return 0; } -//---------------------------------------------------------------------------- -struct cmTarget::OutputInfo -{ - std::string OutDir; - std::string ImpDir; - std::string PdbDir; - bool empty() const - { return OutDir.empty() && ImpDir.empty() && PdbDir.empty(); } -}; - //---------------------------------------------------------------------------- class cmTargetInternals { diff --git a/Source/cmTarget.h b/Source/cmTarget.h index aab9582bb..96cdb5e21 100644 --- a/Source/cmTarget.h +++ b/Source/cmTarget.h @@ -488,7 +488,15 @@ private: #endif // Cache target output paths for each configuration. - struct OutputInfo; + struct OutputInfo + { + std::string OutDir; + std::string ImpDir; + std::string PdbDir; + bool empty() const + { return OutDir.empty() && ImpDir.empty() && PdbDir.empty(); } + }; + OutputInfo const* GetOutputInfo(const std::string& config) const; bool ComputeOutputDir(const std::string& config, From 8c6e6dd3cef0befcd9a7f4c410a49a5afddd8afb Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Wed, 7 Oct 2015 00:17:20 +0200 Subject: [PATCH 076/486] cmMakefile: Inline initialization of project name. --- Source/cmMakefile.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index c06050557..16c0c9a35 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -1529,7 +1529,7 @@ void cmMakefile::InitializeFromParent(cmMakefile* parent) parent->GetProperty("LINK_DIRECTORIES")); // the initial project name - this->SetProjectName(parent->GetProjectName()); + this->StateSnapshot.SetProjectName(parent->StateSnapshot.GetProjectName()); // Copy include regular expressions. this->ComplainFileRegularExpression = parent->ComplainFileRegularExpression; From c8187f414bcc4668940c2e0fe40d361389efdbe5 Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Wed, 7 Oct 2015 00:19:02 +0200 Subject: [PATCH 077/486] cmCPluginAPI: Inline code to get project name. --- Source/cmCPluginAPI.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/cmCPluginAPI.cxx b/Source/cmCPluginAPI.cxx index 7da334ef1..e3efcddb1 100644 --- a/Source/cmCPluginAPI.cxx +++ b/Source/cmCPluginAPI.cxx @@ -116,7 +116,7 @@ const char* CCONV cmGetProjectName(void *arg) { cmMakefile *mf = static_cast(arg); static std::string name; - name = mf->GetProjectName(); + name = mf->GetStateSnapshot().GetProjectName(); return name.c_str(); } From 4ab2750c54adb09d147839687858aabe3cd988a7 Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Wed, 7 Oct 2015 00:29:25 +0200 Subject: [PATCH 078/486] cmLocalGenerator: Add GetProjectName method. --- Source/cmExtraCodeBlocksGenerator.cxx | 4 ++-- Source/cmExtraCodeLiteGenerator.cxx | 8 ++++---- Source/cmExtraEclipseCDT4Generator.cxx | 19 +++++++++---------- Source/cmExtraKateGenerator.cxx | 6 +++--- Source/cmExtraSublimeTextGenerator.cxx | 4 ++-- Source/cmGlobalKdevelopGenerator.cxx | 2 +- Source/cmGlobalVisualStudio6Generator.cxx | 2 +- Source/cmGlobalVisualStudio7Generator.cxx | 4 ++-- Source/cmGlobalVisualStudioGenerator.cxx | 2 +- Source/cmGlobalXCodeGenerator.cxx | 6 +++--- Source/cmLocalGenerator.cxx | 5 +++++ Source/cmLocalGenerator.h | 2 ++ Source/cmLocalNinjaGenerator.cxx | 2 +- 13 files changed, 36 insertions(+), 30 deletions(-) diff --git a/Source/cmExtraCodeBlocksGenerator.cxx b/Source/cmExtraCodeBlocksGenerator.cxx index 7915a6e25..103c16a2f 100644 --- a/Source/cmExtraCodeBlocksGenerator.cxx +++ b/Source/cmExtraCodeBlocksGenerator.cxx @@ -78,7 +78,7 @@ void cmExtraCodeBlocksGenerator::CreateProjectFile( { const cmMakefile* mf=lgs[0]->GetMakefile(); std::string outputDir=mf->GetCurrentBinaryDirectory(); - std::string projectName=mf->GetProjectName(); + std::string projectName=lgs[0]->GetProjectName(); std::string filename=outputDir+"/"; filename+=projectName+".cbp"; @@ -307,7 +307,7 @@ void cmExtraCodeBlocksGenerator "\n" " \n" " \n" - "