summaryrefslogtreecommitdiff
path: root/Modules/CMakeImportBuildSettings.cmake
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2008-03-28 13:26:31 -0400
committerBrad King <brad.king@kitware.com>2008-03-28 13:26:31 -0400
commitd71c6ba49a4e44d4c93ffbefc597d4d7c5aef183 (patch)
treeb70778828e1088f25a1068e789d9bbfc21b52241 /Modules/CMakeImportBuildSettings.cmake
parentb8169eb4e3b1d44888a3cdffab046d4ef841ceea (diff)
downloadcmake-d71c6ba49a4e44d4c93ffbefc597d4d7c5aef183.tar.gz
ENH: Patch from Mathieu Malaterre to allow users to tell CMakeImportBuildSettings to not force compiler settings.
Diffstat (limited to 'Modules/CMakeImportBuildSettings.cmake')
-rw-r--r--Modules/CMakeImportBuildSettings.cmake40
1 files changed, 20 insertions, 20 deletions
diff --git a/Modules/CMakeImportBuildSettings.cmake b/Modules/CMakeImportBuildSettings.cmake
index 4a8c1e3a69..c3f16dee50 100644
--- a/Modules/CMakeImportBuildSettings.cmake
+++ b/Modules/CMakeImportBuildSettings.cmake
@@ -119,7 +119,7 @@ MACRO(CMAKE_IMPORT_BUILD_SETTINGS SETTINGS_FILE)
ENDIF(WIN32)
# Enforce the C++ compiler setting.
- IF(CMAKE_CXX_COMPILER_MISMATCH)
+ IF(CMAKE_CXX_COMPILER_MISMATCH AND NOT CMAKE_OVERRIDE_COMPILER_MISMATCH)
MESSAGE("Warning: CMake is forcing CMAKE_CXX_COMPILER to "
"\"${CMAKE_BUILD_SETTING_CXX_COMPILER}\" to match that imported "
"from ${CMAKE_BUILD_SETTING_PROJECT_NAME}. This is required "
@@ -129,10 +129,10 @@ MACRO(CMAKE_IMPORT_BUILD_SETTINGS SETTINGS_FILE)
"re-build one of those projects. Was set to ${CMAKE_CXX_COMPILER}")
SET(CMAKE_CXX_COMPILER ${CMAKE_BUILD_SETTING_CXX_COMPILER}
CACHE STRING "C++ compiler imported from ${CMAKE_BUILD_SETTING_PROJECT_NAME}." FORCE)
- ENDIF(CMAKE_CXX_COMPILER_MISMATCH)
+ ENDIF(CMAKE_CXX_COMPILER_MISMATCH AND NOT CMAKE_OVERRIDE_COMPILER_MISMATCH)
# Enforce the build type.
- IF(CMAKE_BUILD_TYPE_MISMATCH)
+ IF(CMAKE_BUILD_TYPE_MISMATCH AND NOT CMAKE_OVERRIDE_COMPILER_MISMATCH)
MESSAGE("Warning: CMake is forcing CMAKE_BUILD_TYPE to "
"\"${CMAKE_BUILD_SETTING_BUILD_TYPE}\" to match that imported "
"from ${CMAKE_BUILD_SETTING_PROJECT_NAME}. This is required "
@@ -142,11 +142,11 @@ MACRO(CMAKE_IMPORT_BUILD_SETTINGS SETTINGS_FILE)
"re-build one of those projects.")
SET(CMAKE_BUILD_TYPE ${CMAKE_BUILD_SETTING_BUILD_TYPE}
CACHE STRING "Build type imported from ${CMAKE_BUILD_SETTING_PROJECT_NAME}." FORCE)
- ENDIF(CMAKE_BUILD_TYPE_MISMATCH)
+ ENDIF(CMAKE_BUILD_TYPE_MISMATCH AND NOT CMAKE_OVERRIDE_COMPILER_MISMATCH)
# Enforce the C build variation flags.
- IF(CMAKE_C_FLAGS_DEBUG_MISMATCH)
+ IF(CMAKE_C_FLAGS_DEBUG_MISMATCH AND NOT CMAKE_OVERRIDE_COMPILER_MISMATCH)
MESSAGE("Warning: CMake is forcing CMAKE_C_FLAGS_DEBUG to "
"\"${CMAKE_BUILD_SETTING_C_FLAGS_DEBUG}\" to match that imported "
"from ${CMAKE_BUILD_SETTING_PROJECT_NAME}. "
@@ -155,9 +155,9 @@ MACRO(CMAKE_IMPORT_BUILD_SETTINGS SETTINGS_FILE)
"re-build one of those projects.")
SET(CMAKE_C_FLAGS_DEBUG ${CMAKE_BUILD_SETTING_C_FLAGS_DEBUG}
CACHE STRING "C DEBUG flags imported from ${CMAKE_BUILD_SETTING_PROJECT_NAME}." FORCE)
- ENDIF(CMAKE_C_FLAGS_DEBUG_MISMATCH)
+ ENDIF(CMAKE_C_FLAGS_DEBUG_MISMATCH AND NOT CMAKE_OVERRIDE_COMPILER_MISMATCH)
- IF(CMAKE_C_FLAGS_RELEASE_MISMATCH)
+ IF(CMAKE_C_FLAGS_RELEASE_MISMATCH AND NOT CMAKE_OVERRIDE_COMPILER_MISMATCH)
MESSAGE("Warning: CMake is forcing CMAKE_C_FLAGS_RELEASE to "
"\"${CMAKE_BUILD_SETTING_C_FLAGS_RELEASE}\" to match that imported "
"from ${CMAKE_BUILD_SETTING_PROJECT_NAME}. "
@@ -166,9 +166,9 @@ MACRO(CMAKE_IMPORT_BUILD_SETTINGS SETTINGS_FILE)
"re-build one of those projects.")
SET(CMAKE_C_FLAGS_RELEASE ${CMAKE_BUILD_SETTING_C_FLAGS_RELEASE}
CACHE STRING "C RELEASE flags imported from ${CMAKE_BUILD_SETTING_PROJECT_NAME}." FORCE)
- ENDIF(CMAKE_C_FLAGS_RELEASE_MISMATCH)
+ ENDIF(CMAKE_C_FLAGS_RELEASE_MISMATCH AND NOT CMAKE_OVERRIDE_COMPILER_MISMATCH)
- IF(CMAKE_C_FLAGS_MINSIZEREL_MISMATCH)
+ IF(CMAKE_C_FLAGS_MINSIZEREL_MISMATCH AND NOT CMAKE_OVERRIDE_COMPILER_MISMATCH)
MESSAGE("Warning: CMake is forcing CMAKE_C_FLAGS_MINSIZEREL to "
"\"${CMAKE_BUILD_SETTING_C_FLAGS_MINSIZEREL}\" to match that imported "
"from ${CMAKE_BUILD_SETTING_PROJECT_NAME}. "
@@ -177,9 +177,9 @@ MACRO(CMAKE_IMPORT_BUILD_SETTINGS SETTINGS_FILE)
"re-build one of those projects.")
SET(CMAKE_C_FLAGS_MINSIZEREL ${CMAKE_BUILD_SETTING_C_FLAGS_MINSIZEREL}
CACHE STRING "C MINSIZEREL flags imported from ${CMAKE_BUILD_SETTING_PROJECT_NAME}." FORCE)
- ENDIF(CMAKE_C_FLAGS_MINSIZEREL_MISMATCH)
+ ENDIF(CMAKE_C_FLAGS_MINSIZEREL_MISMATCH AND NOT CMAKE_OVERRIDE_COMPILER_MISMATCH)
- IF(CMAKE_C_FLAGS_RELWITHDEBINFO_MISMATCH)
+ IF(CMAKE_C_FLAGS_RELWITHDEBINFO_MISMATCH AND NOT CMAKE_OVERRIDE_COMPILER_MISMATCH)
MESSAGE("Warning: CMake is forcing CMAKE_C_FLAGS_RELWITHDEBINFO to "
"\"${CMAKE_BUILD_SETTING_C_FLAGS_RELWITHDEBINFO}\" to match that imported "
"from ${CMAKE_BUILD_SETTING_PROJECT_NAME}. "
@@ -188,11 +188,11 @@ MACRO(CMAKE_IMPORT_BUILD_SETTINGS SETTINGS_FILE)
"re-build one of those projects.")
SET(CMAKE_C_FLAGS_RELWITHDEBINFO ${CMAKE_BUILD_SETTING_C_FLAGS_RELWITHDEBINFO}
CACHE STRING "C RELWITHDEBINFO flags imported from ${CMAKE_BUILD_SETTING_PROJECT_NAME}." FORCE)
- ENDIF(CMAKE_C_FLAGS_RELWITHDEBINFO_MISMATCH)
+ ENDIF(CMAKE_C_FLAGS_RELWITHDEBINFO_MISMATCH AND NOT CMAKE_OVERRIDE_COMPILER_MISMATCH)
# Enforce the C++ build variation flags.
- IF(CMAKE_CXX_FLAGS_DEBUG_MISMATCH)
+ IF(CMAKE_CXX_FLAGS_DEBUG_MISMATCH AND NOT CMAKE_OVERRIDE_COMPILER_MISMATCH)
MESSAGE("Warning: CMake is forcing CMAKE_CXX_FLAGS_DEBUG to "
"\"${CMAKE_BUILD_SETTING_CXX_FLAGS_DEBUG}\" to match that imported "
"from ${CMAKE_BUILD_SETTING_PROJECT_NAME}. "
@@ -201,9 +201,9 @@ MACRO(CMAKE_IMPORT_BUILD_SETTINGS SETTINGS_FILE)
"re-build one of those projects.")
SET(CMAKE_CXX_FLAGS_DEBUG ${CMAKE_BUILD_SETTING_CXX_FLAGS_DEBUG}
CACHE STRING "C++ DEBUG flags imported from ${CMAKE_BUILD_SETTING_PROJECT_NAME}." FORCE)
- ENDIF(CMAKE_CXX_FLAGS_DEBUG_MISMATCH)
+ ENDIF(CMAKE_CXX_FLAGS_DEBUG_MISMATCH AND NOT CMAKE_OVERRIDE_COMPILER_MISMATCH)
- IF(CMAKE_CXX_FLAGS_RELEASE_MISMATCH)
+ IF(CMAKE_CXX_FLAGS_RELEASE_MISMATCH AND NOT CMAKE_OVERRIDE_COMPILER_MISMATCH)
MESSAGE("Warning: CMake is forcing CMAKE_CXX_FLAGS_RELEASE to "
"\"${CMAKE_BUILD_SETTING_CXX_FLAGS_RELEASE}\" to match that imported "
"from ${CMAKE_BUILD_SETTING_PROJECT_NAME}. "
@@ -212,9 +212,9 @@ MACRO(CMAKE_IMPORT_BUILD_SETTINGS SETTINGS_FILE)
"re-build one of those projects.")
SET(CMAKE_CXX_FLAGS_RELEASE ${CMAKE_BUILD_SETTING_CXX_FLAGS_RELEASE}
CACHE STRING "C++ RELEASE flags imported from ${CMAKE_BUILD_SETTING_PROJECT_NAME}." FORCE)
- ENDIF(CMAKE_CXX_FLAGS_RELEASE_MISMATCH)
+ ENDIF(CMAKE_CXX_FLAGS_RELEASE_MISMATCH AND NOT CMAKE_OVERRIDE_COMPILER_MISMATCH)
- IF(CMAKE_CXX_FLAGS_MINSIZEREL_MISMATCH)
+ IF(CMAKE_CXX_FLAGS_MINSIZEREL_MISMATCH AND NOT CMAKE_OVERRIDE_COMPILER_MISMATCH)
MESSAGE("Warning: CMake is forcing CMAKE_CXX_FLAGS_MINSIZEREL to "
"\"${CMAKE_BUILD_SETTING_CXX_FLAGS_MINSIZEREL}\" to match that imported "
"from ${CMAKE_BUILD_SETTING_PROJECT_NAME}. "
@@ -223,9 +223,9 @@ MACRO(CMAKE_IMPORT_BUILD_SETTINGS SETTINGS_FILE)
"re-build one of those projects.")
SET(CMAKE_CXX_FLAGS_MINSIZEREL ${CMAKE_BUILD_SETTING_CXX_FLAGS_MINSIZEREL}
CACHE STRING "C++ MINSIZEREL flags imported from ${CMAKE_BUILD_SETTING_PROJECT_NAME}." FORCE)
- ENDIF(CMAKE_CXX_FLAGS_MINSIZEREL_MISMATCH)
+ ENDIF(CMAKE_CXX_FLAGS_MINSIZEREL_MISMATCH AND NOT CMAKE_OVERRIDE_COMPILER_MISMATCH)
- IF(CMAKE_CXX_FLAGS_RELWITHDEBINFO_MISMATCH)
+ IF(CMAKE_CXX_FLAGS_RELWITHDEBINFO_MISMATCH AND NOT CMAKE_OVERRIDE_COMPILER_MISMATCH)
MESSAGE("Warning: CMake is forcing CMAKE_CXX_FLAGS_RELWITHDEBINFO to "
"\"${CMAKE_BUILD_SETTING_CXX_FLAGS_RELWITHDEBINFO}\" to match that imported "
"from ${CMAKE_BUILD_SETTING_PROJECT_NAME}. "
@@ -234,7 +234,7 @@ MACRO(CMAKE_IMPORT_BUILD_SETTINGS SETTINGS_FILE)
"re-build one of those projects.")
SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO ${CMAKE_BUILD_SETTING_CXX_FLAGS_RELWITHDEBINFO}
CACHE STRING "C++ RELWITHDEBINFO flags imported from ${CMAKE_BUILD_SETTING_PROJECT_NAME}." FORCE)
- ENDIF(CMAKE_CXX_FLAGS_RELWITHDEBINFO_MISMATCH)
+ ENDIF(CMAKE_CXX_FLAGS_RELWITHDEBINFO_MISMATCH AND NOT CMAKE_OVERRIDE_COMPILER_MISMATCH)
ELSE(${SETTINGS_FILE} MATCHES ".+")
MESSAGE(SEND_ERROR "CMAKE_IMPORT_BUILD_SETTINGS called with no argument.")