Commit fd47a2ae authored by Brad King's avatar Brad King

Drop old CMake "build settings" export/import

The CMakeExportBuildSettings and CMakeImportBuildSettings modules used
to export compiler paths and flags from one project and import them into
another.  The import process would force the settings on the including
project.

Forcing settings helped long ago when compiler ABIs changed frequently
but is now just a nuisance.  We've deemed the behavior harmful so this
commit simply removes it.  The modules and macros now error out if
included or called from a project that requires CMake 2.8 or higher.
parent 002ae925
# This file has been automatically generated by CMake. DO NOT EDIT!
# It contains the build configuration for @PROJECT_NAME@. The command
# CMAKE_EXPORT_BUILD_SETTINGS(...) was used by @PROJECT_NAME@ to
# generate this file. Another project can use
# CMAKE_IMPORT_BUILD_SETTINGS(...) to load the build configuration
# from this file. The contents of this file may be different across
# versions of CMake. The values set here should not be used by user
# code.
SET(CMAKE_BUILD_SETTING_CMAKE_MAJOR_VERSION "@CMAKE_MAJOR_VERSION@")
SET(CMAKE_BUILD_SETTING_CMAKE_MINOR_VERSION "@CMAKE_MINOR_VERSION@")
SET(CMAKE_BUILD_SETTING_PROJECT_NAME "@PROJECT_NAME@")
SET(CMAKE_BUILD_SETTING_C_COMPILER "@CMAKE_C_COMPILER@")
SET(CMAKE_BUILD_SETTING_C_FLAGS "@CMAKE_C_FLAGS@")
SET(CMAKE_BUILD_SETTING_C_FLAGS_DEBUG "@CMAKE_C_FLAGS_DEBUG@")
SET(CMAKE_BUILD_SETTING_C_FLAGS_RELEASE "@CMAKE_C_FLAGS_RELEASE@")
SET(CMAKE_BUILD_SETTING_C_FLAGS_MINSIZEREL "@CMAKE_C_FLAGS_MINSIZEREL@")
SET(CMAKE_BUILD_SETTING_C_FLAGS_RELWITHDEBINFO "@CMAKE_C_FLAGS_RELWITHDEBINFO@")
SET(CMAKE_BUILD_SETTING_CXX_COMPILER "@CMAKE_CXX_COMPILER@")
SET(CMAKE_BUILD_SETTING_CXX_FLAGS "@CMAKE_CXX_FLAGS@")
SET(CMAKE_BUILD_SETTING_CXX_FLAGS_DEBUG "@CMAKE_CXX_FLAGS_DEBUG@")
SET(CMAKE_BUILD_SETTING_CXX_FLAGS_RELEASE "@CMAKE_CXX_FLAGS_RELEASE@")
SET(CMAKE_BUILD_SETTING_CXX_FLAGS_MINSIZEREL "@CMAKE_CXX_FLAGS_MINSIZEREL@")
SET(CMAKE_BUILD_SETTING_CXX_FLAGS_RELWITHDEBINFO "@CMAKE_CXX_FLAGS_RELWITHDEBINFO@")
SET(CMAKE_BUILD_SETTING_BUILD_TYPE "@CMAKE_BUILD_TYPE@")
SET(CMAKE_BUILD_SETTING_BUILD_TOOL "@CMAKE_BUILD_TOOL@")
# The command CMAKE_EXPORT_BUILD_SETTINGS(...) was used by
# @PROJECT_NAME@ to generate this file. As of CMake 2.8 the
# functionality of this command has been dropped as it was deemed
# harmful (confusing users by changing their compiler).
# CMake 2.6 and below do not support loading their equivalent of this
# file if it was produced by a newer version of CMake. CMake 2.8 and
# above simply do not load this file. Therefore we simply error out.
message(FATAL_ERROR
"This @PROJECT_NAME@ was built by CMake @CMAKE_VERSION@, but this is CMake "
"${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}.${CMAKE_PATCH_VERSION}. "
"Please upgrade CMake to a more recent version.")
# - export build settings from a project.
# CMAKE_EXPORT_BUILD_SETTINGS(SETTINGS_FILE)
# macro defined to export the build settings for use by another project.
# SETTINGS_FILE - the file into which the settings are to be stored.
# This module is purposely no longer documented. It does nothing useful.
IF(NOT "${CMAKE_MINIMUM_REQUIRED_VERSION}" VERSION_LESS 2.7)
MESSAGE(FATAL_ERROR
"The functionality of this module has been dropped as of CMake 2.8. "
"It was deemed harmful (confusing users by changing their compiler). "
"Please remove calls to the CMAKE_EXPORT_BUILD_SETTINGS macro and "
"stop including this module. "
"If this project generates any files for use by external projects, "
"remove any use of the CMakeImportBuildSettings module from them.")
ENDIF()
# This macro used to store build settings of a project in a file to be
# loaded by another project using CMAKE_IMPORT_BUILD_SETTINGS. Now it
# creates a file that refuses to load (with comment explaining why).
MACRO(CMAKE_EXPORT_BUILD_SETTINGS SETTINGS_FILE)
IF(${SETTINGS_FILE} MATCHES ".+")
CONFIGURE_FILE(${CMAKE_ROOT}/Modules/CMakeBuildSettings.cmake.in
......
This diff is collapsed.
......@@ -5,12 +5,6 @@
# be included only when FindVTK.cmake sets the VTK_USE_FILE variable
# to point here.
# Load the compiler settings used for VTK.
IF(VTK_BUILD_SETTINGS_FILE)
INCLUDE(CMakeImportBuildSettings)
CMAKE_IMPORT_BUILD_SETTINGS(${VTK_BUILD_SETTINGS_FILE})
ENDIF(VTK_BUILD_SETTINGS_FILE)
# Add compiler flags needed to use VTK.
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${VTK_REQUIRED_C_FLAGS}")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${VTK_REQUIRED_CXX_FLAGS}")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment