diff options
Diffstat (limited to 'Source')
-rw-r--r-- | Source/CMakeLists.txt | 46 | ||||
-rw-r--r-- | Source/CMakeVersion.cmake | 2 | ||||
-rw-r--r-- | Source/CPack/WiX/cmCPackWIXGenerator.cxx | 103 | ||||
-rw-r--r-- | Source/CPack/WiX/cmCPackWIXGenerator.h | 12 | ||||
-rw-r--r-- | Source/cmAddLibraryCommand.cxx | 7 | ||||
-rw-r--r-- | Source/cmCommands.cxx | 86 | ||||
-rw-r--r-- | Source/cmCommands.cxx.in | 19 | ||||
-rw-r--r-- | Source/cmCommandsForBootstrap.cxx | 16 | ||||
-rw-r--r-- | Source/cmExportInstallFileGenerator.cxx | 14 | ||||
-rw-r--r-- | Source/cmExportLibraryDependenciesCommand.cxx (renamed from Source/cmExportLibraryDependencies.cxx) | 2 | ||||
-rw-r--r-- | Source/cmExportLibraryDependenciesCommand.h (renamed from Source/cmExportLibraryDependencies.h) | 0 | ||||
-rw-r--r-- | Source/cmGraphVizWriter.cxx | 14 | ||||
-rw-r--r-- | Source/cmGraphVizWriter.h | 2 | ||||
-rw-r--r-- | Source/cmTarget.cxx | 95 |
14 files changed, 280 insertions, 138 deletions
diff --git a/Source/CMakeLists.txt b/Source/CMakeLists.txt index dbb922d..175a034 100644 --- a/Source/CMakeLists.txt +++ b/Source/CMakeLists.txt @@ -127,7 +127,7 @@ set(SRCS cmBootstrapCommands2.cxx cmCacheManager.cxx cmCacheManager.h - cmCommands.cxx + "${CMAKE_CURRENT_BINARY_DIR}/cmCommands.cxx" cmCommands.h cmCommandArgumentLexer.cxx cmCommandArgumentParser.cxx @@ -298,6 +298,50 @@ set(SRCS cm_utf8.c ) +set(COMMAND_INCLUDES "#include \"cmTargetPropCommandBase.cxx\"\n") +list(APPEND SRCS cmTargetPropCommandBase.cxx) +set_property(SOURCE cmTargetPropCommandBase.cxx PROPERTY HEADER_FILE_ONLY ON) +set(NEW_COMMANDS "") +foreach(command_file + cmAddCompileOptionsCommand + cmAuxSourceDirectoryCommand + cmBuildNameCommand + cmCMakeHostSystemInformationCommand + cmElseIfCommand + cmExportCommand + cmExportLibraryDependenciesCommand + cmFLTKWrapUICommand + cmIncludeExternalMSProjectCommand + cmInstallProgramsCommand + cmLinkLibrariesCommand + cmLoadCacheCommand + cmOutputRequiredFilesCommand + cmQTWrapCPPCommand + cmQTWrapUICommand + cmRemoveCommand + cmRemoveDefinitionsCommand + cmSourceGroupCommand + cmSubdirDependsCommand + cmTargetCompileDefinitionsCommand + cmTargetCompileOptionsCommand + cmTargetIncludeDirectoriesCommand + cmUseMangledMesaCommand + cmUtilitySourceCommand + cmVariableRequiresCommand + cmVariableWatchCommand + cmWriteFileCommand + # This one must be last because it includes windows.h and + # windows.h #defines GetCurrentDirectory which is a member + # of cmMakefile + cmLoadCommandCommand + ) + set(COMMAND_INCLUDES "${COMMAND_INCLUDES}#include \"${command_file}.cxx\"\n") + set(NEW_COMMANDS "${NEW_COMMANDS}commands.push_back(new ${command_file});\n") + list(APPEND SRCS ${command_file}.cxx) + set_property(SOURCE ${command_file}.cxx PROPERTY HEADER_FILE_ONLY ON) +endforeach() +configure_file(cmCommands.cxx.in ${CMAKE_CURRENT_BINARY_DIR}/cmCommands.cxx @ONLY) + # Kdevelop only works on UNIX and not windows if(UNIX) set(SRCS ${SRCS} cmGlobalKdevelopGenerator.cxx) diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index 1e65e94..33c4db5 100644 --- a/Source/CMakeVersion.cmake +++ b/Source/CMakeVersion.cmake @@ -2,5 +2,5 @@ set(CMake_VERSION_MAJOR 2) set(CMake_VERSION_MINOR 8) set(CMake_VERSION_PATCH 12) -set(CMake_VERSION_TWEAK 20140209) +set(CMake_VERSION_TWEAK 20140211) #set(CMake_VERSION_RC 1) diff --git a/Source/CPack/WiX/cmCPackWIXGenerator.cxx b/Source/CPack/WiX/cmCPackWIXGenerator.cxx index 998b5f1..43119d6 100644 --- a/Source/CPack/WiX/cmCPackWIXGenerator.cxx +++ b/Source/CPack/WiX/cmCPackWIXGenerator.cxx @@ -31,6 +31,12 @@ #include <sys/types.h> #include <sys/stat.h> +cmCPackWIXGenerator::cmCPackWIXGenerator(): + HasDesktopShortcuts(false) +{ + +} + int cmCPackWIXGenerator::InitializeInternal() { componentPackageMethod = ONE_PACKAGE; @@ -519,6 +525,11 @@ bool cmCPackWIXGenerator::CreateWiXSourceFiles() CreateStartMenuFolder(directoryDefinitions); } + if(this->HasDesktopShortcuts) + { + CreateDesktopFolder(directoryDefinitions); + } + directoryDefinitions.EndElement("Directory"); directoryDefinitions.EndElement("Fragment"); @@ -733,10 +744,20 @@ bool cmCPackWIXGenerator::AddComponentsToFeature( } } + std::vector<std::string> cpackPackageDesktopLinksList; + const char *cpackPackageDesktopLinks = + GetOption("CPACK_CREATE_DESKTOP_LINKS"); + if(cpackPackageDesktopLinks) + { + cmSystemTools::ExpandListArgument(cpackPackageDesktopLinks, + cpackPackageDesktopLinksList); + } + AddDirectoryAndFileDefinitons( rootPath, "INSTALL_ROOT", directoryDefinitions, fileDefinitions, featureDefinitions, - cpackPackageExecutablesList, shortcutMap); + cpackPackageExecutablesList, cpackPackageDesktopLinksList, + shortcutMap); featureDefinitions.EndElement("FeatureRef"); @@ -750,6 +771,8 @@ bool cmCPackWIXGenerator::CreateStartMenuShortcuts( cmWIXSourceWriter& fileDefinitions, cmWIXSourceWriter& featureDefinitions) { + bool thisHasDesktopShortcuts = false; + featureDefinitions.BeginElement("FeatureRef"); featureDefinitions.AddAttribute("Id", featureId); @@ -797,6 +820,11 @@ bool cmCPackWIXGenerator::CreateStartMenuShortcuts( fileDefinitions.AddAttribute("WorkingDirectory", shortcut.workingDirectoryId); fileDefinitions.EndElement("Shortcut"); + + if (shortcut.desktop) + { + thisHasDesktopShortcuts = true; + } } if(cpackComponentName.empty()) @@ -805,7 +833,8 @@ bool cmCPackWIXGenerator::CreateStartMenuShortcuts( } fileDefinitions.BeginElement("RemoveFolder"); - fileDefinitions.AddAttribute("Id", "PROGRAM_MENU_FOLDER" + idSuffix); + fileDefinitions.AddAttribute("Id", + "CM_REMOVE_PROGRAM_MENU_FOLDER" + idSuffix); fileDefinitions.AddAttribute("On", "uninstall"); fileDefinitions.EndElement("RemoveFolder"); @@ -836,6 +865,56 @@ bool cmCPackWIXGenerator::CreateStartMenuShortcuts( featureDefinitions.AddAttribute("Id", componentId); featureDefinitions.EndElement("ComponentRef"); + if (thisHasDesktopShortcuts) + { + this->HasDesktopShortcuts = true; + componentId = "CM_DESKTOP_SHORTCUT" + idSuffix; + + fileDefinitions.BeginElement("DirectoryRef"); + fileDefinitions.AddAttribute("Id", "DesktopFolder"); + fileDefinitions.BeginElement("Component"); + fileDefinitions.AddAttribute("Id", componentId); + fileDefinitions.AddAttribute("Guid", "*"); + + for (shortcut_map_t::const_iterator + i = shortcutMap.begin(); i != shortcutMap.end(); ++i) + { + std::string const& id = i->first; + cmWIXShortcut const& shortcut = i->second; + + if (!shortcut.desktop) + continue; + + std::string shortcutId = std::string("CM_DS") + id; + std::string fileId = std::string("CM_F") + id; + + fileDefinitions.BeginElement("Shortcut"); + fileDefinitions.AddAttribute("Id", shortcutId); + fileDefinitions.AddAttribute("Name", shortcut.textLabel); + std::string target = "[#" + fileId + "]"; + fileDefinitions.AddAttribute("Target", target); + fileDefinitions.AddAttribute("WorkingDirectory", + shortcut.workingDirectoryId); + fileDefinitions.EndElement("Shortcut"); + } + + fileDefinitions.BeginElement("RegistryValue"); + fileDefinitions.AddAttribute("Root", "HKCU"); + fileDefinitions.AddAttribute("Key", registryKey); + fileDefinitions.AddAttribute("Name", valueName + "_desktop"); + fileDefinitions.AddAttribute("Type", "integer"); + fileDefinitions.AddAttribute("Value", "1"); + fileDefinitions.AddAttribute("KeyPath", "yes"); + fileDefinitions.EndElement("RegistryValue"); + + fileDefinitions.EndElement("Component"); + fileDefinitions.EndElement("DirectoryRef"); + + featureDefinitions.BeginElement("ComponentRef"); + featureDefinitions.AddAttribute("Id", componentId); + featureDefinitions.EndElement("ComponentRef"); + } + featureDefinitions.EndElement("FeatureRef"); return true; @@ -908,6 +987,7 @@ void cmCPackWIXGenerator::AddDirectoryAndFileDefinitons( cmWIXSourceWriter& fileDefinitions, cmWIXSourceWriter& featureDefinitions, const std::vector<std::string>& packageExecutables, + const std::vector<std::string>& desktopExecutables, shortcut_map_t& shortcutMap) { cmsys::Directory dir; @@ -943,6 +1023,7 @@ void cmCPackWIXGenerator::AddDirectoryAndFileDefinitons( fileDefinitions, featureDefinitions, packageExecutables, + desktopExecutables, shortcutMap); ApplyPatchFragment(subDirectoryId, directoryDefinitions); @@ -995,6 +1076,15 @@ void cmCPackWIXGenerator::AddDirectoryAndFileDefinitons( cmWIXShortcut &shortcut = shortcutMap[id]; shortcut.textLabel= textLabel; shortcut.workingDirectoryId = directoryId; + + if(desktopExecutables.size() && + std::find(desktopExecutables.begin(), + desktopExecutables.end(), + executableName) + != desktopExecutables.end()) + { + shortcut.desktop = true; + } } } } @@ -1232,6 +1322,15 @@ void cmCPackWIXGenerator::CreateStartMenuFolder( directoryDefinitions.EndElement("Directory"); } +void cmCPackWIXGenerator::CreateDesktopFolder( + cmWIXSourceWriter& directoryDefinitions) +{ + directoryDefinitions.BeginElement("Directory"); + directoryDefinitions.AddAttribute("Id", "DesktopFolder"); + directoryDefinitions.AddAttribute("Name", "Desktop"); + directoryDefinitions.EndElement("Directory"); +} + void cmCPackWIXGenerator::LoadPatchFragments(const std::string& patchFilePath) { cmWIXPatchParser parser(Fragments, Logger); diff --git a/Source/CPack/WiX/cmCPackWIXGenerator.h b/Source/CPack/WiX/cmCPackWIXGenerator.h index 1f4facf..1de4810 100644 --- a/Source/CPack/WiX/cmCPackWIXGenerator.h +++ b/Source/CPack/WiX/cmCPackWIXGenerator.h @@ -22,8 +22,13 @@ struct cmWIXShortcut { + cmWIXShortcut() + :desktop(false) + {} + std::string textLabel; std::string workingDirectoryId; + bool desktop; }; class cmWIXSourceWriter; @@ -36,6 +41,8 @@ class cmCPackWIXGenerator : public cmCPackGenerator public: cmCPackTypeMacro(cmCPackWIXGenerator, cmCPackGenerator); + cmCPackWIXGenerator(); + protected: virtual int InitializeInternal(); @@ -133,6 +140,7 @@ private: cmWIXSourceWriter& fileDefinitions, cmWIXSourceWriter& featureDefinitions, const std::vector<std::string>& pkgExecutables, + const std::vector<std::string>& desktopExecutables, shortcut_map_t& shortcutMap); bool RequireOption(const std::string& name, std::string& value) const; @@ -165,6 +173,8 @@ private: void CreateStartMenuFolder(cmWIXSourceWriter& directoryDefinitions); + void CreateDesktopFolder(cmWIXSourceWriter& directoryDefinitions); + void LoadPatchFragments(const std::string& patchFilePath); void ApplyPatchFragment(const std::string& id, cmWIXSourceWriter& writer); @@ -180,6 +190,8 @@ private: extension_set_t LightExtensions; cmWIXPatchParser::fragment_map_t Fragments; + + bool HasDesktopShortcuts; }; #endif diff --git a/Source/cmAddLibraryCommand.cxx b/Source/cmAddLibraryCommand.cxx index a29f784..009b1ca 100644 --- a/Source/cmAddLibraryCommand.cxx +++ b/Source/cmAddLibraryCommand.cxx @@ -173,6 +173,13 @@ bool cmAddLibraryCommand ++s; importGlobal = true; } + else if(type == cmTarget::INTERFACE_LIBRARY && *s == "GLOBAL") + { + cmOStringStream e; + e << "GLOBAL option may only be used with IMPORTED libraries."; + this->SetError(e.str().c_str()); + return false; + } else { break; diff --git a/Source/cmCommands.cxx b/Source/cmCommands.cxx deleted file mode 100644 index 1e2a85c..0000000 --- a/Source/cmCommands.cxx +++ /dev/null @@ -1,86 +0,0 @@ -/*============================================================================ - CMake - Cross Platform Makefile Generator - Copyright 2000-2009 Kitware, Inc., Insight Software Consortium - - Distributed under the OSI-approved BSD License (the "License"); - see accompanying file Copyright.txt for details. - - This software is distributed WITHOUT ANY WARRANTY; without even the - implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - See the License for more information. -============================================================================*/ -#include "cmCommands.h" -#if defined(CMAKE_BUILD_WITH_CMAKE) -#include "cmAddCompileOptionsCommand.cxx" -#include "cmAuxSourceDirectoryCommand.cxx" -#include "cmBuildNameCommand.cxx" -#include "cmCMakeHostSystemInformationCommand.cxx" -#include "cmElseIfCommand.cxx" -#include "cmExportCommand.cxx" -#include "cmExportLibraryDependencies.cxx" -#include "cmFLTKWrapUICommand.cxx" -#include "cmIncludeExternalMSProjectCommand.cxx" -#include "cmInstallProgramsCommand.cxx" -#include "cmLinkLibrariesCommand.cxx" -#include "cmLoadCacheCommand.cxx" -#include "cmOutputRequiredFilesCommand.cxx" -#include "cmQTWrapCPPCommand.cxx" -#include "cmQTWrapUICommand.cxx" -#include "cmRemoveCommand.cxx" -#include "cmRemoveDefinitionsCommand.cxx" -#include "cmSourceGroupCommand.cxx" -#include "cmSubdirDependsCommand.cxx" -#include "cmTargetCompileDefinitionsCommand.cxx" -#include "cmTargetCompileOptionsCommand.cxx" -#include "cmTargetIncludeDirectoriesCommand.cxx" -#include "cmTargetPropCommandBase.cxx" -#include "cmUseMangledMesaCommand.cxx" -#include "cmUtilitySourceCommand.cxx" -#include "cmVariableRequiresCommand.cxx" -#include "cmVariableWatchCommand.cxx" - -#include "cmWriteFileCommand.cxx" - -// This one must be last because it includes windows.h and -// windows.h #defines GetCurrentDirectory which is a member -// of cmMakefile -#include "cmLoadCommandCommand.cxx" -#endif - -void GetPredefinedCommands(std::list<cmCommand*>& -#if defined(CMAKE_BUILD_WITH_CMAKE) - commands -#endif - ) -{ -#if defined(CMAKE_BUILD_WITH_CMAKE) - commands.push_back(new cmAddCompileOptionsCommand); - commands.push_back(new cmAuxSourceDirectoryCommand); - commands.push_back(new cmBuildNameCommand); - commands.push_back(new cmCMakeHostSystemInformationCommand); - commands.push_back(new cmElseIfCommand); - commands.push_back(new cmExportCommand); - commands.push_back(new cmExportLibraryDependenciesCommand); - commands.push_back(new cmFLTKWrapUICommand); - commands.push_back(new cmIncludeExternalMSProjectCommand); - commands.push_back(new cmInstallProgramsCommand); - commands.push_back(new cmLinkLibrariesCommand); - commands.push_back(new cmLoadCacheCommand); - commands.push_back(new cmLoadCommandCommand); - commands.push_back(new cmOutputRequiredFilesCommand); - commands.push_back(new cmQTWrapCPPCommand); - commands.push_back(new cmQTWrapUICommand); - commands.push_back(new cmRemoveCommand); - commands.push_back(new cmRemoveDefinitionsCommand); - commands.push_back(new cmSourceGroupCommand); - commands.push_back(new cmSubdirDependsCommand); - commands.push_back(new cmTargetIncludeDirectoriesCommand); - commands.push_back(new cmTargetCompileDefinitionsCommand); - commands.push_back(new cmTargetCompileOptionsCommand); - commands.push_back(new cmUseMangledMesaCommand); - commands.push_back(new cmUtilitySourceCommand); - commands.push_back(new cmVariableRequiresCommand); - commands.push_back(new cmVariableWatchCommand); - commands.push_back(new cmWriteFileCommand); -#endif -} diff --git a/Source/cmCommands.cxx.in b/Source/cmCommands.cxx.in new file mode 100644 index 0000000..f0745d7 --- /dev/null +++ b/Source/cmCommands.cxx.in @@ -0,0 +1,19 @@ +/*============================================================================ + CMake - Cross Platform Makefile Generator + Copyright 2000-2009 Kitware, Inc., Insight Software Consortium + + Distributed under the OSI-approved BSD License (the "License"); + see accompanying file Copyright.txt for details. + + This software is distributed WITHOUT ANY WARRANTY; without even the + implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the License for more information. +============================================================================*/ +#include "cmCommands.h" + +@COMMAND_INCLUDES@ + +void GetPredefinedCommands(std::list<cmCommand*>& commands) +{ +@NEW_COMMANDS@ +} diff --git a/Source/cmCommandsForBootstrap.cxx b/Source/cmCommandsForBootstrap.cxx new file mode 100644 index 0000000..15b664e --- /dev/null +++ b/Source/cmCommandsForBootstrap.cxx @@ -0,0 +1,16 @@ +/*============================================================================ + CMake - Cross Platform Makefile Generator + Copyright 2000-2009 Kitware, Inc., Insight Software Consortium + + Distributed under the OSI-approved BSD License (the "License"); + see accompanying file Copyright.txt for details. + + This software is distributed WITHOUT ANY WARRANTY; without even the + implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the License for more information. +============================================================================*/ +#include "cmCommands.h" + +void GetPredefinedCommands(std::list<cmCommand*>&) +{ +} diff --git a/Source/cmExportInstallFileGenerator.cxx b/Source/cmExportInstallFileGenerator.cxx index 73e9b31..eb7cea9 100644 --- a/Source/cmExportInstallFileGenerator.cxx +++ b/Source/cmExportInstallFileGenerator.cxx @@ -19,6 +19,18 @@ #include "cmInstallExportGenerator.h" #include "cmInstallTargetGenerator.h" #include "cmTargetExport.h" +#include "cmVersionConfig.h" + +#define STRINGIFY_HELPER(X) #X +#define STRINGIFY(X) STRINGIFY_HELPER(X) + +#define DEVEL_CMAKE_VERSION(maj, min, patch) \ + (maj > CMake_VERSION_MAJOR \ + || min > CMake_VERSION_MINOR \ + || patch > CMake_VERSION_PATCH) ? \ + STRINGIFY(CMake_VERSION_MAJOR) "." STRINGIFY(CMake_VERSION_MINOR) "." \ + STRINGIFY(CMake_VERSION_PATCH) "." STRINGIFY(CMake_VERSION_TWEAK) \ + : #maj "." #min "." #patch //---------------------------------------------------------------------------- cmExportInstallFileGenerator @@ -176,7 +188,7 @@ bool cmExportInstallFileGenerator::GenerateMainFile(std::ostream& os) if (require3_0_0) { - this->GenerateRequiredCMakeVersion(os, "2.8.12.20131007"); + this->GenerateRequiredCMakeVersion(os, DEVEL_CMAKE_VERSION(3, 0, 0)); } else if (require2_8_12) { diff --git a/Source/cmExportLibraryDependencies.cxx b/Source/cmExportLibraryDependenciesCommand.cxx index 4624e92..5d6f094 100644 --- a/Source/cmExportLibraryDependencies.cxx +++ b/Source/cmExportLibraryDependenciesCommand.cxx @@ -9,7 +9,7 @@ implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the License for more information. ============================================================================*/ -#include "cmExportLibraryDependencies.h" +#include "cmExportLibraryDependenciesCommand.h" #include "cmGlobalGenerator.h" #include "cmLocalGenerator.h" #include "cmGeneratedFileStream.h" diff --git a/Source/cmExportLibraryDependencies.h b/Source/cmExportLibraryDependenciesCommand.h index 29b568f..29b568f 100644 --- a/Source/cmExportLibraryDependencies.h +++ b/Source/cmExportLibraryDependenciesCommand.h diff --git a/Source/cmGraphVizWriter.cxx b/Source/cmGraphVizWriter.cxx index 3a7070e..db964a9 100644 --- a/Source/cmGraphVizWriter.cxx +++ b/Source/cmGraphVizWriter.cxx @@ -53,6 +53,8 @@ cmGraphVizWriter::cmGraphVizWriter(const std::vector<cmLocalGenerator*>& ,GenerateForSharedLibs(true) ,GenerateForModuleLibs(true) ,GenerateForExternals(true) +,GeneratePerTarget(true) +,GenerateDependers(true) ,LocalGenerators(localGenerators) ,HaveTargetsAndLibs(false) { @@ -116,6 +118,8 @@ void cmGraphVizWriter::ReadSettings(const char* settingsFileName, __set_bool_if_set(this->GenerateForSharedLibs, "GRAPHVIZ_SHARED_LIBS"); __set_bool_if_set(this->GenerateForModuleLibs, "GRAPHVIZ_MODULE_LIBS"); __set_bool_if_set(this->GenerateForExternals, "GRAPHVIZ_EXTERNAL_LIBS"); + __set_bool_if_set(this->GeneratePerTarget, "GRAPHVIZ_GENERATE_PER_TARGET"); + __set_bool_if_set(this->GenerateDependers, "GRAPHVIZ_GENERATE_DEPENDERS"); cmStdString ignoreTargetsRegexes; __set_if_set(ignoreTargetsRegexes, "GRAPHVIZ_IGNORE_TARGETS"); @@ -149,6 +153,11 @@ void cmGraphVizWriter::ReadSettings(const char* settingsFileName, // which other targets depend on it. void cmGraphVizWriter::WriteTargetDependersFiles(const char* fileName) { + if(this->GenerateDependers == false) + { + return; + } + this->CollectTargetsAndLibs(); for(std::map<cmStdString, const cmTarget*>::const_iterator ptrIt = @@ -195,6 +204,11 @@ void cmGraphVizWriter::WriteTargetDependersFiles(const char* fileName) // on which targets it depends. void cmGraphVizWriter::WritePerTargetFiles(const char* fileName) { + if(this->GeneratePerTarget == false) + { + return; + } + this->CollectTargetsAndLibs(); for(std::map<cmStdString, const cmTarget*>::const_iterator ptrIt = diff --git a/Source/cmGraphVizWriter.h b/Source/cmGraphVizWriter.h index f784aa0..17b97f8 100644 --- a/Source/cmGraphVizWriter.h +++ b/Source/cmGraphVizWriter.h @@ -74,6 +74,8 @@ protected: bool GenerateForSharedLibs; bool GenerateForModuleLibs; bool GenerateForExternals; + bool GeneratePerTarget; + bool GenerateDependers; std::vector<cmsys::RegularExpression> TargetsToIgnoreRegex; diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx index e51095e..18ba7c8 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -2832,12 +2832,54 @@ public: cmTargetCollectLinkLanguages(cmTarget const* target, const char* config, std::set<cmStdString>& languages, cmTarget const* head): - Config(config), Languages(languages), HeadTarget(head) + Config(config), Languages(languages), HeadTarget(head), + Makefile(target->GetMakefile()), Target(target) { this->Visited.insert(target); } - void Visit(cmTarget const* target) + void Visit(const std::string& name) { - if(!target || !this->Visited.insert(target).second) + cmTarget *target = this->Makefile->FindTargetToUse(name); + + if(!target) + { + if(name.find("::") != std::string::npos) + { + bool noMessage = false; + cmake::MessageType messageType = cmake::FATAL_ERROR; + cmOStringStream e; + switch(this->Makefile->GetPolicyStatus(cmPolicies::CMP0028)) + { + case cmPolicies::WARN: + { + e << (this->Makefile->GetPolicies() + ->GetPolicyWarning(cmPolicies::CMP0028)) << "\n"; + messageType = cmake::AUTHOR_WARNING; + } + break; + case cmPolicies::OLD: + noMessage = true; + case cmPolicies::REQUIRED_IF_USED: + case cmPolicies::REQUIRED_ALWAYS: + case cmPolicies::NEW: + // Issue the fatal message. + break; + } + + if(!noMessage) + { + e << "Target \"" << this->Target->GetName() + << "\" links to target \"" << name + << "\" 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(messageType, + e.str(), + this->Target->GetBacktrace()); + } + } + return; + } + if(!this->Visited.insert(target).second) { return; } @@ -2852,17 +2894,18 @@ public: this->Languages.insert(*li); } - cmMakefile* mf = target->GetMakefile(); for(std::vector<std::string>::const_iterator li = iface->Libraries.begin(); li != iface->Libraries.end(); ++li) { - this->Visit(mf->FindTargetToUse(*li)); + this->Visit(*li); } } private: const char* Config; std::set<cmStdString>& Languages; cmTarget const* HeadTarget; + cmMakefile* Makefile; + const cmTarget* Target; std::set<cmTarget const*> Visited; }; @@ -2964,7 +3007,7 @@ void cmTarget::ComputeLinkClosure(const char* config, LinkClosure& lc, for(std::vector<std::string>::const_iterator li = impl->Libraries.begin(); li != impl->Libraries.end(); ++li) { - cll.Visit(this->Makefile->FindTargetToUse(*li)); + cll.Visit(*li); } // Store the transitive closure of languages. @@ -5619,46 +5662,6 @@ void cmTarget::ComputeLinkImplementation(const char* config, } continue; } - cmTarget *tgt = this->Makefile->FindTargetToUse(*li); - - if(!tgt && std::string(item).find("::") != std::string::npos) - { - bool noMessage = false; - cmake::MessageType messageType = cmake::FATAL_ERROR; - cmOStringStream e; - switch(this->Makefile->GetPolicyStatus(cmPolicies::CMP0028)) - { - case cmPolicies::WARN: - { - e << (this->Makefile->GetPolicies() - ->GetPolicyWarning(cmPolicies::CMP0028)) << "\n"; - messageType = cmake::AUTHOR_WARNING; - } - break; - case cmPolicies::OLD: - noMessage = true; - case cmPolicies::REQUIRED_IF_USED: - case cmPolicies::REQUIRED_ALWAYS: - case cmPolicies::NEW: - // Issue the fatal message. - break; - } - - if(!noMessage) - { - e << "Target \"" << this->GetName() << "\" links to target \"" << item - << "\" but the target was not found. Perhaps a find_package() " - "call is missing for an IMPORTED target, or an ALIAS target is " - "missing?"; - this->Makefile->GetCMakeInstance()->IssueMessage(messageType, - e.str(), - this->GetBacktrace()); - if (messageType == cmake::FATAL_ERROR) - { - return; - } - } - } // The entry is meant for this configuration. impl.Libraries.push_back(item); |