From 651c0bcdf27c484ebd6d637947157424aaa46ab7 Mon Sep 17 00:00:00 2001 From: Brad King Date: Wed, 5 Jan 2011 17:32:41 +0100 Subject: 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 --- CMakeLists.txt | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'CMakeLists.txt') 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") -- cgit v1.2.3