diff options
author | Vladislav Vaintroub <vvaintroub@mysql.com> | 2010-01-26 13:47:34 +0100 |
---|---|---|
committer | Vladislav Vaintroub <vvaintroub@mysql.com> | 2010-01-26 13:47:34 +0100 |
commit | a8c47397fc3ede7d3452e48baf56bbb9bc28ea8f (patch) | |
tree | e3f4d60661a317c145fccf61d530d7c9a4616c1b /CMakeLists.txt | |
parent | 28a5ee8f056a0c3423c611969980acfb2e9f98e1 (diff) | |
download | mariadb-git-a8c47397fc3ede7d3452e48baf56bbb9bc28ea8f.tar.gz |
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
Diffstat (limited to 'CMakeLists.txt')
-rwxr-xr-x | CMakeLists.txt | 33 |
1 files changed, 19 insertions, 14 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index f63e31d9cc0..0c40877d8ee 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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) |