WL#5161: Implement Mats' suggestion of moving OS specific CMake code to OS specific files, instead of

polluting code with IF(CMAKE_SYSTEM_NAME MATCHES...), first on Windows.

cmake/libutils.cmake:
  Fix the case in MERGE_LIBRARIES, where  there is no dependency on OS libraries.
cmake/os/Windows.cmake:
  Move windows specific code to cmake/os/Windows.cmake
configure.cmake:
  Move some Windows code to cmake/os/Windows.cmake
This commit is contained in:
Vladislav Vaintroub 2010-01-26 13:47:34 +01:00
commit a8c47397fc
5 changed files with 217 additions and 205 deletions

View file

@ -61,6 +61,25 @@ ENDIF()
PROJECT(MySQL)
# Include the platform-specific file. To allow exceptions, this code
# looks for files in order of how specific they are. If there is, for
# example, a generic Linux.cmake and a version-specific
# Linux-2.6.28-11-generic, it will pick Linux-2.6.28-11-generic and
# include it. It is then up to the file writer to include the generic
# version if necessary.
FOREACH(_base
${CMAKE_SYSTEM_NAME}-${CMAKE_SYSTEM_VERSION}-${CMAKE_SYSTEM_PROCESSOR}
${CMAKE_SYSTEM_NAME}-${CMAKE_SYSTEM_VERSION}
${CMAKE_SYSTEM_NAME})
SET(_file ${CMAKE_SOURCE_DIR}/cmake/os/${_base}.cmake)
IF(EXISTS ${_file})
INCLUDE(${_file})
BREAK()
ENDIF()
ENDFOREACH()
# Following autotools tradition, add preprocessor definitions
# specified in environment variable CPPFLAGS
IF(DEFINED ENV{CPPFLAGS})
@ -71,12 +90,6 @@ IF(CYGWIN)
SET(WIN32 0)
ENDIF()
IF(WIN32)
SET(IF_WIN 0)
ELSE()
SET(IF_WIN 1)
ENDIF()
# Add macros
INCLUDE(character_sets)
INCLUDE(zlib)
@ -163,8 +176,6 @@ IF(WITH_DEBUG OR WITH_DEBUG_FULL AND NOT WIN32)
ENDIF()
# Set commonly used variables
IF(WIN32)
SET(DEFAULT_MYSQL_HOME "C:/Program Files/MySQL/MySQL Server ${MYSQL_BASE_VERSION}" )
@ -184,12 +195,6 @@ IF(SYSCONFDIR)
ENDIF()
# Optionally read user configuration, generated by configure.js.
# This is left for backward compatibility reasons only.
IF(WIN32)
INCLUDE(win/configure.data OPTIONAL)
ENDIF()
# Run platform tests
INCLUDE(configure.cmake)