CMakeExportBuildSettings.cmake 1.7 KB

123456789101112131415161718192021222324252627282930313233343536
  1. #=============================================================================
  2. # Copyright 2002-2009 Kitware, Inc.
  3. #
  4. # Distributed under the OSI-approved BSD License (the "License");
  5. # see accompanying file Copyright.txt for details.
  6. #
  7. # This software is distributed WITHOUT ANY WARRANTY; without even the
  8. # implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  9. # See the License for more information.
  10. #=============================================================================
  11. # (To distribute this file outside of CMake, substitute the full
  12. # License text for the above reference.)
  13. # This module is purposely no longer documented. It does nothing useful.
  14. if(NOT "${CMAKE_MINIMUM_REQUIRED_VERSION}" VERSION_LESS 2.7)
  15. message(FATAL_ERROR
  16. "The functionality of this module has been dropped as of CMake 2.8. "
  17. "It was deemed harmful (confusing users by changing their compiler). "
  18. "Please remove calls to the CMAKE_EXPORT_BUILD_SETTINGS macro and "
  19. "stop including this module. "
  20. "If this project generates any files for use by external projects, "
  21. "remove any use of the CMakeImportBuildSettings module from them.")
  22. endif()
  23. # This macro used to store build settings of a project in a file to be
  24. # loaded by another project using CMAKE_IMPORT_BUILD_SETTINGS. Now it
  25. # creates a file that refuses to load (with comment explaining why).
  26. macro(CMAKE_EXPORT_BUILD_SETTINGS SETTINGS_FILE)
  27. if(NOT ${SETTINGS_FILE} STREQUAL "")
  28. configure_file(${CMAKE_ROOT}/Modules/CMakeBuildSettings.cmake.in
  29. ${SETTINGS_FILE} @ONLY)
  30. else()
  31. message(SEND_ERROR "CMAKE_EXPORT_BUILD_SETTINGS called with no argument.")
  32. endif()
  33. endmacro()