Browse Source

Deprecate Visual Studio 6 generator

Update documentation to mark the generator deprecated.  Add a warning at
the end of generation plus an option to turn off the warning.
Brad King 10 years ago
parent
commit
85c2626bab

+ 7 - 1
Help/generator/Visual Studio 6.rst

@@ -1,4 +1,10 @@
 Visual Studio 6
 ---------------
 
-Generates Visual Studio 6 project files.
+Deprected.  Generates Visual Studio 6 project files.
+
+.. note::
+  This generator is deprecated and will be removed
+  in a future version of CMake.  It will still be
+  possible to build with VS 6 tools using the
+  :generator:`NMake Makefiles` generator.

+ 5 - 0
Help/release/dev/vs6-deprecate.rst

@@ -0,0 +1,5 @@
+vs6-deprecate
+-------------
+
+* The :generator:`Visual Studio 6` generator is now deprecated
+  and will be removed in a future version of CMake.

+ 17 - 1
Source/cmGlobalVisualStudio6Generator.cxx

@@ -185,6 +185,22 @@ void cmGlobalVisualStudio6Generator::Generate()
 
   // Now write out the DSW
   this->OutputDSWFile();
+
+  if (!this->CMakeInstance->GetIsInTryCompile())
+    {
+    const char* cmakeWarnVS6 =
+      this->CMakeInstance->GetState()->GetCacheEntryValue("CMAKE_WARN_VS6");
+    if (!cmakeWarnVS6 || !cmSystemTools::IsOff(cmakeWarnVS6))
+      {
+      this->CMakeInstance->IssueMessage(
+        cmake::WARNING,
+        "The \"Visual Studio 6\" generator is deprecated "
+        "and will be removed in a future version of CMake."
+        "\n"
+        "Add CMAKE_WARN_VS6=OFF to the cache to disable this warning."
+        );
+      }
+    }
 }
 
 // Write a DSW file to the stream
@@ -411,7 +427,7 @@ void cmGlobalVisualStudio6Generator
 ::GetDocumentation(cmDocumentationEntry& entry)
 {
   entry.Name = cmGlobalVisualStudio6Generator::GetActualName();
-  entry.Brief = "Generates Visual Studio 6 project files.";
+  entry.Brief = "Deprecated. Generates Visual Studio 6 project files.";
 }
 
 //----------------------------------------------------------------------------

+ 0 - 0
Tests/RunCMake/CommandLine/DeprecateVS6-WARN-OFF.cmake


+ 5 - 0
Tests/RunCMake/CommandLine/DeprecateVS6-WARN-ON-stderr.txt

@@ -0,0 +1,5 @@
+^CMake Warning:
+  The "Visual Studio 6" generator is deprecated and will be removed in a
+  future version of CMake.
+
+  Add CMAKE_WARN_VS6=OFF to the cache to disable this warning.$

+ 0 - 0
Tests/RunCMake/CommandLine/DeprecateVS6-WARN-ON.cmake


+ 7 - 0
Tests/RunCMake/CommandLine/RunCMakeTest.cmake

@@ -40,6 +40,13 @@ if(RunCMake_GENERATOR STREQUAL "Ninja")
   unset(RunCMake_TEST_NO_CLEAN)
 endif()
 
+if(RunCMake_GENERATOR STREQUAL "Visual Studio 6")
+  set(RunCMake_WARN_VS6 1)
+  run_cmake(DeprecateVS6-WARN-ON)
+  unset(RunCMake_WARN_VS6)
+  run_cmake(DeprecateVS6-WARN-OFF)
+endif()
+
 if(UNIX)
   run_cmake_command(E_create_symlink-no-arg
     ${CMAKE_COMMAND} -E create_symlink

+ 3 - 0
Tests/RunCMake/RunCMake.cmake

@@ -51,6 +51,9 @@ function(run_cmake test)
   if(APPLE)
     list(APPEND RunCMake_TEST_OPTIONS -DCMAKE_POLICY_DEFAULT_CMP0025=NEW)
   endif()
+  if(RunCMake_GENERATOR STREQUAL "Visual Studio 6" AND NOT RunCMake_WARN_VS6)
+    list(APPEND RunCMake_TEST_OPTIONS -DCMAKE_WARN_VS6=OFF)
+  endif()
   if(RunCMake_MAKE_PROGRAM)
     list(APPEND RunCMake_TEST_OPTIONS "-DCMAKE_MAKE_PROGRAM=${RunCMake_MAKE_PROGRAM}")
   endif()