Mercurial > hg > orthanc
annotate Resources/CMake/LibCurlConfiguration.cmake @ 2383:741bb76634d3
orthanc-server.com now uses https
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Wed, 30 Aug 2017 08:53:18 +0200 |
parents | ae50eccd41b7 |
children | 74d0953a3681 |
rev | line source |
---|---|
735 | 1 if (STATIC_BUILD OR NOT USE_SYSTEM_CURL) |
2095
9e8b315625c1
Upgrade to curl 7.50.3 for static and Windows builds
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2092
diff
changeset
|
2 SET(CURL_SOURCES_DIR ${CMAKE_BINARY_DIR}/curl-7.50.3) |
2383
741bb76634d3
orthanc-server.com now uses https
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2364
diff
changeset
|
3 SET(CURL_URL "https://www.orthanc-server.com/downloads/third-party/curl-7.50.3.tar.gz") |
2095
9e8b315625c1
Upgrade to curl 7.50.3 for static and Windows builds
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2092
diff
changeset
|
4 SET(CURL_MD5 "870e16fd88a88b52e26a4f04dfc161db") |
1537
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) |
2095
9e8b315625c1
Upgrade to curl 7.50.3 for static and Windows builds
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2092
diff
changeset
|
13 AUX_SOURCE_DIRECTORY(${CURL_SOURCES_DIR}/lib/vauth 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( | |
1536 | 18 -DBUILDING_LIBCURL=1 |
735 | 19 -DCURL_STATICLIB=1 |
20 -DCURL_DISABLE_LDAPS=1 | |
21 -DCURL_DISABLE_LDAP=1 | |
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 | |
2022
fefbe71c2272
Possibility to use PKCS#11 authentication for hardware security modules with Orthanc peers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1560
diff
changeset
|
39 -DHAVE_OPENSSL_ENGINE_H=1 |
735 | 40 -DUSE_SSLEAY=1 |
41 ) | |
42 endif() | |
43 | |
2092
50dd3249732e
optimization for cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2022
diff
changeset
|
44 if (NOT EXISTS "${CURL_SOURCES_DIR}/lib/curl_config.h") |
50dd3249732e
optimization for cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2022
diff
changeset
|
45 file(WRITE ${CURL_SOURCES_DIR}/lib/curl_config.h "") |
1533
0011cc99443c
improving HTTPS support
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1532
diff
changeset
|
46 |
2095
9e8b315625c1
Upgrade to curl 7.50.3 for static and Windows builds
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2092
diff
changeset
|
47 file(WRITE ${CURL_SOURCES_DIR}/lib/vauth/vauth/vauth.h "#include \"../vauth.h\"\n") |
9e8b315625c1
Upgrade to curl 7.50.3 for static and Windows builds
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2092
diff
changeset
|
48 file(WRITE ${CURL_SOURCES_DIR}/lib/vauth/vauth/digest.h "#include \"../digest.h\"\n") |
9e8b315625c1
Upgrade to curl 7.50.3 for static and Windows builds
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2092
diff
changeset
|
49 file(WRITE ${CURL_SOURCES_DIR}/lib/vauth/vauth/ntlm.h "#include \"../ntlm.h\"\n") |
9e8b315625c1
Upgrade to curl 7.50.3 for static and Windows builds
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2092
diff
changeset
|
50 file(WRITE ${CURL_SOURCES_DIR}/lib/vauth/vtls/vtls.h "#include \"../../vtls/vtls.h\"\n") |
9e8b315625c1
Upgrade to curl 7.50.3 for static and Windows builds
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2092
diff
changeset
|
51 |
2092
50dd3249732e
optimization for cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2022
diff
changeset
|
52 file(GLOB CURL_LIBS_HEADERS ${CURL_SOURCES_DIR}/lib/*.h) |
50dd3249732e
optimization for cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2022
diff
changeset
|
53 foreach (header IN LISTS CURL_LIBS_HEADERS) |
50dd3249732e
optimization for cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2022
diff
changeset
|
54 get_filename_component(filename ${header} NAME) |
2095
9e8b315625c1
Upgrade to curl 7.50.3 for static and Windows builds
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2092
diff
changeset
|
55 file(WRITE ${CURL_SOURCES_DIR}/lib/vauth/${filename} "#include \"../${filename}\"\n") |
2092
50dd3249732e
optimization for cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2022
diff
changeset
|
56 file(WRITE ${CURL_SOURCES_DIR}/lib/vtls/${filename} "#include \"../${filename}\"\n") |
50dd3249732e
optimization for cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2022
diff
changeset
|
57 endforeach() |
50dd3249732e
optimization for cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2022
diff
changeset
|
58 endif() |
1536 | 59 |
1544 | 60 if (${CMAKE_SYSTEM_NAME} STREQUAL "Linux" OR |
930 | 61 ${CMAKE_SYSTEM_NAME} STREQUAL "Darwin" OR |
1337 | 62 ${CMAKE_SYSTEM_NAME} STREQUAL "FreeBSD" OR |
2364 | 63 ${CMAKE_SYSTEM_NAME} STREQUAL "kFreeBSD" OR |
64 ${CMAKE_SYSTEM_NAME} STREQUAL "OpenBSD") | |
735 | 65 if ("${CMAKE_SIZEOF_VOID_P}" EQUAL "8") |
66 SET(TMP_OS "x86_64") | |
67 else() | |
68 SET(TMP_OS "x86") | |
69 endif() | |
70 | |
71 set_property( | |
72 SOURCE ${CURL_SOURCES} | |
1531 | 73 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
|
74 ) |
7b58e0048874
Upgrade to curl 7.44.0 for static and Windows builds
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1415
diff
changeset
|
75 |
735 | 76 if ("${CMAKE_SIZEOF_VOID_P}" EQUAL "8") |
77 add_definitions( | |
78 -DRECV_TYPE_ARG1=int | |
79 -DRECV_TYPE_ARG2=void* | |
80 -DRECV_TYPE_ARG3=size_t | |
81 -DRECV_TYPE_ARG4=int | |
82 -DRECV_TYPE_RETV=ssize_t | |
83 -DSEND_TYPE_ARG1=int | |
84 -DSEND_TYPE_ARG2=void* | |
85 -DSEND_QUAL_ARG2=const | |
86 -DSEND_TYPE_ARG3=size_t | |
87 -DSEND_TYPE_ARG4=int | |
88 -DSEND_TYPE_RETV=ssize_t | |
89 -DSIZEOF_SHORT=2 | |
90 -DSIZEOF_INT=4 | |
91 -DSIZEOF_SIZE_T=8 | |
92 ) | |
93 elseif ("${CMAKE_SIZEOF_VOID_P}" EQUAL "4") | |
94 add_definitions( | |
95 -DRECV_TYPE_ARG1=int | |
96 -DRECV_TYPE_ARG2=void* | |
97 -DRECV_TYPE_ARG3=size_t | |
98 -DRECV_TYPE_ARG4=int | |
99 -DRECV_TYPE_RETV=int | |
100 -DSEND_TYPE_ARG1=int | |
101 -DSEND_TYPE_ARG2=void* | |
102 -DSEND_QUAL_ARG2=const | |
103 -DSEND_TYPE_ARG3=size_t | |
104 -DSEND_TYPE_ARG4=int | |
105 -DSEND_TYPE_RETV=int | |
106 -DSIZEOF_SHORT=2 | |
107 -DSIZEOF_INT=4 | |
108 -DSIZEOF_SIZE_T=4 | |
109 ) | |
110 else() | |
111 message(FATAL_ERROR "Support your platform here") | |
112 endif() | |
113 endif() | |
114 | |
115 else() | |
116 include(FindCURL) | |
117 include_directories(${CURL_INCLUDE_DIRS}) | |
118 link_libraries(${CURL_LIBRARIES}) | |
119 | |
120 if (NOT ${CURL_FOUND}) | |
121 message(FATAL_ERROR "Unable to find LibCurl") | |
122 endif() | |
123 endif() |