summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt41
1 files changed, 5 insertions, 36 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 69fbbca3830..e681191fbbf 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -28,10 +28,12 @@ ENDIF()
# We use the LOCATION target property (CMP0026)
# and get_target_property() for non-existent targets (CMP0045)
+# and INSTALL_NAME_DIR (CMP0042)
IF(CMAKE_VERSION VERSION_EQUAL "3.0.0" OR
CMAKE_VERSION VERSION_GREATER "3.0.0")
CMAKE_POLICY(SET CMP0026 OLD)
CMAKE_POLICY(SET CMP0045 OLD)
+ CMAKE_POLICY(SET CMP0042 OLD)
ENDIF()
MESSAGE(STATUS "Running cmake version ${CMAKE_VERSION}")
@@ -108,36 +110,15 @@ FOREACH(_base
ENDFOREACH()
-
# Following autotools tradition, add preprocessor definitions
# specified in environment variable CPPFLAGS
IF(DEFINED ENV{CPPFLAGS})
ADD_DEFINITIONS($ENV{CPPFLAGS})
ENDIF()
-#
-# Control aspects of the development environment which are
-# specific to MySQL maintainers and developers.
-#
-INCLUDE(maintainer)
-
-SET(MYSQL_MAINTAINER_MODE "OFF" CACHE STRING "MySQL maintainer-specific development environment. Options are: ON OFF AUTO.")
+SET(MYSQL_MAINTAINER_MODE "AUTO" CACHE STRING "MySQL maintainer-specific development environment. Options are: ON OFF AUTO.")
MARK_AS_ADVANCED(MYSQL_MAINTAINER_MODE)
-# Whether the maintainer mode compiler options should be enabled.
-IF(CMAKE_C_COMPILER_ID MATCHES "GNU")
- SET_MYSQL_MAINTAINER_GNU_C_OPTIONS()
-ENDIF()
-IF(CMAKE_CXX_COMPILER_ID MATCHES "GNU")
- SET_MYSQL_MAINTAINER_GNU_CXX_OPTIONS()
-ENDIF()
-IF(CMAKE_C_COMPILER_ID MATCHES "Intel")
- SET_MYSQL_MAINTAINER_INTEL_C_OPTIONS()
-ENDIF()
-IF(CMAKE_CXX_COMPILER_ID MATCHES "Intel")
- SET_MYSQL_MAINTAINER_INTEL_CXX_OPTIONS()
-ENDIF()
-
# Packaging
IF (NOT CPACK_GENERATOR)
IF(WIN32)
@@ -186,7 +167,7 @@ OPTION (WITH_UNIT_TESTS "Compile MySQL with unit tests" ON)
MARK_AS_ADVANCED(CYBOZU BACKUP_TEST WITHOUT_SERVER DISABLE_SHARED)
OPTION(NOT_FOR_DISTRIBUTION "Allow linking with GPLv2-incompatible system libraries. Only set it you never plan to distribute the resulting binaries" OFF)
-
+
include(CheckCSourceCompiles)
include(CheckCXXSourceCompiles)
# We need some extra FAIL_REGEX patterns
@@ -396,18 +377,7 @@ CHECK_PCRE()
# We have to add MAINTAINER_C_WARNINGS first to ensure that the flags
# given by the invoking user are honored
#
-IF(MYSQL_MAINTAINER_MODE MATCHES "ON")
- SET(CMAKE_C_FLAGS "${MY_MAINTAINER_C_WARNINGS} ${CMAKE_C_FLAGS}")
- SET(CMAKE_CXX_FLAGS "${MY_MAINTAINER_CXX_WARNINGS} ${CMAKE_CXX_FLAGS}")
-ELSEIF(MYSQL_MAINTAINER_MODE MATCHES "AUTO")
- SET(CMAKE_C_FLAGS_DEBUG "${MY_MAINTAINER_C_WARNINGS} ${CMAKE_C_FLAGS_DEBUG}")
- SET(CMAKE_CXX_FLAGS_DEBUG "${MY_MAINTAINER_CXX_WARNINGS} ${CMAKE_CXX_FLAGS_DEBUG}")
-ENDIF()
-
-IF(CMAKE_CROSSCOMPILING)
- SET(IMPORT_EXECUTABLES "IMPORTFILE-NOTFOUND" CACHE FILEPATH "Path to import_executables.cmake from a native build")
- INCLUDE(${IMPORT_EXECUTABLES})
-ENDIF()
+INCLUDE(maintainer)
IF(WITH_UNIT_TESTS)
ENABLE_TESTING()
@@ -534,4 +504,3 @@ IF(NON_DISTRIBUTABLE_WARNING)
MESSAGE(WARNING "
You have linked MariaDB with GPLv3 libraries! You may not distribute the resulting binary. If you do, you will put yourself into a legal problem with Free Software Foundation.")
ENDIF()
-