Mercurial > hg > orthanc
annotate Resources/CMake/LibCurlConfiguration.cmake @ 1537:fbf763bb1fa3
error detection in patches
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Thu, 13 Aug 2015 15:25:38 +0200 |
parents | 1b03676d68c2 |
children | 4d0e2c38d15b |
rev | line source |
---|---|
735 | 1 if (STATIC_BUILD OR NOT USE_SYSTEM_CURL) |
1527
7b58e0048874
Upgrade to curl 7.44.0 for static and Windows builds
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1415
diff
changeset
|
2 SET(CURL_SOURCES_DIR ${CMAKE_BINARY_DIR}/curl-7.44.0) |
1537
fbf763bb1fa3
error detection in patches
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1536
diff
changeset
|
3 SET(CURL_URL "http://www.montefiore.ulg.ac.be/~jodogne/Orthanc/ThirdPartyDownloads/curl-7.44.0.tar.gz") |
fbf763bb1fa3
error detection in patches
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1536
diff
changeset
|
4 SET(CURL_MD5 "cf46112b5151e2f1a3fd38439bdade23") |
fbf763bb1fa3
error detection in patches
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1536
diff
changeset
|
5 |
fbf763bb1fa3
error detection in patches
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1536
diff
changeset
|
6 DownloadPackage(${CURL_MD5} ${CURL_URL} "${CURL_SOURCES_DIR}") |
735 | 7 |
1527
7b58e0048874
Upgrade to curl 7.44.0 for static and Windows builds
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1415
diff
changeset
|
8 include_directories( |
7b58e0048874
Upgrade to curl 7.44.0 for static and Windows builds
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1415
diff
changeset
|
9 ${CURL_SOURCES_DIR}/include |
7b58e0048874
Upgrade to curl 7.44.0 for static and Windows builds
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1415
diff
changeset
|
10 ) |
7b58e0048874
Upgrade to curl 7.44.0 for static and Windows builds
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1415
diff
changeset
|
11 |
735 | 12 AUX_SOURCE_DIRECTORY(${CURL_SOURCES_DIR}/lib CURL_SOURCES) |
1527
7b58e0048874
Upgrade to curl 7.44.0 for static and Windows builds
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1415
diff
changeset
|
13 AUX_SOURCE_DIRECTORY(${CURL_SOURCES_DIR}/lib/vtls CURL_SOURCES) |
735 | 14 source_group(ThirdParty\\LibCurl REGULAR_EXPRESSION ${CURL_SOURCES_DIR}/.*) |
15 | |
16 add_definitions( | |
1536 | 17 -DBUILDING_LIBCURL=1 |
735 | 18 -DCURL_STATICLIB=1 |
19 -DCURL_DISABLE_LDAPS=1 | |
20 -DCURL_DISABLE_LDAP=1 | |
21 -DCURL_DISABLE_DICT=1 | |
22 -DCURL_DISABLE_FILE=1 | |
23 -DCURL_DISABLE_FTP=1 | |
24 -DCURL_DISABLE_GOPHER=1 | |
25 -DCURL_DISABLE_LDAP=1 | |
26 -DCURL_DISABLE_LDAPS=1 | |
27 -DCURL_DISABLE_POP3=1 | |
1273
88010d8e12cf
Support of HTTP proxy
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
930
diff
changeset
|
28 #-DCURL_DISABLE_PROXY=1 |
735 | 29 -DCURL_DISABLE_RTSP=1 |
30 -DCURL_DISABLE_TELNET=1 | |
31 -DCURL_DISABLE_TFTP=1 | |
32 ) | |
33 | |
1536 | 34 if (${CMAKE_SYSTEM_NAME} STREQUAL "Windows") |
35 add_definitions(-D_WIN32_WINNT=0x0501) | |
36 endif() | |
37 | |
1415 | 38 if (ENABLE_SSL) |
735 | 39 add_definitions( |
40 #-DHAVE_LIBSSL=1 | |
41 -DUSE_OPENSSL=1 | |
42 -DUSE_SSLEAY=1 | |
43 ) | |
44 endif() | |
45 | |
1533
0011cc99443c
improving HTTPS support
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1532
diff
changeset
|
46 file(WRITE ${CURL_SOURCES_DIR}/lib/curl_config.h "") |
0011cc99443c
improving HTTPS support
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1532
diff
changeset
|
47 |
1536 | 48 file(GLOB CURL_LIBS_HEADERS ${CURL_SOURCES_DIR}/lib/*.h) |
49 foreach (header IN LISTS CURL_LIBS_HEADERS) | |
50 get_filename_component(filename ${header} NAME) | |
51 file(WRITE ${CURL_SOURCES_DIR}/lib/vtls/${filename} "#include \"../${filename}\"\n") | |
52 endforeach() | |
53 | |
1532 | 54 if (MSVC) |
1536 | 55 add_definitions(-DHAVE_BOOL_T=1) |
1531 | 56 |
57 elseif (${CMAKE_SYSTEM_NAME} STREQUAL "Linux" OR | |
930 | 58 ${CMAKE_SYSTEM_NAME} STREQUAL "Darwin" OR |
1337 | 59 ${CMAKE_SYSTEM_NAME} STREQUAL "FreeBSD" OR |
890 | 60 ${CMAKE_SYSTEM_NAME} STREQUAL "kFreeBSD") |
735 | 61 if ("${CMAKE_SIZEOF_VOID_P}" EQUAL "8") |
62 SET(TMP_OS "x86_64") | |
63 else() | |
64 SET(TMP_OS "x86") | |
65 endif() | |
66 | |
67 set_property( | |
68 SOURCE ${CURL_SOURCES} | |
1531 | 69 PROPERTY COMPILE_DEFINITIONS "HAVE_TIME_H;HAVE_STRUCT_TIMEVAL;HAVE_SYS_STAT_H;HAVE_SOCKET;HAVE_STRUCT_SOCKADDR_STORAGE;HAVE_SYS_SOCKET_H;HAVE_SOCKET;HAVE_SYS_SOCKET_H;HAVE_NETINET_IN_H;HAVE_NETDB_H;HAVE_FCNTL_O_NONBLOCK;HAVE_FCNTL_H;HAVE_SELECT;HAVE_ERRNO_H;HAVE_SEND;HAVE_RECV;HAVE_LONGLONG;OS=\"${TMP_OS}\"" |
1527
7b58e0048874
Upgrade to curl 7.44.0 for static and Windows builds
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1415
diff
changeset
|
70 ) |
7b58e0048874
Upgrade to curl 7.44.0 for static and Windows builds
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1415
diff
changeset
|
71 |
735 | 72 if ("${CMAKE_SIZEOF_VOID_P}" EQUAL "8") |
73 add_definitions( | |
74 -DRECV_TYPE_ARG1=int | |
75 -DRECV_TYPE_ARG2=void* | |
76 -DRECV_TYPE_ARG3=size_t | |
77 -DRECV_TYPE_ARG4=int | |
78 -DRECV_TYPE_RETV=ssize_t | |
79 -DSEND_TYPE_ARG1=int | |
80 -DSEND_TYPE_ARG2=void* | |
81 -DSEND_QUAL_ARG2=const | |
82 -DSEND_TYPE_ARG3=size_t | |
83 -DSEND_TYPE_ARG4=int | |
84 -DSEND_TYPE_RETV=ssize_t | |
85 -DSIZEOF_SHORT=2 | |
86 -DSIZEOF_INT=4 | |
87 -DSIZEOF_SIZE_T=8 | |
88 ) | |
89 elseif ("${CMAKE_SIZEOF_VOID_P}" EQUAL "4") | |
90 add_definitions( | |
91 -DRECV_TYPE_ARG1=int | |
92 -DRECV_TYPE_ARG2=void* | |
93 -DRECV_TYPE_ARG3=size_t | |
94 -DRECV_TYPE_ARG4=int | |
95 -DRECV_TYPE_RETV=int | |
96 -DSEND_TYPE_ARG1=int | |
97 -DSEND_TYPE_ARG2=void* | |
98 -DSEND_QUAL_ARG2=const | |
99 -DSEND_TYPE_ARG3=size_t | |
100 -DSEND_TYPE_ARG4=int | |
101 -DSEND_TYPE_RETV=int | |
102 -DSIZEOF_SHORT=2 | |
103 -DSIZEOF_INT=4 | |
104 -DSIZEOF_SIZE_T=4 | |
105 ) | |
106 else() | |
107 message(FATAL_ERROR "Support your platform here") | |
108 endif() | |
109 endif() | |
110 | |
111 else() | |
112 include(FindCURL) | |
113 include_directories(${CURL_INCLUDE_DIRS}) | |
114 link_libraries(${CURL_LIBRARIES}) | |
115 | |
116 if (NOT ${CURL_FOUND}) | |
117 message(FATAL_ERROR "Unable to find LibCurl") | |
118 endif() | |
119 endif() |