Mercurial > hg > orthanc
annotate Resources/CMake/LibCurlConfiguration.cmake @ 1532:b5eb5210af91
fix
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Wed, 12 Aug 2015 15:04:12 +0200 |
parents | 31b3a540f508 |
children | 0011cc99443c |
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) |
735 | 3 DownloadPackage( |
1527
7b58e0048874
Upgrade to curl 7.44.0 for static and Windows builds
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1415
diff
changeset
|
4 "cf46112b5151e2f1a3fd38439bdade23" |
7b58e0048874
Upgrade to curl 7.44.0 for static and Windows builds
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1415
diff
changeset
|
5 "http://www.montefiore.ulg.ac.be/~jodogne/Orthanc/ThirdPartyDownloads/curl-7.44.0.tar.gz" |
735 | 6 "${CURL_SOURCES_DIR}") |
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 |
1529 | 10 ${CURL_SOURCES_DIR}/lib |
1527
7b58e0048874
Upgrade to curl 7.44.0 for static and Windows builds
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1415
diff
changeset
|
11 ) |
7b58e0048874
Upgrade to curl 7.44.0 for static and Windows builds
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1415
diff
changeset
|
12 |
735 | 13 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
|
14 AUX_SOURCE_DIRECTORY(${CURL_SOURCES_DIR}/lib/vtls CURL_SOURCES) |
735 | 15 source_group(ThirdParty\\LibCurl REGULAR_EXPRESSION ${CURL_SOURCES_DIR}/.*) |
16 | |
17 add_definitions( | |
18 -DCURL_STATICLIB=1 | |
19 -DBUILDING_LIBCURL=1 | |
20 -DCURL_DISABLE_LDAPS=1 | |
21 -DCURL_DISABLE_LDAP=1 | |
22 -D_WIN32_WINNT=0x0501 | |
23 | |
24 -DCURL_DISABLE_DICT=1 | |
25 -DCURL_DISABLE_FILE=1 | |
26 -DCURL_DISABLE_FTP=1 | |
27 -DCURL_DISABLE_GOPHER=1 | |
28 -DCURL_DISABLE_LDAP=1 | |
29 -DCURL_DISABLE_LDAPS=1 | |
30 -DCURL_DISABLE_POP3=1 | |
1273
88010d8e12cf
Support of HTTP proxy
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
930
diff
changeset
|
31 #-DCURL_DISABLE_PROXY=1 |
735 | 32 -DCURL_DISABLE_RTSP=1 |
33 -DCURL_DISABLE_TELNET=1 | |
34 -DCURL_DISABLE_TFTP=1 | |
35 ) | |
36 | |
1415 | 37 if (ENABLE_SSL) |
735 | 38 add_definitions( |
39 #-DHAVE_LIBSSL=1 | |
40 -DUSE_OPENSSL=1 | |
41 -DUSE_SSLEAY=1 | |
42 ) | |
43 endif() | |
44 | |
1532 | 45 if (MSVC) |
46 #add_definitions( | |
47 # -DHAVE_BOOL_T=1 | |
48 # ) | |
1531 | 49 |
50 elseif (${CMAKE_SYSTEM_NAME} STREQUAL "Linux" OR | |
930 | 51 ${CMAKE_SYSTEM_NAME} STREQUAL "Darwin" OR |
1337 | 52 ${CMAKE_SYSTEM_NAME} STREQUAL "FreeBSD" OR |
890 | 53 ${CMAKE_SYSTEM_NAME} STREQUAL "kFreeBSD") |
735 | 54 if ("${CMAKE_SIZEOF_VOID_P}" EQUAL "8") |
55 SET(TMP_OS "x86_64") | |
56 else() | |
57 SET(TMP_OS "x86") | |
58 endif() | |
59 | |
60 set_property( | |
61 SOURCE ${CURL_SOURCES} | |
1531 | 62 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
|
63 ) |
7b58e0048874
Upgrade to curl 7.44.0 for static and Windows builds
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1415
diff
changeset
|
64 |
735 | 65 if ("${CMAKE_SIZEOF_VOID_P}" EQUAL "8") |
66 add_definitions( | |
67 -DRECV_TYPE_ARG1=int | |
68 -DRECV_TYPE_ARG2=void* | |
69 -DRECV_TYPE_ARG3=size_t | |
70 -DRECV_TYPE_ARG4=int | |
71 -DRECV_TYPE_RETV=ssize_t | |
72 -DSEND_TYPE_ARG1=int | |
73 -DSEND_TYPE_ARG2=void* | |
74 -DSEND_QUAL_ARG2=const | |
75 -DSEND_TYPE_ARG3=size_t | |
76 -DSEND_TYPE_ARG4=int | |
77 -DSEND_TYPE_RETV=ssize_t | |
78 -DSIZEOF_SHORT=2 | |
79 -DSIZEOF_INT=4 | |
80 -DSIZEOF_SIZE_T=8 | |
81 ) | |
82 elseif ("${CMAKE_SIZEOF_VOID_P}" EQUAL "4") | |
83 add_definitions( | |
84 -DRECV_TYPE_ARG1=int | |
85 -DRECV_TYPE_ARG2=void* | |
86 -DRECV_TYPE_ARG3=size_t | |
87 -DRECV_TYPE_ARG4=int | |
88 -DRECV_TYPE_RETV=int | |
89 -DSEND_TYPE_ARG1=int | |
90 -DSEND_TYPE_ARG2=void* | |
91 -DSEND_QUAL_ARG2=const | |
92 -DSEND_TYPE_ARG3=size_t | |
93 -DSEND_TYPE_ARG4=int | |
94 -DSEND_TYPE_RETV=int | |
95 -DSIZEOF_SHORT=2 | |
96 -DSIZEOF_INT=4 | |
97 -DSIZEOF_SIZE_T=4 | |
98 ) | |
99 else() | |
100 message(FATAL_ERROR "Support your platform here") | |
101 endif() | |
102 endif() | |
103 | |
104 else() | |
105 include(FindCURL) | |
106 include_directories(${CURL_INCLUDE_DIRS}) | |
107 link_libraries(${CURL_LIBRARIES}) | |
108 | |
109 if (NOT ${CURL_FOUND}) | |
110 message(FATAL_ERROR "Unable to find LibCurl") | |
111 endif() | |
112 endif() |