Mercurial > hg > orthanc
annotate Resources/CMake/LibCurlConfiguration.cmake @ 638:92aa6df91c30
rename
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Tue, 29 Oct 2013 11:22:48 +0100 |
parents | d775a3cb5a06 |
children | ee0d5abf7958 ac8f68cbdbb6 |
rev | line source |
---|---|
634 | 1 if (STATIC_BUILD OR NOT USE_SYSTEM_CURL) |
2 | 2 SET(CURL_SOURCES_DIR ${CMAKE_BINARY_DIR}/curl-7.26.0) |
411
5f6d75cd4b46
md5 of third party downlaods
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
382
diff
changeset
|
3 DownloadPackage( |
5f6d75cd4b46
md5 of third party downlaods
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
382
diff
changeset
|
4 "3fa4d5236f2a36ca5c3af6715e837691" |
5f6d75cd4b46
md5 of third party downlaods
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
382
diff
changeset
|
5 "http://www.montefiore.ulg.ac.be/~jodogne/Orthanc/ThirdPartyDownloads/curl-7.26.0.tar.gz" |
553
27d32fc6209a
simplifications to cmake, use a digest of boost 1.54.0 thanks bcp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
411
diff
changeset
|
6 "${CURL_SOURCES_DIR}") |
2 | 7 |
8 include_directories(${CURL_SOURCES_DIR}/include) | |
9 AUX_SOURCE_DIRECTORY(${CURL_SOURCES_DIR}/lib CURL_SOURCES) | |
8 | 10 source_group(ThirdParty\\LibCurl REGULAR_EXPRESSION ${CURL_SOURCES_DIR}/.*) |
2 | 11 |
506
6e4bd06c17c5
the wrapper is working
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
411
diff
changeset
|
12 #add_library(Curl STATIC ${CURL_SOURCES}) |
6e4bd06c17c5
the wrapper is working
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
411
diff
changeset
|
13 #link_libraries(Curl) |
29
042ac60f5bf9
simplified build of curl
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
26
diff
changeset
|
14 |
2 | 15 add_definitions( |
16 -DCURL_STATICLIB=1 | |
17 -DBUILDING_LIBCURL=1 | |
8 | 18 -DCURL_DISABLE_LDAPS=1 |
19 -DCURL_DISABLE_LDAP=1 | |
20 -D_WIN32_WINNT=0x0501 | |
29
042ac60f5bf9
simplified build of curl
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
26
diff
changeset
|
21 |
042ac60f5bf9
simplified build of curl
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
26
diff
changeset
|
22 -DCURL_DISABLE_DICT=1 |
042ac60f5bf9
simplified build of curl
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
26
diff
changeset
|
23 -DCURL_DISABLE_FILE=1 |
042ac60f5bf9
simplified build of curl
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
26
diff
changeset
|
24 -DCURL_DISABLE_FTP=1 |
042ac60f5bf9
simplified build of curl
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
26
diff
changeset
|
25 -DCURL_DISABLE_GOPHER=1 |
042ac60f5bf9
simplified build of curl
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
26
diff
changeset
|
26 -DCURL_DISABLE_LDAP=1 |
042ac60f5bf9
simplified build of curl
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
26
diff
changeset
|
27 -DCURL_DISABLE_LDAPS=1 |
042ac60f5bf9
simplified build of curl
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
26
diff
changeset
|
28 -DCURL_DISABLE_POP3=1 |
042ac60f5bf9
simplified build of curl
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
26
diff
changeset
|
29 -DCURL_DISABLE_PROXY=1 |
042ac60f5bf9
simplified build of curl
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
26
diff
changeset
|
30 -DCURL_DISABLE_RTSP=1 |
042ac60f5bf9
simplified build of curl
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
26
diff
changeset
|
31 -DCURL_DISABLE_TELNET=1 |
042ac60f5bf9
simplified build of curl
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
26
diff
changeset
|
32 -DCURL_DISABLE_TFTP=1 |
2 | 33 ) |
34 | |
29
042ac60f5bf9
simplified build of curl
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
26
diff
changeset
|
35 if (${ENABLE_SSL}) |
042ac60f5bf9
simplified build of curl
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
26
diff
changeset
|
36 add_definitions( |
042ac60f5bf9
simplified build of curl
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
26
diff
changeset
|
37 #-DHAVE_LIBSSL=1 |
042ac60f5bf9
simplified build of curl
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
26
diff
changeset
|
38 -DUSE_OPENSSL=1 |
042ac60f5bf9
simplified build of curl
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
26
diff
changeset
|
39 -DUSE_SSLEAY=1 |
042ac60f5bf9
simplified build of curl
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
26
diff
changeset
|
40 ) |
042ac60f5bf9
simplified build of curl
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
26
diff
changeset
|
41 endif() |
042ac60f5bf9
simplified build of curl
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
26
diff
changeset
|
42 |
15 | 43 if (${CMAKE_SYSTEM_NAME} STREQUAL "Linux") |
29
042ac60f5bf9
simplified build of curl
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
26
diff
changeset
|
44 if ("${CMAKE_SIZEOF_VOID_P}" EQUAL "8") |
042ac60f5bf9
simplified build of curl
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
26
diff
changeset
|
45 SET(TMP_OS "x86_64") |
042ac60f5bf9
simplified build of curl
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
26
diff
changeset
|
46 else() |
042ac60f5bf9
simplified build of curl
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
26
diff
changeset
|
47 SET(TMP_OS "x86") |
042ac60f5bf9
simplified build of curl
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
26
diff
changeset
|
48 endif() |
042ac60f5bf9
simplified build of curl
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
26
diff
changeset
|
49 |
15 | 50 set_property( |
51 SOURCE ${CURL_SOURCES} | |
29
042ac60f5bf9
simplified build of curl
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
26
diff
changeset
|
52 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}\"") |
32 | 53 |
29
042ac60f5bf9
simplified build of curl
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
26
diff
changeset
|
54 if ("${CMAKE_SIZEOF_VOID_P}" EQUAL "8") |
042ac60f5bf9
simplified build of curl
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
26
diff
changeset
|
55 add_definitions( |
042ac60f5bf9
simplified build of curl
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
26
diff
changeset
|
56 -DRECV_TYPE_ARG1=int |
042ac60f5bf9
simplified build of curl
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
26
diff
changeset
|
57 -DRECV_TYPE_ARG2=void* |
042ac60f5bf9
simplified build of curl
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
26
diff
changeset
|
58 -DRECV_TYPE_ARG3=size_t |
042ac60f5bf9
simplified build of curl
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
26
diff
changeset
|
59 -DRECV_TYPE_ARG4=int |
042ac60f5bf9
simplified build of curl
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
26
diff
changeset
|
60 -DRECV_TYPE_RETV=ssize_t |
042ac60f5bf9
simplified build of curl
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
26
diff
changeset
|
61 -DSEND_TYPE_ARG1=int |
042ac60f5bf9
simplified build of curl
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
26
diff
changeset
|
62 -DSEND_TYPE_ARG2=void* |
042ac60f5bf9
simplified build of curl
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
26
diff
changeset
|
63 -DSEND_QUAL_ARG2=const |
042ac60f5bf9
simplified build of curl
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
26
diff
changeset
|
64 -DSEND_TYPE_ARG3=size_t |
042ac60f5bf9
simplified build of curl
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
26
diff
changeset
|
65 -DSEND_TYPE_ARG4=int |
042ac60f5bf9
simplified build of curl
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
26
diff
changeset
|
66 -DSEND_TYPE_RETV=ssize_t |
042ac60f5bf9
simplified build of curl
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
26
diff
changeset
|
67 -DSIZEOF_SHORT=2 |
042ac60f5bf9
simplified build of curl
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
26
diff
changeset
|
68 -DSIZEOF_INT=4 |
042ac60f5bf9
simplified build of curl
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
26
diff
changeset
|
69 -DSIZEOF_SIZE_T=8 |
042ac60f5bf9
simplified build of curl
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
26
diff
changeset
|
70 ) |
042ac60f5bf9
simplified build of curl
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
26
diff
changeset
|
71 elseif ("${CMAKE_SIZEOF_VOID_P}" EQUAL "4") |
042ac60f5bf9
simplified build of curl
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
26
diff
changeset
|
72 add_definitions( |
32 | 73 -DRECV_TYPE_ARG1=int |
74 -DRECV_TYPE_ARG2=void* | |
75 -DRECV_TYPE_ARG3=size_t | |
29
042ac60f5bf9
simplified build of curl
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
26
diff
changeset
|
76 -DRECV_TYPE_ARG4=int |
042ac60f5bf9
simplified build of curl
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
26
diff
changeset
|
77 -DRECV_TYPE_RETV=int |
32 | 78 -DSEND_TYPE_ARG1=int |
79 -DSEND_TYPE_ARG2=void* | |
29
042ac60f5bf9
simplified build of curl
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
26
diff
changeset
|
80 -DSEND_QUAL_ARG2=const |
32 | 81 -DSEND_TYPE_ARG3=size_t |
29
042ac60f5bf9
simplified build of curl
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
26
diff
changeset
|
82 -DSEND_TYPE_ARG4=int |
042ac60f5bf9
simplified build of curl
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
26
diff
changeset
|
83 -DSEND_TYPE_RETV=int |
042ac60f5bf9
simplified build of curl
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
26
diff
changeset
|
84 -DSIZEOF_SHORT=2 |
042ac60f5bf9
simplified build of curl
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
26
diff
changeset
|
85 -DSIZEOF_INT=4 |
042ac60f5bf9
simplified build of curl
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
26
diff
changeset
|
86 -DSIZEOF_SIZE_T=4 |
042ac60f5bf9
simplified build of curl
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
26
diff
changeset
|
87 ) |
042ac60f5bf9
simplified build of curl
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
26
diff
changeset
|
88 else() |
042ac60f5bf9
simplified build of curl
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
26
diff
changeset
|
89 message(FATAL_ERROR "Support your platform here") |
042ac60f5bf9
simplified build of curl
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
26
diff
changeset
|
90 endif() |
15 | 91 endif() |
92 | |
2 | 93 else() |
94 include(FindCURL) | |
95 include_directories(${CURL_INCLUDE_DIRS}) | |
96 link_libraries(${CURL_LIBRARIES}) | |
97 | |
98 if (NOT ${CURL_FOUND}) | |
99 message(FATAL_ERROR "Unable to find LibCurl") | |
100 endif() | |
101 endif() |