浏览代码

ENH: FindLibrary supports .Net specific lib dirs

Sebastien Barre 23 年之前
父节点
当前提交
03a8c9795c
共有 1 个文件被更改,包括 20 次插入1 次删除
  1. 20 1
      Source/cmSystemTools.cxx

+ 20 - 1
Source/cmSystemTools.cxx

@@ -1587,7 +1587,7 @@ std::string cmSystemTools::FindLibrary(const char* name,
     if (genName)
       {
       if (!strcmp(genName, "NMake Makefiles") ||
-          !strncmp(genName, "Visual Studio ", 14))
+          !strcmp(genName, "Visual Studio 6"))
         {
         const char* compiler = makefile->GetDefinition("CMAKE_CXX_COMPILER");
         if (compiler)
@@ -1602,6 +1602,25 @@ std::string cmSystemTools::FindLibrary(const char* name,
             }
           }
         }
+      else if (!strcmp(genName, "Visual Studio 7"))
+        {
+        // It is likely that the compiler won't be in the path for .Net, but
+        // we know where devenv is.
+        const char* devenv = makefile->GetDefinition("MICROSOFT_DEVENV");
+        if (devenv)
+          {
+          std::string devenv_path = cmSystemTools::FindProgram(devenv);
+          if (devenv_path.size())
+            {
+            std::string vc7_path = 
+              cmSystemTools::GetFilenamePath(
+                cmSystemTools::GetFilenamePath(
+                  cmSystemTools::GetFilenamePath(devenv_path))) + "/Vc7";
+            path.push_back(vc7_path + "/lib");
+            path.push_back(vc7_path + "/PlatformSDK/lib");
+            }
+          }
+        }
       else if (!strcmp(genName, "Borland Makefiles"))
         {
         const char* bcb_bin_path = makefile->GetDefinition("BCB_BIN_PATH");