CMakeSystemSpecificInformation.cmake 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. # This file is included by cmGlobalGenerator::EnableLanguage.
  2. # It is included after the compiler has been determined, so
  3. # we know things like the compiler name and if the compiler is gnu.
  4. # before cmake 2.6 these variables were set in cmMakefile.cxx. This is still
  5. # done to keep scripts and custom language and compiler modules working.
  6. # But they are reset here and set again in the platform files for the target
  7. # platform, so they can be used for testing the target platform instead
  8. # of testing the host platform.
  9. SET(APPLE )
  10. SET(UNIX )
  11. SET(CYGWIN )
  12. SET(WIN32 )
  13. # include Generic system information
  14. INCLUDE(CMakeGenericSystem)
  15. # 2. now include SystemName.cmake file to set the system specific information
  16. SET(CMAKE_SYSTEM_INFO_FILE Platform/${CMAKE_SYSTEM_NAME})
  17. INCLUDE(${CMAKE_SYSTEM_INFO_FILE} OPTIONAL RESULT_VARIABLE _INCLUDED_SYSTEM_INFO_FILE)
  18. IF(NOT _INCLUDED_SYSTEM_INFO_FILE)
  19. MESSAGE("System is unknown to cmake, create:\n${CMAKE_SYSTEM_INFO_FILE}"
  20. " to use this system, please send your config file to "
  21. "[email protected] so it can be added to cmake")
  22. IF(EXISTS ${CMAKE_BINARY_DIR}/CMakeCache.txt)
  23. CONFIGURE_FILE(${CMAKE_BINARY_DIR}/CMakeCache.txt
  24. ${CMAKE_BINARY_DIR}/CopyOfCMakeCache.txt COPYONLY)
  25. MESSAGE("Your CMakeCache.txt file was copied to CopyOfCMakeCache.txt. "
  26. "Please send that file to [email protected].")
  27. ENDIF(EXISTS ${CMAKE_BINARY_DIR}/CMakeCache.txt)
  28. ENDIF(NOT _INCLUDED_SYSTEM_INFO_FILE)
  29. # optionally include a file which can do extra-generator specific things, e.g.
  30. # CMakeEclipseCDT4.cmake asks gcc for the system include dirs for the Eclipse CDT4 generator
  31. IF(CMAKE_EXTRA_GENERATOR)
  32. STRING(REPLACE " " "" _CMAKE_EXTRA_GENERATOR_NO_SPACES ${CMAKE_EXTRA_GENERATOR} )
  33. INCLUDE("CMake${_CMAKE_EXTRA_GENERATOR_NO_SPACES}" OPTIONAL)
  34. ENDIF(CMAKE_EXTRA_GENERATOR)
  35. # for most systems a module is the same as a shared library
  36. # so unless the variable CMAKE_MODULE_EXISTS is set just
  37. # copy the values from the LIBRARY variables
  38. # this has to be done after the system information has been loaded
  39. IF(NOT CMAKE_MODULE_EXISTS)
  40. SET(CMAKE_SHARED_MODULE_PREFIX "${CMAKE_SHARED_LIBRARY_PREFIX}")
  41. SET(CMAKE_SHARED_MODULE_SUFFIX "${CMAKE_SHARED_LIBRARY_SUFFIX}")
  42. SET(CMAKE_SHARED_MODULE_RUNTIME_C_FLAG ${CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG})
  43. SET(CMAKE_SHARED_MODULE_RUNTIME_C_FLAG_SEP ${CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG_SEP})
  44. ENDIF(NOT CMAKE_MODULE_EXISTS)
  45. SET(CMAKE_SYSTEM_SPECIFIC_INFORMATION_LOADED 1)