CMakeBackwardCompatibilityC.cmake 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  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. # Nothing here yet
  14. IF(CMAKE_GENERATOR MATCHES "Visual Studio 7")
  15. INCLUDE(CMakeVS7BackwardCompatibility)
  16. SET(CMAKE_SKIP_COMPATIBILITY_TESTS 1)
  17. ENDIF(CMAKE_GENERATOR MATCHES "Visual Studio 7")
  18. IF(CMAKE_GENERATOR MATCHES "Visual Studio 6")
  19. INCLUDE(CMakeVS6BackwardCompatibility)
  20. SET(CMAKE_SKIP_COMPATIBILITY_TESTS 1)
  21. ENDIF(CMAKE_GENERATOR MATCHES "Visual Studio 6")
  22. IF(NOT CMAKE_SKIP_COMPATIBILITY_TESTS)
  23. INCLUDE (CheckTypeSize)
  24. CHECK_TYPE_SIZE(int CMAKE_SIZEOF_INT)
  25. CHECK_TYPE_SIZE(long CMAKE_SIZEOF_LONG)
  26. CHECK_TYPE_SIZE("void*" CMAKE_SIZEOF_VOID_P)
  27. CHECK_TYPE_SIZE(char CMAKE_SIZEOF_CHAR)
  28. CHECK_TYPE_SIZE(short CMAKE_SIZEOF_SHORT)
  29. CHECK_TYPE_SIZE(float CMAKE_SIZEOF_FLOAT)
  30. CHECK_TYPE_SIZE(double CMAKE_SIZEOF_DOUBLE)
  31. INCLUDE (CheckIncludeFile)
  32. CHECK_INCLUDE_FILE("limits.h" CMAKE_HAVE_LIMITS_H)
  33. CHECK_INCLUDE_FILE("unistd.h" CMAKE_HAVE_UNISTD_H)
  34. CHECK_INCLUDE_FILE("pthread.h" CMAKE_HAVE_PTHREAD_H)
  35. INCLUDE (CheckIncludeFiles)
  36. CHECK_INCLUDE_FILES("sys/types.h;sys/prctl.h" CMAKE_HAVE_SYS_PRCTL_H)
  37. INCLUDE (TestBigEndian)
  38. TEST_BIG_ENDIAN(CMAKE_WORDS_BIGENDIAN)
  39. INCLUDE (FindX11)
  40. IF("${X11_X11_INCLUDE_PATH}" MATCHES "^/usr/include$")
  41. SET (CMAKE_X_CFLAGS "" CACHE STRING "X11 extra flags.")
  42. ELSE("${X11_X11_INCLUDE_PATH}" MATCHES "^/usr/include$")
  43. SET (CMAKE_X_CFLAGS "-I${X11_X11_INCLUDE_PATH}" CACHE STRING
  44. "X11 extra flags.")
  45. ENDIF("${X11_X11_INCLUDE_PATH}" MATCHES "^/usr/include$")
  46. SET (CMAKE_X_LIBS "${X11_LIBRARIES}" CACHE STRING
  47. "Libraries and options used in X11 programs.")
  48. SET (CMAKE_HAS_X "${X11_FOUND}" CACHE INTERNAL "Is X11 around.")
  49. INCLUDE (FindThreads)
  50. SET (CMAKE_THREAD_LIBS "${CMAKE_THREAD_LIBS_INIT}" CACHE STRING
  51. "Thread library used.")
  52. SET (CMAKE_USE_PTHREADS "${CMAKE_USE_PTHREADS_INIT}" CACHE BOOL
  53. "Use the pthreads library.")
  54. SET (CMAKE_USE_WIN32_THREADS "${CMAKE_USE_WIN32_THREADS_INIT}" CACHE BOOL
  55. "Use the win32 thread library.")
  56. SET (CMAKE_HP_PTHREADS ${CMAKE_HP_PTHREADS_INIT} CACHE BOOL
  57. "Use HP pthreads.")
  58. SET (CMAKE_USE_SPROC ${CMAKE_USE_SPROC_INIT} CACHE BOOL
  59. "Use sproc libs.")
  60. ENDIF(NOT CMAKE_SKIP_COMPATIBILITY_TESTS)
  61. MARK_AS_ADVANCED(
  62. CMAKE_HP_PTHREADS
  63. CMAKE_THREAD_LIBS
  64. CMAKE_USE_PTHREADS
  65. CMAKE_USE_SPROC
  66. CMAKE_USE_WIN32_THREADS
  67. CMAKE_X_CFLAGS
  68. CMAKE_X_LIBS
  69. )