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