CMakeSystemSpecificInformation.cmake 3.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  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 distributed 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. "[email protected] 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 [email protected].")
  39. ENDIF(EXISTS ${CMAKE_BINARY_DIR}/CMakeCache.txt)
  40. ENDIF(NOT _INCLUDED_SYSTEM_INFO_FILE)
  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(CMAKE_EXTRA_GENERATOR)
  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. SET(CMAKE_SHARED_MODULE_RUNTIME_C_FLAG ${CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG})
  55. SET(CMAKE_SHARED_MODULE_RUNTIME_C_FLAG_SEP ${CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG_SEP})
  56. ENDIF(NOT CMAKE_MODULE_EXISTS)
  57. SET(CMAKE_SYSTEM_SPECIFIC_INFORMATION_LOADED 1)