From 73284a1c12c6707b802233111a7c1e5e18c94c14 Mon Sep 17 00:00:00 2001 From: Brad King Date: Tue, 31 Jan 2006 19:34:57 -0500 Subject: [PATCH] ENH: Enabled build of VS 7 and 8 generators for MinGW. --- Source/CMakeLists.txt | 44 +++++++++++++++++++++---------------------- Source/cmake.cxx | 16 ++++++---------- 2 files changed, 28 insertions(+), 32 deletions(-) diff --git a/Source/CMakeLists.txt b/Source/CMakeLists.txt index 0318d0549..988b0eee2 100644 --- a/Source/CMakeLists.txt +++ b/Source/CMakeLists.txt @@ -174,43 +174,43 @@ IF (WIN32) IF(NOT UNIX) SET(SRCS ${SRCS} cmGlobalBorlandMakefileGenerator.cxx - cmGlobalNMakeMakefileGenerator.cxx - cmGlobalWatcomWMakeGenerator.cxx + cmGlobalBorlandMakefileGenerator.h cmGlobalMSYSMakefileGenerator.cxx cmGlobalMinGWMakefileGenerator.cxx - cmGlobalVisualStudio6Generator.cxx - cmLocalVisualStudio6Generator.cxx - cmGlobalBorlandMakefileGenerator.h + cmGlobalNMakeMakefileGenerator.cxx cmGlobalNMakeMakefileGenerator.h + cmGlobalVisualStudio6Generator.cxx cmGlobalVisualStudio6Generator.h + cmGlobalVisualStudio71Generator.cxx + cmGlobalVisualStudio71Generator.h + cmGlobalVisualStudio7Generator.cxx + cmGlobalVisualStudio7Generator.h + cmGlobalVisualStudio8Generator.cxx + cmGlobalVisualStudio8Generator.h + cmGlobalWatcomWMakeGenerator.cxx + cmLocalVisualStudio6Generator.cxx cmLocalVisualStudio6Generator.h + cmLocalVisualStudio7Generator.cxx + cmLocalVisualStudio7Generator.h cmWin32ProcessExecution.cxx cmWin32ProcessExecution.h ) - IF(NOT MINGW) - SET(SRCS ${SRCS} - cmGlobalVisualStudio71Generator.h - cmGlobalVisualStudio8Generator.h - cmGlobalVisualStudio7Generator.h - cmLocalVisualStudio7Generator.h - cmGlobalVisualStudio8Generator.cxx - cmGlobalVisualStudio71Generator.cxx - cmGlobalVisualStudio7Generator.cxx - cmLocalVisualStudio7Generator.cxx) - ENDIF(NOT MINGW) ENDIF(NOT UNIX) ENDIF (WIN32) # create a library used by the command line and the GUI ADD_LIBRARY(CMakeLib ${SRCS}) TARGET_LINK_LIBRARIES(CMakeLib cmsys ${CMAKE_EXPAT_LIBRARIES} ${CMAKE_ZLIB_LIBRARIES} ${CMAKE_TAR_LIBRARIES}) -IF (UNIX) + +# On UNIX platforms we need the dl libraries for loading plugins. +IF(UNIX) TARGET_LINK_LIBRARIES(CMakeLib ${CMAKE_DL_LIBS}) -ENDIF (UNIX) -IF(CMAKE_BUILD_ON_VISUAL_STUDIO) - # On Visual Studio we need rpcrt4.lib for cmVisualStudio7 generator. - TARGET_LINK_LIBRARIES(CMakeLib rpcrt4.lib) -ENDIF(CMAKE_BUILD_ON_VISUAL_STUDIO) +ENDIF(UNIX) + +# On some platforms we need the rpcrt4 library for the VS 7 generators. +IF(CMAKE_BUILD_ON_VISUAL_STUDIO OR MINGW) + TARGET_LINK_LIBRARIES(CMakeLib rpcrt4) +ENDIF(CMAKE_BUILD_ON_VISUAL_STUDIO OR MINGW) # # CTestLib diff --git a/Source/cmake.cxx b/Source/cmake.cxx index a10b1ae49..da39732e8 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -43,13 +43,11 @@ // include the generator #if defined(_WIN32) && !defined(__CYGWIN__) -# if !defined(__MINGW32__) +# if !defined(CMAKE_BOOT_MINGW) +# include "cmGlobalVisualStudio6Generator.h" # include "cmGlobalVisualStudio7Generator.h" # include "cmGlobalVisualStudio71Generator.h" # include "cmGlobalVisualStudio8Generator.h" -# endif -# if !defined(CMAKE_BOOT_MINGW) -# include "cmGlobalVisualStudio6Generator.h" # include "cmGlobalBorlandMakefileGenerator.h" # include "cmGlobalNMakeMakefileGenerator.h" # include "cmGlobalWatcomWMakeGenerator.h" @@ -1599,24 +1597,22 @@ void cmake::AddDefaultCommands() void cmake::AddDefaultGenerators() { #if defined(_WIN32) && !defined(__CYGWIN__) -#if !defined(__MINGW32__) +# if !defined(CMAKE_BOOT_MINGW) + m_Generators[cmGlobalVisualStudio6Generator::GetActualName()] = + &cmGlobalVisualStudio6Generator::New; m_Generators[cmGlobalVisualStudio7Generator::GetActualName()] = &cmGlobalVisualStudio7Generator::New; m_Generators[cmGlobalVisualStudio71Generator::GetActualName()] = &cmGlobalVisualStudio71Generator::New; m_Generators[cmGlobalVisualStudio8Generator::GetActualName()] = &cmGlobalVisualStudio8Generator::New; -#endif -#if !defined(CMAKE_BOOT_MINGW) - m_Generators[cmGlobalVisualStudio6Generator::GetActualName()] = - &cmGlobalVisualStudio6Generator::New; m_Generators[cmGlobalBorlandMakefileGenerator::GetActualName()] = &cmGlobalBorlandMakefileGenerator::New; m_Generators[cmGlobalNMakeMakefileGenerator::GetActualName()] = &cmGlobalNMakeMakefileGenerator::New; m_Generators[cmGlobalWatcomWMakeGenerator::GetActualName()] = &cmGlobalWatcomWMakeGenerator::New; -#endif +# endif m_Generators[cmGlobalMSYSMakefileGenerator::GetActualName()] = &cmGlobalMSYSMakefileGenerator::New; m_Generators[cmGlobalMinGWMakefileGenerator::GetActualName()] =