2005-12-14 18:51:08 +00:00
|
|
|
|
2009-09-28 15:46:51 +00:00
|
|
|
#=============================================================================
|
|
|
|
# Copyright 2002-2009 Kitware, Inc.
|
|
|
|
#
|
|
|
|
# Distributed under the OSI-approved BSD License (the "License");
|
|
|
|
# see accompanying file Copyright.txt for details.
|
|
|
|
#
|
|
|
|
# This software is distributed WITHOUT ANY WARRANTY; without even the
|
|
|
|
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
|
|
# See the License for more information.
|
|
|
|
#=============================================================================
|
2010-08-07 00:48:47 +00:00
|
|
|
# (To distribute this file outside of CMake, substitute the full
|
2009-09-28 15:46:51 +00:00
|
|
|
# License text for the above reference.)
|
|
|
|
|
2002-09-24 21:58:38 +00:00
|
|
|
# Nothing here yet
|
2012-08-13 17:47:32 +00:00
|
|
|
if(CMAKE_GENERATOR MATCHES "Visual Studio 7")
|
|
|
|
include(CMakeVS7BackwardCompatibility)
|
|
|
|
set(CMAKE_SKIP_COMPATIBILITY_TESTS 1)
|
2012-08-13 17:50:14 +00:00
|
|
|
endif()
|
2012-08-13 17:47:32 +00:00
|
|
|
|
|
|
|
if(NOT CMAKE_SKIP_COMPATIBILITY_TESTS)
|
2009-12-01 22:35:39 +00:00
|
|
|
# Old CMake versions did not support OS X universal binaries anyway,
|
|
|
|
# so just get through this with at least some size for the types.
|
2012-08-13 17:47:32 +00:00
|
|
|
list(LENGTH CMAKE_OSX_ARCHITECTURES NUM_ARCHS)
|
|
|
|
if(${NUM_ARCHS} GREATER 1)
|
|
|
|
if(NOT DEFINED CMAKE_TRY_COMPILE_OSX_ARCHITECTURES)
|
|
|
|
message(WARNING "This module does not work with OS X universal binaries.")
|
|
|
|
set(__ERASE_CMAKE_TRY_COMPILE_OSX_ARCHITECTURES 1)
|
|
|
|
list(GET CMAKE_OSX_ARCHITECTURES 0 CMAKE_TRY_COMPILE_OSX_ARCHITECTURES)
|
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
|
|
|
|
include (CheckTypeSize)
|
2002-12-05 18:44:11 +00:00
|
|
|
CHECK_TYPE_SIZE(int CMAKE_SIZEOF_INT)
|
|
|
|
CHECK_TYPE_SIZE(long CMAKE_SIZEOF_LONG)
|
|
|
|
CHECK_TYPE_SIZE("void*" CMAKE_SIZEOF_VOID_P)
|
|
|
|
CHECK_TYPE_SIZE(char CMAKE_SIZEOF_CHAR)
|
|
|
|
CHECK_TYPE_SIZE(short CMAKE_SIZEOF_SHORT)
|
|
|
|
CHECK_TYPE_SIZE(float CMAKE_SIZEOF_FLOAT)
|
|
|
|
CHECK_TYPE_SIZE(double CMAKE_SIZEOF_DOUBLE)
|
|
|
|
|
2012-08-13 17:47:32 +00:00
|
|
|
include (CheckIncludeFile)
|
2002-12-05 18:44:11 +00:00
|
|
|
CHECK_INCLUDE_FILE("limits.h" CMAKE_HAVE_LIMITS_H)
|
|
|
|
CHECK_INCLUDE_FILE("unistd.h" CMAKE_HAVE_UNISTD_H)
|
|
|
|
CHECK_INCLUDE_FILE("pthread.h" CMAKE_HAVE_PTHREAD_H)
|
|
|
|
|
2012-08-13 17:47:32 +00:00
|
|
|
include (CheckIncludeFiles)
|
2005-04-26 21:11:48 +00:00
|
|
|
CHECK_INCLUDE_FILES("sys/types.h;sys/prctl.h" CMAKE_HAVE_SYS_PRCTL_H)
|
|
|
|
|
2012-08-13 17:47:32 +00:00
|
|
|
include (TestBigEndian)
|
2002-12-05 18:44:11 +00:00
|
|
|
TEST_BIG_ENDIAN(CMAKE_WORDS_BIGENDIAN)
|
2012-08-13 17:47:32 +00:00
|
|
|
include (FindX11)
|
2002-12-17 16:55:54 +00:00
|
|
|
|
2013-06-02 19:42:10 +00:00
|
|
|
if("${X11_X11_INCLUDE_PATH}" STREQUAL "/usr/include")
|
2012-08-13 17:47:32 +00:00
|
|
|
set (CMAKE_X_CFLAGS "" CACHE STRING "X11 extra flags.")
|
2012-08-13 17:50:14 +00:00
|
|
|
else()
|
2012-08-13 17:47:32 +00:00
|
|
|
set (CMAKE_X_CFLAGS "-I${X11_X11_INCLUDE_PATH}" CACHE STRING
|
2003-01-02 14:57:59 +00:00
|
|
|
"X11 extra flags.")
|
2012-08-13 17:50:14 +00:00
|
|
|
endif()
|
2012-08-13 17:47:32 +00:00
|
|
|
set (CMAKE_X_LIBS "${X11_LIBRARIES}" CACHE STRING
|
2002-12-17 16:55:54 +00:00
|
|
|
"Libraries and options used in X11 programs.")
|
2012-08-13 17:47:32 +00:00
|
|
|
set (CMAKE_HAS_X "${X11_FOUND}" CACHE INTERNAL "Is X11 around.")
|
2002-12-17 16:55:54 +00:00
|
|
|
|
2012-08-13 17:47:32 +00:00
|
|
|
include (FindThreads)
|
2002-12-05 18:44:11 +00:00
|
|
|
|
2012-08-13 17:47:32 +00:00
|
|
|
set (CMAKE_THREAD_LIBS "${CMAKE_THREAD_LIBS_INIT}" CACHE STRING
|
2002-11-12 19:19:13 +00:00
|
|
|
"Thread library used.")
|
|
|
|
|
2012-08-13 17:47:32 +00:00
|
|
|
set (CMAKE_USE_PTHREADS "${CMAKE_USE_PTHREADS_INIT}" CACHE BOOL
|
2002-11-12 19:19:13 +00:00
|
|
|
"Use the pthreads library.")
|
|
|
|
|
2012-08-13 17:47:32 +00:00
|
|
|
set (CMAKE_USE_WIN32_THREADS "${CMAKE_USE_WIN32_THREADS_INIT}" CACHE BOOL
|
2002-11-12 19:19:13 +00:00
|
|
|
"Use the win32 thread library.")
|
|
|
|
|
2012-08-13 17:47:32 +00:00
|
|
|
set (CMAKE_HP_PTHREADS ${CMAKE_HP_PTHREADS_INIT} CACHE BOOL
|
2002-11-12 19:19:13 +00:00
|
|
|
"Use HP pthreads.")
|
|
|
|
|
2012-08-13 17:47:32 +00:00
|
|
|
set (CMAKE_USE_SPROC ${CMAKE_USE_SPROC_INIT} CACHE BOOL
|
2002-11-12 19:19:13 +00:00
|
|
|
"Use sproc libs.")
|
2009-12-01 22:35:39 +00:00
|
|
|
|
2012-08-13 17:47:32 +00:00
|
|
|
if(__ERASE_CMAKE_TRY_COMPILE_OSX_ARCHITECTURES)
|
|
|
|
set(CMAKE_TRY_COMPILE_OSX_ARCHITECTURES)
|
|
|
|
set(__ERASE_CMAKE_TRY_COMPILE_OSX_ARCHITECTURES)
|
|
|
|
endif()
|
2012-08-13 17:50:14 +00:00
|
|
|
endif()
|
2002-11-12 19:19:13 +00:00
|
|
|
|
2012-08-13 17:47:32 +00:00
|
|
|
mark_as_advanced(
|
2002-12-20 16:56:08 +00:00
|
|
|
CMAKE_HP_PTHREADS
|
2002-11-12 19:19:13 +00:00
|
|
|
CMAKE_THREAD_LIBS
|
|
|
|
CMAKE_USE_PTHREADS
|
|
|
|
CMAKE_USE_SPROC
|
2002-12-20 16:56:08 +00:00
|
|
|
CMAKE_USE_WIN32_THREADS
|
|
|
|
CMAKE_X_CFLAGS
|
|
|
|
CMAKE_X_LIBS
|
|
|
|
)
|
2002-11-12 19:19:13 +00:00
|
|
|
|