2 #=============================================================================
3 # Copyright 2002-2009 Kitware, Inc.
5 # Distributed under the OSI-approved BSD License (the "License");
6 # see accompanying file Copyright.txt for details.
8 # This software is distributed WITHOUT ANY WARRANTY; without even the
9 # implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
10 # See the License for more information.
11 #=============================================================================
12 # (To distribute this file outside of CMake, substitute the full
13 # License text for the above reference.)
16 if(CMAKE_GENERATOR MATCHES "Visual Studio 7")
17 include(CMakeVS7BackwardCompatibility)
18 set(CMAKE_SKIP_COMPATIBILITY_TESTS 1)
20 if(CMAKE_GENERATOR MATCHES "Visual Studio 6")
21 include(CMakeVS6BackwardCompatibility)
22 set(CMAKE_SKIP_COMPATIBILITY_TESTS 1)
25 if(NOT CMAKE_SKIP_COMPATIBILITY_TESTS)
26 # Old CMake versions did not support OS X universal binaries anyway,
27 # so just get through this with at least some size for the types.
28 list(LENGTH CMAKE_OSX_ARCHITECTURES NUM_ARCHS)
29 if(${NUM_ARCHS} GREATER 1)
30 if(NOT DEFINED CMAKE_TRY_COMPILE_OSX_ARCHITECTURES)
31 message(WARNING "This module does not work with OS X universal binaries.")
32 set(__ERASE_CMAKE_TRY_COMPILE_OSX_ARCHITECTURES 1)
33 list(GET CMAKE_OSX_ARCHITECTURES 0 CMAKE_TRY_COMPILE_OSX_ARCHITECTURES)
37 include (CheckTypeSize)
38 CHECK_TYPE_SIZE(int CMAKE_SIZEOF_INT)
39 CHECK_TYPE_SIZE(long CMAKE_SIZEOF_LONG)
40 CHECK_TYPE_SIZE("void*" CMAKE_SIZEOF_VOID_P)
41 CHECK_TYPE_SIZE(char CMAKE_SIZEOF_CHAR)
42 CHECK_TYPE_SIZE(short CMAKE_SIZEOF_SHORT)
43 CHECK_TYPE_SIZE(float CMAKE_SIZEOF_FLOAT)
44 CHECK_TYPE_SIZE(double CMAKE_SIZEOF_DOUBLE)
46 include (CheckIncludeFile)
47 CHECK_INCLUDE_FILE("limits.h" CMAKE_HAVE_LIMITS_H)
48 CHECK_INCLUDE_FILE("unistd.h" CMAKE_HAVE_UNISTD_H)
49 CHECK_INCLUDE_FILE("pthread.h" CMAKE_HAVE_PTHREAD_H)
51 include (CheckIncludeFiles)
52 CHECK_INCLUDE_FILES("sys/types.h;sys/prctl.h" CMAKE_HAVE_SYS_PRCTL_H)
54 include (TestBigEndian)
55 TEST_BIG_ENDIAN(CMAKE_WORDS_BIGENDIAN)
58 if("${X11_X11_INCLUDE_PATH}" MATCHES "^/usr/include$")
59 set (CMAKE_X_CFLAGS "" CACHE STRING "X11 extra flags.")
61 set (CMAKE_X_CFLAGS "-I${X11_X11_INCLUDE_PATH}" CACHE STRING
64 set (CMAKE_X_LIBS "${X11_LIBRARIES}" CACHE STRING
65 "Libraries and options used in X11 programs.")
66 set (CMAKE_HAS_X "${X11_FOUND}" CACHE INTERNAL "Is X11 around.")
70 set (CMAKE_THREAD_LIBS "${CMAKE_THREAD_LIBS_INIT}" CACHE STRING
71 "Thread library used.")
73 set (CMAKE_USE_PTHREADS "${CMAKE_USE_PTHREADS_INIT}" CACHE BOOL
74 "Use the pthreads library.")
76 set (CMAKE_USE_WIN32_THREADS "${CMAKE_USE_WIN32_THREADS_INIT}" CACHE BOOL
77 "Use the win32 thread library.")
79 set (CMAKE_HP_PTHREADS ${CMAKE_HP_PTHREADS_INIT} CACHE BOOL
82 set (CMAKE_USE_SPROC ${CMAKE_USE_SPROC_INIT} CACHE BOOL
85 if(__ERASE_CMAKE_TRY_COMPILE_OSX_ARCHITECTURES)
86 set(CMAKE_TRY_COMPILE_OSX_ARCHITECTURES)
87 set(__ERASE_CMAKE_TRY_COMPILE_OSX_ARCHITECTURES)
96 CMAKE_USE_WIN32_THREADS