aboutsummaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2011-01-05 17:32:41 +0100
committerDaniel Stenberg <daniel@haxx.se>2011-01-06 00:06:29 +0100
commit651c0bcdf27c484ebd6d637947157424aaa46ab7 (patch)
treee58a2a65917f63c82228d87364b82d3a479c658e /CMakeLists.txt
parentd45ed0ecf5a92b35868b46943871dfa4ec14c7a2 (diff)
CMake: Use upstream CheckTypeSize module
The CheckTypeSize module that comes with CMake 2.6.2 and above does everything we need and also supports cross-compiling. Avoid duplicating an older version of it here. This also fixes a cross-compiling error because the old line include ("${CMAKE_MODULE_PATH}/CheckTypeSize.cmake") failed because CMAKE_MODULE_PATH is a search path and not a directory. Signed-off-by: Brad King <brad.king@kitware.com>
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt14
1 files changed, 7 insertions, 7 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 244085b02..55312ccba 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -183,13 +183,7 @@ include (CheckIncludeFile)
include (CheckIncludeFiles)
include (CheckLibraryExists)
include (CheckSymbolExists)
-# if crosscompiling is on, the CHECK_TYPE_SIZE macro coming with cmake uses
-# TRY_COMPILE instead of TRY_RUN which makes crosscompiling easier, Alex
-if(CMAKE_CROSSCOMPILING)
- include ("${CMAKE_MODULE_PATH}/CheckTypeSize.cmake")
-else(CMAKE_CROSSCOMPILING)
- include (CheckTypeSize)
-endif(CMAKE_CROSSCOMPILING)
+include (CheckTypeSize)
# On windows preload settings
if(WIN32)
@@ -781,7 +775,13 @@ endif(CMAKE_COMPILER_IS_GNUCC AND APPLE)
if(HAVE_SOCKLEN_T)
set(CURL_TYPEOF_CURL_SOCKLEN_T "socklen_t")
+ if(WIN32)
+ set(CMAKE_EXTRA_INCLUDE_FILES "winsock2.h;ws2tcpip.h")
+ elseif(HAVE_SYS_SOCKET_H)
+ set(CMAKE_EXTRA_INCLUDE_FILES "sys/socket.h")
+ endif()
check_type_size("socklen_t" CURL_SIZEOF_CURL_SOCKLEN_T)
+ set(CMAKE_EXTRA_INCLUDE_FILES)
if(NOT HAVE_CURL_SIZEOF_CURL_SOCKLEN_T)
message(FATAL_ERROR
"Check for sizeof socklen_t failed, see CMakeFiles/CMakerror.log")