CMakeSystemSpecificInformation.cmake 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  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 file is included by cmGlobalGenerator::EnableLanguage.
  14. # It is included after the compiler has been determined, so
  15. # we know things like the compiler name and if the compiler is gnu.
  16. # before cmake 2.6 these variables were set in cmMakefile.cxx. This is still
  17. # done to keep scripts and custom language and compiler modules working.
  18. # But they are reset here and set again in the platform files for the target
  19. # platform, so they can be used for testing the target platform instead
  20. # of testing the host platform.
  21. set(APPLE )
  22. set(UNIX )
  23. set(CYGWIN )
  24. set(WIN32 )
  25. # include Generic system information
  26. include(CMakeGenericSystem)
  27. # 2. now include SystemName.cmake file to set the system specific information
  28. set(CMAKE_SYSTEM_INFO_FILE Platform/${CMAKE_SYSTEM_NAME})
  29. include(${CMAKE_SYSTEM_INFO_FILE} OPTIONAL RESULT_VARIABLE _INCLUDED_SYSTEM_INFO_FILE)
  30. if(NOT _INCLUDED_SYSTEM_INFO_FILE)
  31. message("System is unknown to cmake, create:\n${CMAKE_SYSTEM_INFO_FILE}"
  32. " to use this system, please send your config file to "
  33. "cmake@www.cmake.org so it can be added to cmake")
  34. if(EXISTS ${CMAKE_BINARY_DIR}/CMakeCache.txt)
  35. configure_file(${CMAKE_BINARY_DIR}/CMakeCache.txt
  36. ${CMAKE_BINARY_DIR}/CopyOfCMakeCache.txt COPYONLY)
  37. message("Your CMakeCache.txt file was copied to CopyOfCMakeCache.txt. "
  38. "Please send that file to cmake@www.cmake.org.")
  39. endif()
  40. endif()
  41. # optionally include a file which can do extra-generator specific things, e.g.
  42. # CMakeFindEclipseCDT4.cmake asks gcc for the system include dirs for the Eclipse CDT4 generator
  43. if(CMAKE_EXTRA_GENERATOR)
  44. string(REPLACE " " "" _CMAKE_EXTRA_GENERATOR_NO_SPACES ${CMAKE_EXTRA_GENERATOR} )
  45. include("CMakeFind${_CMAKE_EXTRA_GENERATOR_NO_SPACES}" OPTIONAL)
  46. endif()
  47. # for most systems a module is the same as a shared library
  48. # so unless the variable CMAKE_MODULE_EXISTS is set just
  49. # copy the values from the LIBRARY variables
  50. # this has to be done after the system information has been loaded
  51. if(NOT CMAKE_MODULE_EXISTS)
  52. set(CMAKE_SHARED_MODULE_PREFIX "${CMAKE_SHARED_LIBRARY_PREFIX}")
  53. set(CMAKE_SHARED_MODULE_SUFFIX "${CMAKE_SHARED_LIBRARY_SUFFIX}")
  54. endif()
  55. set(CMAKE_SYSTEM_SPECIFIC_INFORMATION_LOADED 1)