Browse Source

only generate test target when enabled

Ken Martin 22 years ago
parent
commit
d0bc3b9acd
1 changed files with 11 additions and 8 deletions
  1. 11 8
      Source/cmLocalUnixMakefileGenerator.cxx

+ 11 - 8
Source/cmLocalUnixMakefileGenerator.cxx

@@ -2669,14 +2669,17 @@ void cmLocalUnixMakefileGenerator::OutputMakeRules(std::ostream& fout)
     ctest = m_Makefile->GetDefinition("EXECUTABLE_OUTPUT_PATH");
     ctest += "/ctest";
     }
-  fout << "ARGS=\n";
-  std::string cmd = this->ConvertToOutputForExisting(ctest.c_str());
-  cmd += " $(ARGS)";
-  this->OutputMakeRule(fout, 
-                       "tests",
-                       "test",
-                       "",
-                       cmd.c_str());
+  if (m_Makefile->IsOn("CMAKE_TESTING_ENABLED"))
+    {
+    fout << "ARGS=\n";
+    std::string cmd = this->ConvertToOutputForExisting(ctest.c_str());
+    cmd += " $(ARGS)";
+    this->OutputMakeRule(fout, 
+                         "tests",
+                         "test",
+                         "",
+                         cmd.c_str());
+    }
 }
 
 void