2005-12-14 21:51:08 +03:00
|
|
|
# - import build settings from another project
|
2005-12-15 18:41:19 +03:00
|
|
|
# CMAKE_IMPORT_BUILD_SETTINGS(SETTINGS_FILE)
|
|
|
|
# macro defined to import the build settings from another project.
|
|
|
|
# SETTINGS_FILE is a file created by the other project's call to the
|
|
|
|
# CMAKE_EXPORT_BUILD_SETTINGS macro, see CMakeExportBuildSettings.
|
2002-12-05 17:46:30 +03:00
|
|
|
MACRO(CMAKE_IMPORT_BUILD_SETTINGS SETTINGS_FILE)
|
|
|
|
IF(${SETTINGS_FILE} MATCHES ".+")
|
|
|
|
# Load the settings.
|
|
|
|
INCLUDE(${SETTINGS_FILE})
|
|
|
|
|
|
|
|
# Check the CMake version that stored the settings.
|
|
|
|
IF(${CMAKE_BUILD_SETTING_CMAKE_MAJOR_VERSION}.${CMAKE_BUILD_SETTING_CMAKE_MINOR_VERSION}
|
|
|
|
GREATER ${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION})
|
|
|
|
MESSAGE(SEND_ERROR
|
|
|
|
"${CMAKE_BUILD_SETTING_PROJECT_NAME} was built using CMake "
|
|
|
|
"${CMAKE_BUILD_SETTING_CMAKE_MAJOR_VERSION}.${CMAKE_BUILD_SETTING_CMAKE_MINOR_VERSION}, "
|
|
|
|
"but this is CMake${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}. "
|
|
|
|
"Please upgrade CMake to a more recent version.")
|
|
|
|
ENDIF(${CMAKE_BUILD_SETTING_CMAKE_MAJOR_VERSION}.${CMAKE_BUILD_SETTING_CMAKE_MINOR_VERSION}
|
|
|
|
GREATER ${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION})
|
|
|
|
|
|
|
|
# Check the build tool.
|
2002-12-09 22:33:48 +03:00
|
|
|
SET(CMAKE_BUILD_TOOL1 "")
|
|
|
|
IF(CMAKE_BUILD_TOOL)
|
|
|
|
GET_FILENAME_COMPONENT (CMAKE_BUILD_TOOL1 ${CMAKE_BUILD_TOOL} NAME_WE)
|
2003-09-26 19:15:28 +04:00
|
|
|
STRING(TOLOWER ${CMAKE_BUILD_TOOL1} CMAKE_BUILD_TOOL1)
|
2002-12-09 22:33:48 +03:00
|
|
|
ENDIF(CMAKE_BUILD_TOOL)
|
|
|
|
SET(CMAKE_BUILD_TOOL2 "")
|
|
|
|
IF(CMAKE_BUILD_SETTING_BUILD_TOOL)
|
|
|
|
GET_FILENAME_COMPONENT (CMAKE_BUILD_TOOL2 ${CMAKE_BUILD_SETTING_BUILD_TOOL} NAME_WE)
|
2003-09-26 19:15:28 +04:00
|
|
|
STRING(TOLOWER ${CMAKE_BUILD_TOOL2} CMAKE_BUILD_TOOL2)
|
2002-12-09 22:33:48 +03:00
|
|
|
ENDIF(CMAKE_BUILD_SETTING_BUILD_TOOL)
|
|
|
|
STRING(COMPARE NOTEQUAL "x${CMAKE_BUILD_TOOL1}" "x${CMAKE_BUILD_TOOL2}"
|
2002-12-05 17:46:30 +03:00
|
|
|
CMAKE_BUILD_TOOL_MISMATCH)
|
|
|
|
|
|
|
|
IF(CMAKE_BUILD_SETTING_BUILD_TOOL MATCHES "^msdev$")
|
|
|
|
SET(CMAKE_IMPORT_BUILD_SETTINGS_IMPORTING_FROM_MS_STUDIO 1)
|
|
|
|
ENDIF(CMAKE_BUILD_SETTING_BUILD_TOOL MATCHES "^msdev$")
|
|
|
|
IF(CMAKE_BUILD_SETTING_BUILD_TOOL MATCHES "^devenv$")
|
|
|
|
SET(CMAKE_IMPORT_BUILD_SETTINGS_IMPORTING_FROM_MS_STUDIO 1)
|
|
|
|
ENDIF(CMAKE_BUILD_SETTING_BUILD_TOOL MATCHES "^devenv$")
|
|
|
|
|
|
|
|
# Check the C++ compiler setting. If it is empty, the imported
|
|
|
|
# project is not a C++ project, and doesn't need a matching compiler.
|
|
|
|
IF(CMAKE_BUILD_SETTING_CXX_COMPILER)
|
2006-07-25 00:58:05 +04:00
|
|
|
IF(WIN32)
|
|
|
|
STRING(TOLOWER "x${CMAKE_CXX_COMPILER}" COMPARE_CXX_LOCAL)
|
|
|
|
STRING(TOLOWER "x${CMAKE_BUILD_SETTING_CXX_COMPILER}" COMPARE_CXX_REMOTE)
|
|
|
|
STRING(COMPARE NOTEQUAL "${COMPARE_CXX_LOCAL}" "${COMPARE_CXX_REMOTE}"
|
|
|
|
CMAKE_CXX_COMPILER_MISMATCH)
|
|
|
|
ELSE(WIN32)
|
|
|
|
STRING(COMPARE NOTEQUAL
|
|
|
|
"x${CMAKE_CXX_COMPILER}" "x${CMAKE_BUILD_SETTING_CXX_COMPILER}"
|
|
|
|
CMAKE_CXX_COMPILER_MISMATCH)
|
|
|
|
ENDIF(WIN32)
|
2002-12-05 17:46:30 +03:00
|
|
|
ENDIF(CMAKE_BUILD_SETTING_CXX_COMPILER)
|
|
|
|
|
|
|
|
# Check the C build variation flags.
|
|
|
|
STRING(COMPARE NOTEQUAL
|
2002-12-05 18:34:50 +03:00
|
|
|
"x${CMAKE_C_FLAGS_DEBUG}" "x${CMAKE_BUILD_SETTING_C_FLAGS_DEBUG}"
|
2002-12-05 17:46:30 +03:00
|
|
|
CMAKE_C_FLAGS_DEBUG_MISMATCH)
|
|
|
|
STRING(COMPARE NOTEQUAL
|
2002-12-05 18:34:50 +03:00
|
|
|
"x${CMAKE_C_FLAGS_RELEASE}" "x${CMAKE_BUILD_SETTING_C_FLAGS_RELEASE}"
|
2002-12-05 17:46:30 +03:00
|
|
|
CMAKE_C_FLAGS_RELEASE_MISMATCH)
|
|
|
|
STRING(COMPARE NOTEQUAL
|
2002-12-05 18:34:50 +03:00
|
|
|
"x${CMAKE_C_FLAGS_MINSIZEREL}" "x${CMAKE_BUILD_SETTING_C_FLAGS_MINSIZEREL}"
|
2002-12-05 17:46:30 +03:00
|
|
|
CMAKE_C_FLAGS_MINSIZEREL_MISMATCH)
|
|
|
|
STRING(COMPARE NOTEQUAL
|
2002-12-05 18:34:50 +03:00
|
|
|
"x${CMAKE_C_FLAGS_RELWITHDEBINFO}" "x${CMAKE_BUILD_SETTING_C_FLAGS_RELWITHDEBINFO}"
|
2002-12-05 17:46:30 +03:00
|
|
|
CMAKE_C_FLAGS_RELWITHDEBINFO_MISMATCH)
|
|
|
|
|
|
|
|
# Check the C++ build variation flags.
|
|
|
|
STRING(COMPARE NOTEQUAL
|
2002-12-05 18:34:50 +03:00
|
|
|
"x${CMAKE_CXX_FLAGS_DEBUG}" "x${CMAKE_BUILD_SETTING_CXX_FLAGS_DEBUG}"
|
2002-12-05 17:46:30 +03:00
|
|
|
CMAKE_CXX_FLAGS_DEBUG_MISMATCH)
|
|
|
|
STRING(COMPARE NOTEQUAL
|
2002-12-05 18:34:50 +03:00
|
|
|
"x${CMAKE_CXX_FLAGS_RELEASE}" "x${CMAKE_BUILD_SETTING_CXX_FLAGS_RELEASE}"
|
2002-12-05 17:46:30 +03:00
|
|
|
CMAKE_CXX_FLAGS_RELEASE_MISMATCH)
|
|
|
|
STRING(COMPARE NOTEQUAL
|
2002-12-05 18:34:50 +03:00
|
|
|
"x${CMAKE_CXX_FLAGS_MINSIZEREL}" "x${CMAKE_BUILD_SETTING_CXX_FLAGS_MINSIZEREL}"
|
2002-12-05 17:46:30 +03:00
|
|
|
CMAKE_CXX_FLAGS_MINSIZEREL_MISMATCH)
|
|
|
|
STRING(COMPARE NOTEQUAL
|
2002-12-05 18:34:50 +03:00
|
|
|
"x${CMAKE_CXX_FLAGS_RELWITHDEBINFO}" "x${CMAKE_BUILD_SETTING_CXX_FLAGS_RELWITHDEBINFO}"
|
2002-12-05 17:46:30 +03:00
|
|
|
CMAKE_CXX_FLAGS_RELWITHDEBINFO_MISMATCH)
|
|
|
|
|
|
|
|
# Check the build type.
|
|
|
|
SET(CMAKE_BUILD_TYPE_MISMATCH 0)
|
|
|
|
IF(WIN32)
|
|
|
|
IF(NOT CMAKE_IMPORT_BUILD_SETTINGS_IMPORTING_FROM_MS_STUDIO)
|
|
|
|
STRING(COMPARE NOTEQUAL
|
2002-12-05 18:34:50 +03:00
|
|
|
"x${CMAKE_BUILD_TYPE}" "x${CMAKE_BUILD_SETTING_BUILD_TYPE}"
|
2002-12-05 17:46:30 +03:00
|
|
|
CMAKE_BUILD_TYPE_MISMATCH)
|
|
|
|
ENDIF(NOT CMAKE_IMPORT_BUILD_SETTINGS_IMPORTING_FROM_MS_STUDIO)
|
|
|
|
ENDIF(WIN32)
|
|
|
|
|
|
|
|
# Build tool must match on Windows.
|
|
|
|
IF(WIN32)
|
2008-05-21 22:02:40 +04:00
|
|
|
IF(CMAKE_BUILD_TOOL_MISMATCH AND NOT CMAKE_OVERRIDE_COMPILER_MISMATCH)
|
2002-12-05 17:46:30 +03:00
|
|
|
MESSAGE(SEND_ERROR
|
2004-05-25 19:20:38 +04:00
|
|
|
"This project, ${PROJECT_NAME}, depends on the project "
|
|
|
|
"${CMAKE_BUILD_SETTING_PROJECT_NAME}. Unfortunately "
|
2002-12-05 17:46:30 +03:00
|
|
|
"${CMAKE_BUILD_SETTING_PROJECT_NAME} was built using "
|
2004-05-25 19:20:38 +04:00
|
|
|
"\"${CMAKE_BUILD_TOOL2}\", but you are trying to build "
|
|
|
|
"${PROJECT_NAME} using \"${CMAKE_BUILD_TOOL1}\"."
|
|
|
|
"In order for this build to succeed, both projects must be "
|
|
|
|
"built with the same Generator. To change the Generator you "
|
|
|
|
"are using for the project ${PROJECT_NAME}, you must "
|
|
|
|
"delete the cache, and then rerun cmake and this "
|
|
|
|
"time select the same Generator that was used to build "
|
|
|
|
"${CMAKE_BUILD_SETTING_PROJECT_NAME}. If "
|
|
|
|
"${CMAKE_BUILD_SETTING_PROJECT_NAME} was built using a "
|
|
|
|
"generator that you do not have (for example it was built "
|
|
|
|
"with Visual Studio 6 and you only have 7) then you will "
|
|
|
|
"need to select a different version of "
|
|
|
|
"${CMAKE_BUILD_SETTING_PROJECT_NAME} or rebuild "
|
|
|
|
"${CMAKE_BUILD_SETTING_PROJECT_NAME} with the correct "
|
|
|
|
"generator. ")
|
2008-05-21 22:02:40 +04:00
|
|
|
ENDIF(CMAKE_BUILD_TOOL_MISMATCH AND NOT CMAKE_OVERRIDE_COMPILER_MISMATCH)
|
2002-12-05 17:46:30 +03:00
|
|
|
ENDIF(WIN32)
|
|
|
|
|
|
|
|
# Enforce the C++ compiler setting.
|
2008-03-28 21:07:13 +03:00
|
|
|
# CMAKE_OVERRIDE_COMPILER_MISMATCH allow advanced user to override cmake detection of
|
|
|
|
# compiler mismatch between imported projects. Typical case on UNIX could be:
|
|
|
|
# 1. Compile a project with g++-3.3 while the imported project was configured
|
|
|
|
# using the 'c++' alias (which at the time meant g++-3.3)
|
|
|
|
# 2. This variable also becomes handy when the project your are importing has been
|
|
|
|
# compiled with a compiler you do not have access to, but offer a compatible ABI with
|
|
|
|
# yours.
|
|
|
|
# WARNING: Do not use this variable with C++ compiler with incompatible ABI
|
2008-03-28 20:26:31 +03:00
|
|
|
IF(CMAKE_CXX_COMPILER_MISMATCH AND NOT CMAKE_OVERRIDE_COMPILER_MISMATCH)
|
2002-12-05 17:46:30 +03:00
|
|
|
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 "
|
|
|
|
"because C++ projects must use the same compiler. "
|
|
|
|
"If this message appears for more than one imported project, "
|
|
|
|
"you have conflicting C++ compilers and will have to "
|
2006-07-25 00:58:05 +04:00
|
|
|
"re-build one of those projects. Was set to ${CMAKE_CXX_COMPILER}")
|
2002-12-05 17:46:30 +03:00
|
|
|
SET(CMAKE_CXX_COMPILER ${CMAKE_BUILD_SETTING_CXX_COMPILER}
|
|
|
|
CACHE STRING "C++ compiler imported from ${CMAKE_BUILD_SETTING_PROJECT_NAME}." FORCE)
|
2008-03-28 20:26:31 +03:00
|
|
|
ENDIF(CMAKE_CXX_COMPILER_MISMATCH AND NOT CMAKE_OVERRIDE_COMPILER_MISMATCH)
|
2002-12-05 17:46:30 +03:00
|
|
|
|
|
|
|
# Enforce the build type.
|
2008-03-28 20:26:31 +03:00
|
|
|
IF(CMAKE_BUILD_TYPE_MISMATCH AND NOT CMAKE_OVERRIDE_COMPILER_MISMATCH)
|
2002-12-05 17:46:30 +03:00
|
|
|
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 "
|
|
|
|
"because projects must use the same compiler settings. "
|
|
|
|
"If this message appears for more than one imported project, "
|
|
|
|
"you have conflicting compiler settings and will have to "
|
|
|
|
"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)
|
2008-03-28 20:26:31 +03:00
|
|
|
ENDIF(CMAKE_BUILD_TYPE_MISMATCH AND NOT CMAKE_OVERRIDE_COMPILER_MISMATCH)
|
2002-12-05 17:46:30 +03:00
|
|
|
|
|
|
|
# Enforce the C build variation flags.
|
|
|
|
|
2008-03-28 20:26:31 +03:00
|
|
|
IF(CMAKE_C_FLAGS_DEBUG_MISMATCH AND NOT CMAKE_OVERRIDE_COMPILER_MISMATCH)
|
2002-12-05 17:46:30 +03:00
|
|
|
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}. "
|
|
|
|
"If this message appears for more than one imported project, "
|
|
|
|
"you have conflicting options and will have to "
|
|
|
|
"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)
|
2008-03-28 20:26:31 +03:00
|
|
|
ENDIF(CMAKE_C_FLAGS_DEBUG_MISMATCH AND NOT CMAKE_OVERRIDE_COMPILER_MISMATCH)
|
2002-12-05 17:46:30 +03:00
|
|
|
|
2008-03-28 20:26:31 +03:00
|
|
|
IF(CMAKE_C_FLAGS_RELEASE_MISMATCH AND NOT CMAKE_OVERRIDE_COMPILER_MISMATCH)
|
2002-12-05 17:46:30 +03:00
|
|
|
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}. "
|
|
|
|
"If this message appears for more than one imported project, "
|
|
|
|
"you have conflicting options and will have to "
|
|
|
|
"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)
|
2008-03-28 20:26:31 +03:00
|
|
|
ENDIF(CMAKE_C_FLAGS_RELEASE_MISMATCH AND NOT CMAKE_OVERRIDE_COMPILER_MISMATCH)
|
2002-12-05 17:46:30 +03:00
|
|
|
|
2008-03-28 20:26:31 +03:00
|
|
|
IF(CMAKE_C_FLAGS_MINSIZEREL_MISMATCH AND NOT CMAKE_OVERRIDE_COMPILER_MISMATCH)
|
2002-12-05 17:46:30 +03:00
|
|
|
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}. "
|
|
|
|
"If this message appears for more than one imported project, "
|
|
|
|
"you have conflicting options and will have to "
|
|
|
|
"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)
|
2008-03-28 20:26:31 +03:00
|
|
|
ENDIF(CMAKE_C_FLAGS_MINSIZEREL_MISMATCH AND NOT CMAKE_OVERRIDE_COMPILER_MISMATCH)
|
2002-12-05 17:46:30 +03:00
|
|
|
|
2008-03-28 20:26:31 +03:00
|
|
|
IF(CMAKE_C_FLAGS_RELWITHDEBINFO_MISMATCH AND NOT CMAKE_OVERRIDE_COMPILER_MISMATCH)
|
2002-12-05 17:46:30 +03:00
|
|
|
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}. "
|
|
|
|
"If this message appears for more than one imported project, "
|
|
|
|
"you have conflicting options and will have to "
|
|
|
|
"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)
|
2008-03-28 20:26:31 +03:00
|
|
|
ENDIF(CMAKE_C_FLAGS_RELWITHDEBINFO_MISMATCH AND NOT CMAKE_OVERRIDE_COMPILER_MISMATCH)
|
2002-12-05 17:46:30 +03:00
|
|
|
|
|
|
|
# Enforce the C++ build variation flags.
|
|
|
|
|
2008-03-28 20:26:31 +03:00
|
|
|
IF(CMAKE_CXX_FLAGS_DEBUG_MISMATCH AND NOT CMAKE_OVERRIDE_COMPILER_MISMATCH)
|
2002-12-05 17:46:30 +03:00
|
|
|
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}. "
|
|
|
|
"If this message appears for more than one imported project, "
|
|
|
|
"you have conflicting options and will have to "
|
|
|
|
"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)
|
2008-03-28 20:26:31 +03:00
|
|
|
ENDIF(CMAKE_CXX_FLAGS_DEBUG_MISMATCH AND NOT CMAKE_OVERRIDE_COMPILER_MISMATCH)
|
2002-12-05 17:46:30 +03:00
|
|
|
|
2008-03-28 20:26:31 +03:00
|
|
|
IF(CMAKE_CXX_FLAGS_RELEASE_MISMATCH AND NOT CMAKE_OVERRIDE_COMPILER_MISMATCH)
|
2002-12-05 17:46:30 +03:00
|
|
|
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}. "
|
|
|
|
"If this message appears for more than one imported project, "
|
|
|
|
"you have conflicting options and will have to "
|
|
|
|
"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)
|
2008-03-28 20:26:31 +03:00
|
|
|
ENDIF(CMAKE_CXX_FLAGS_RELEASE_MISMATCH AND NOT CMAKE_OVERRIDE_COMPILER_MISMATCH)
|
2002-12-05 17:46:30 +03:00
|
|
|
|
2008-03-28 20:26:31 +03:00
|
|
|
IF(CMAKE_CXX_FLAGS_MINSIZEREL_MISMATCH AND NOT CMAKE_OVERRIDE_COMPILER_MISMATCH)
|
2002-12-05 17:46:30 +03:00
|
|
|
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}. "
|
|
|
|
"If this message appears for more than one imported project, "
|
|
|
|
"you have conflicting options and will have to "
|
|
|
|
"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)
|
2008-03-28 20:26:31 +03:00
|
|
|
ENDIF(CMAKE_CXX_FLAGS_MINSIZEREL_MISMATCH AND NOT CMAKE_OVERRIDE_COMPILER_MISMATCH)
|
2002-12-05 17:46:30 +03:00
|
|
|
|
2008-03-28 20:26:31 +03:00
|
|
|
IF(CMAKE_CXX_FLAGS_RELWITHDEBINFO_MISMATCH AND NOT CMAKE_OVERRIDE_COMPILER_MISMATCH)
|
2002-12-05 17:46:30 +03:00
|
|
|
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}. "
|
|
|
|
"If this message appears for more than one imported project, "
|
|
|
|
"you have conflicting options and will have to "
|
|
|
|
"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)
|
2008-03-28 20:26:31 +03:00
|
|
|
ENDIF(CMAKE_CXX_FLAGS_RELWITHDEBINFO_MISMATCH AND NOT CMAKE_OVERRIDE_COMPILER_MISMATCH)
|
2002-12-05 17:46:30 +03:00
|
|
|
|
|
|
|
ELSE(${SETTINGS_FILE} MATCHES ".+")
|
|
|
|
MESSAGE(SEND_ERROR "CMAKE_IMPORT_BUILD_SETTINGS called with no argument.")
|
|
|
|
ENDIF(${SETTINGS_FILE} MATCHES ".+")
|
|
|
|
ENDMACRO(CMAKE_IMPORT_BUILD_SETTINGS)
|