summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Source/cmExportCommand.cxx1
-rw-r--r--Source/cmFindPackageCommand.cxx1
-rw-r--r--Source/cmGlobalGenerator.cxx15
-rw-r--r--Source/cmGlobalVisualStudio7Generator.cxx3
-rw-r--r--Source/cmGlobalVisualStudioGenerator.cxx3
-rw-r--r--Source/cmLocalVisualStudio7Generator.cxx2
-rw-r--r--Source/cmakemain.cxx13
7 files changed, 17 insertions, 21 deletions
diff --git a/Source/cmExportCommand.cxx b/Source/cmExportCommand.cxx
index 8102276..09c01e9 100644
--- a/Source/cmExportCommand.cxx
+++ b/Source/cmExportCommand.cxx
@@ -279,7 +279,6 @@ bool cmExportCommand::HandlePackage(std::vector<std::string> const& args)
#if defined(_WIN32) && !defined(__CYGWIN__)
#include <windows.h>
-#undef GetCurrentDirectory
void cmExportCommand::ReportRegistryError(std::string const& msg,
std::string const& key, long err)
{
diff --git a/Source/cmFindPackageCommand.cxx b/Source/cmFindPackageCommand.cxx
index 4b29837..fe4cc54 100644
--- a/Source/cmFindPackageCommand.cxx
+++ b/Source/cmFindPackageCommand.cxx
@@ -1173,7 +1173,6 @@ void cmFindPackageCommand::FillPrefixesSystemRegistry()
#if defined(_WIN32) && !defined(__CYGWIN__)
#include <windows.h>
-#undef GetCurrentDirectory
// http://msdn.microsoft.com/en-us/library/aa384253%28v=vs.85%29.aspx
#if !defined(KEY_WOW64_32KEY)
#define KEY_WOW64_32KEY 0x0200
diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx
index 1f5e624..0d53bf7 100644
--- a/Source/cmGlobalGenerator.cxx
+++ b/Source/cmGlobalGenerator.cxx
@@ -1,12 +1,5 @@
/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
file Copyright.txt or https://cmake.org/licensing for details. */
-#if defined(_WIN32) && !defined(__CYGWIN__)
-#include "windows.h" // this must be first to define GetCurrentDirectory
-#if defined(_MSC_VER) && _MSC_VER >= 1800
-#define KWSYS_WINDOWS_DEPRECATED_GetVersionEx
-#endif
-#endif
-
#include "cmGlobalGenerator.h"
#include <algorithm>
@@ -19,6 +12,10 @@
#include <stdlib.h>
#include <string.h>
+#if defined(_WIN32) && !defined(__CYGWIN__)
+#include <windows.h>
+#endif
+
#include "cmAlgorithms.h"
#include "cmCPackPropertiesGenerator.h"
#include "cmComputeTargetDepends.h"
@@ -51,6 +48,10 @@
#include <cm_jsoncpp_writer.h>
#endif
+#if defined(_MSC_VER) && _MSC_VER >= 1800
+#define KWSYS_WINDOWS_DEPRECATED_GetVersionEx
+#endif
+
const std::string kCMAKE_PLATFORM_INFO_INITIALIZED =
"CMAKE_PLATFORM_INFO_INITIALIZED";
diff --git a/Source/cmGlobalVisualStudio7Generator.cxx b/Source/cmGlobalVisualStudio7Generator.cxx
index 65a0bde..e7fb203 100644
--- a/Source/cmGlobalVisualStudio7Generator.cxx
+++ b/Source/cmGlobalVisualStudio7Generator.cxx
@@ -1,7 +1,5 @@
/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
file Copyright.txt or https://cmake.org/licensing for details. */
-#include "windows.h" // this must be first to define GetCurrentDirectory
-
#include "cmGlobalVisualStudio7Generator.h"
#include "cmGeneratedFileStream.h"
@@ -14,6 +12,7 @@
#include <cmsys/Encoding.hxx>
#include <assert.h>
+#include <windows.h>
static cmVS7FlagTable cmVS7ExtraFlagTable[] = {
// Precompiled header and related options. Note that the
diff --git a/Source/cmGlobalVisualStudioGenerator.cxx b/Source/cmGlobalVisualStudioGenerator.cxx
index a073426..81d9765 100644
--- a/Source/cmGlobalVisualStudioGenerator.cxx
+++ b/Source/cmGlobalVisualStudioGenerator.cxx
@@ -5,6 +5,7 @@
#include <cmsys/Encoding.hxx>
#include <iostream>
+#include <windows.h>
#include "cmAlgorithms.h"
#include "cmCallVisualStudioMacro.h"
@@ -441,8 +442,6 @@ std::string cmGlobalVisualStudioGenerator::GetStartupProjectName(
return this->GetAllTargetName();
}
-#include <windows.h>
-
bool IsVisualStudioMacrosFileRegistered(const std::string& macrosFile,
const std::string& regKeyBase,
std::string& nextAvailableSubKeyName)
diff --git a/Source/cmLocalVisualStudio7Generator.cxx b/Source/cmLocalVisualStudio7Generator.cxx
index 8026de9..f8490bf 100644
--- a/Source/cmLocalVisualStudio7Generator.cxx
+++ b/Source/cmLocalVisualStudio7Generator.cxx
@@ -16,6 +16,7 @@
#include "cmGeneratedFileStream.h"
#include <ctype.h> // for isspace
+#include <windows.h>
static bool cmLVS7G_IsFAT(const char* dir);
@@ -2115,7 +2116,6 @@ std::string cmLocalVisualStudio7Generator::GetTargetDirectory(
return dir;
}
-#include <windows.h>
static bool cmLVS7G_IsFAT(const char* dir)
{
if (dir[0] && dir[1] == ':') {
diff --git a/Source/cmakemain.cxx b/Source/cmakemain.cxx
index b8e227f..805a9f7 100644
--- a/Source/cmakemain.cxx
+++ b/Source/cmakemain.cxx
@@ -1,11 +1,6 @@
/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
file Copyright.txt or https://cmake.org/licensing for details. */
-// include these first, otherwise there will be problems on Windows
-// with GetCurrentDirectory() being redefined
-#ifdef CMAKE_BUILD_WITH_CMAKE
-#include "cmDocumentation.h"
-#include "cmDynamicLoader.h"
-#endif
+#include <cmConfigure.h>
#include "cmAlgorithms.h"
#include "cmDocumentationEntry.h"
@@ -17,7 +12,11 @@
#include "cmake.h"
#include "cmcmd.h"
-#include <cmConfigure.h>
+#ifdef CMAKE_BUILD_WITH_CMAKE
+#include "cmDocumentation.h"
+#include "cmDynamicLoader.h"
+#endif
+
#include <cmsys/Encoding.hxx>
#if defined(_WIN32) && defined(CMAKE_BUILD_WITH_CMAKE)
#include <cmsys/ConsoleBuf.hxx>