summaryrefslogtreecommitdiffstats
path: root/Utilities/cmcurl/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'Utilities/cmcurl/CMakeLists.txt')
-rw-r--r--Utilities/cmcurl/CMakeLists.txt38
1 files changed, 29 insertions, 9 deletions
diff --git a/Utilities/cmcurl/CMakeLists.txt b/Utilities/cmcurl/CMakeLists.txt
index 8e7b380..d7ff9aa 100644
--- a/Utilities/cmcurl/CMakeLists.txt
+++ b/Utilities/cmcurl/CMakeLists.txt
@@ -2,6 +2,9 @@ CMAKE_MINIMUM_REQUIRED(VERSION 2.4)
IF(COMMAND CMAKE_POLICY)
CMAKE_POLICY(SET CMP0003 NEW)
ENDIF(COMMAND CMAKE_POLICY)
+IF(CMAKE_OSX_ARCHITECTURES)
+ CMAKE_MINIMUM_REQUIRED(VERSION 2.6.3 FATAL_ERROR)
+ENDIF(CMAKE_OSX_ARCHITECTURES)
PROJECT(LIBCURL C)
# Setup package meta-data
@@ -36,7 +39,12 @@ INCLUDE (CheckIncludeFile)
INCLUDE (CheckIncludeFiles)
INCLUDE (CheckLibraryExists)
INCLUDE (CheckSymbolExists)
-INCLUDE (CheckTypeSize)
+IF(${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} GREATER 2.4
+ AND CMake_SOURCE_DIR)
+ INCLUDE (${CMake_SOURCE_DIR}/Modules/CheckTypeSize.cmake)
+ELSE()
+ INCLUDE (CheckTypeSize)
+ENDIF()
SET(libCurl_SRCS
# amigaos.c - does not build on AmigaOS
@@ -329,14 +337,6 @@ CHECK_TYPE_SIZE("long long" SIZEOF_LONG_LONG)
CHECK_TYPE_SIZE("long" SIZEOF_LONG)
CHECK_TYPE_SIZE("__int64" SIZEOF___INT64)
CHECK_TYPE_SIZE("time_t" SIZEOF_TIME_T)
-IF(NOT HAVE_SIZEOF_SSIZE_T)
- IF(SIZEOF_LONG EQUAL SIZEOF_SIZE_T)
- SET(ssize_t long)
- ENDIF(SIZEOF_LONG EQUAL SIZEOF_SIZE_T)
- IF(NOT ssize_t AND SIZEOF___INT64 EQUAL SIZEOF_SIZE_T)
- SET(ssize_t __int64)
- ENDIF(NOT ssize_t AND SIZEOF___INT64 EQUAL SIZEOF_SIZE_T)
-ENDIF(NOT HAVE_SIZEOF_SSIZE_T)
IF(HAVE_SIZEOF_LONG_LONG)
SET(HAVE_LONGLONG 1)
@@ -723,6 +723,26 @@ ELSE(CMAKE_BUILD_CURL_SHARED)
-DCURL_STATICLIB)
ENDIF(CMAKE_BUILD_CURL_SHARED)
SET(CURL_STATICLIB)
+
+# Support CheckTypeSize module from CMake 2.8.0 and lower.
+FOREACH(var
+ SIZEOF_CURL_OFF_T
+ SIZEOF_LONG
+ SIZEOF_LONG_LONG
+ SIZEOF___INT64
+ SIZEOF_SIZE_T
+ SIZEOF_TIME_T
+ )
+ IF(NOT ${var}_CODE)
+ MESSAGE("creating ${var}_CODE")
+ IF(${var})
+ SET(${var}_CODE "#define ${var} ${${var}}")
+ ELSE()
+ SET(${var}_CODE "/* #undef ${var} */")
+ ENDIF()
+ ENDIF()
+ENDFOREACH()
+
CONFIGURE_FILE(${LIBCURL_SOURCE_DIR}/config.h.in
${LIBCURL_BINARY_DIR}/config.h)