diff options
author | Bill Hoffman <bill.hoffman@kitware.com> | 2008-01-30 21:22:51 (GMT) |
---|---|---|
committer | Bill Hoffman <bill.hoffman@kitware.com> | 2008-01-30 21:22:51 (GMT) |
commit | 22be36f8d52fae0f509725253f175b0c1ec65dcc (patch) | |
tree | 94f3e9166c3300f5c58ba7aedfd289041f02d5e2 | |
parent | d51e9cf180fa057e9fde7a203564da0ba1ac6fab (diff) | |
download | CMake-22be36f8d52fae0f509725253f175b0c1ec65dcc.zip CMake-22be36f8d52fae0f509725253f175b0c1ec65dcc.tar.gz CMake-22be36f8d52fae0f509725253f175b0c1ec65dcc.tar.bz2 |
ENH: make sure global targets are in the right projects
-rw-r--r-- | Source/cmGlobalVisualStudio7Generator.cxx | 29 |
1 files changed, 5 insertions, 24 deletions
diff --git a/Source/cmGlobalVisualStudio7Generator.cxx b/Source/cmGlobalVisualStudio7Generator.cxx index 0a084ee..0af84e2 100644 --- a/Source/cmGlobalVisualStudio7Generator.cxx +++ b/Source/cmGlobalVisualStudio7Generator.cxx @@ -308,20 +308,6 @@ void cmGlobalVisualStudio7Generator::WriteTargetsToSolution( cmGlobalGenerator::TargetDependSet& originalTargets ) { - // Create a map of project that should only show up once - // in a project - const char* onlyOnceNames[] = - {"INCLUDE_EXTERNAL_MSPROJECT","CMAKE_CHECK_BUILD_SYSTEM_TARGET", - "INSTALL", "RUN_TESTS", "EDIT_CACHE", "REBUILD_CACHE", "PACKAGE", 0}; - std::map<cmStdString, int> onlyOnceMap; - int i =0; - for(const char* name = onlyOnceNames[i]; - name != 0; name = onlyOnceNames[++i]) - { - onlyOnceMap[name] = 0; - } - // add the CMAKE_CHECK_BUILD_SYSTEM_TARGET - onlyOnceMap[CMAKE_CHECK_BUILD_SYSTEM_TARGET] = 0; std::string rootdir = root->GetMakefile()->GetStartOutputDirectory(); rootdir += "/"; for(cmGlobalGenerator::TargetDependSet::iterator tt = @@ -343,26 +329,21 @@ void cmGlobalVisualStudio7Generator::WriteTargetsToSolution( const cmCustomCommandLines& cmds = cc.GetCommandLines(); std::string project = cmds[0][0]; std::string location = cmds[0][1]; - std::cout << "About to call WriteExternalProject " << this->GetName() << "\n"; this->WriteExternalProject(fout, project.c_str(), location.c_str(), cc.GetDepends()); } else { - // if the target is an onlyOnceNames do it once - std::map<cmStdString, int>::iterator o = - onlyOnceMap.find(target->GetName()); bool skip = false; - if(o != onlyOnceMap.end()) + // if it is a global target or the check build system target + // then only use the one that is for the root + if(target->GetType() == cmTarget::GLOBAL_TARGET + || !strcmp(target->GetName(), CMAKE_CHECK_BUILD_SYSTEM_TARGET)) { - if(o->second > 0) + if(target->GetMakefile() != root->GetMakefile()) { skip = true; } - else - { - o->second++; - } } // if not skipping the project then write it into the // solution |