Mercurial > hg > orthanc
annotate Resources/CMake/LibCurlConfiguration.cmake @ 194:0186ac92810c
fixes for Ubuntu 10.04
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Wed, 14 Nov 2012 09:23:53 +0100 |
parents | 0c3e317f35e8 |
children | b45bc565d82a 61ab5fa36754 |
rev | line source |
---|---|
2 | 1 if (${STATIC_BUILD}) |
2 SET(CURL_SOURCES_DIR ${CMAKE_BINARY_DIR}/curl-7.26.0) | |
3 DownloadPackage("http://curl.haxx.se/download/curl-7.26.0.tar.gz" "${CURL_SOURCES_DIR}" "" "") | |
4 | |
5 include_directories(${CURL_SOURCES_DIR}/include) | |
6 AUX_SOURCE_DIRECTORY(${CURL_SOURCES_DIR}/lib CURL_SOURCES) | |
8 | 7 source_group(ThirdParty\\LibCurl REGULAR_EXPRESSION ${CURL_SOURCES_DIR}/.*) |
2 | 8 |
29
042ac60f5bf9
simplified build of curl
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
26
diff
changeset
|
9 add_library(Curl STATIC ${CURL_SOURCES}) |
042ac60f5bf9
simplified build of curl
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
26
diff
changeset
|
10 link_libraries(Curl) |
042ac60f5bf9
simplified build of curl
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
26
diff
changeset
|
11 |
2 | 12 add_definitions( |
13 -DCURL_STATICLIB=1 | |
14 -DBUILDING_LIBCURL=1 | |
8 | 15 -DCURL_DISABLE_LDAPS=1 |
16 -DCURL_DISABLE_LDAP=1 | |
17 -D_WIN32_WINNT=0x0501 | |
29
042ac60f5bf9
simplified build of curl
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
26
diff
changeset
|
18 |
042ac60f5bf9
simplified build of curl
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
26
diff
changeset
|
19 -DCURL_DISABLE_DICT=1 |
042ac60f5bf9
simplified build of curl
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
26
diff
changeset
|
20 -DCURL_DISABLE_FILE=1 |
042ac60f5bf9
simplified build of curl
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
26
diff
changeset
|
21 -DCURL_DISABLE_FTP=1 |
042ac60f5bf9
simplified build of curl
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
26
diff
changeset
|
22 -DCURL_DISABLE_GOPHER=1 |
042ac60f5bf9
simplified build of curl
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
26
diff
changeset
|
23 -DCURL_DISABLE_LDAP=1 |
042ac60f5bf9
simplified build of curl
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
26
diff
changeset
|
24 -DCURL_DISABLE_LDAPS=1 |
042ac60f5bf9
simplified build of curl
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
26
diff
changeset
|
25 -DCURL_DISABLE_POP3=1 |
042ac60f5bf9
simplified build of curl
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
26
diff
changeset
|
26 -DCURL_DISABLE_PROXY=1 |
042ac60f5bf9
simplified build of curl
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
26
diff
changeset
|
27 -DCURL_DISABLE_RTSP=1 |
042ac60f5bf9
simplified build of curl
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
26
diff
changeset
|
28 -DCURL_DISABLE_TELNET=1 |
042ac60f5bf9
simplified build of curl
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
26
diff
changeset
|
29 -DCURL_DISABLE_TFTP=1 |
2 | 30 ) |
31 | |
29
042ac60f5bf9
simplified build of curl
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
26
diff
changeset
|
32 if (${ENABLE_SSL}) |
042ac60f5bf9
simplified build of curl
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
26
diff
changeset
|
33 add_definitions( |
042ac60f5bf9
simplified build of curl
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
26
diff
changeset
|
34 #-DHAVE_LIBSSL=1 |
042ac60f5bf9
simplified build of curl
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
26
diff
changeset
|
35 -DUSE_OPENSSL=1 |
042ac60f5bf9
simplified build of curl
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
26
diff
changeset
|
36 -DUSE_SSLEAY=1 |
042ac60f5bf9
simplified build of curl
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
26
diff
changeset
|
37 ) |
042ac60f5bf9
simplified build of curl
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
26
diff
changeset
|
38 endif() |
042ac60f5bf9
simplified build of curl
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
26
diff
changeset
|
39 |
15 | 40 if (${CMAKE_SYSTEM_NAME} STREQUAL "Linux") |
29
042ac60f5bf9
simplified build of curl
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
26
diff
changeset
|
41 if ("${CMAKE_SIZEOF_VOID_P}" EQUAL "8") |
042ac60f5bf9
simplified build of curl
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
26
diff
changeset
|
42 SET(TMP_OS "x86_64") |
042ac60f5bf9
simplified build of curl
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
26
diff
changeset
|
43 else() |
042ac60f5bf9
simplified build of curl
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
26
diff
changeset
|
44 SET(TMP_OS "x86") |
042ac60f5bf9
simplified build of curl
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
26
diff
changeset
|
45 endif() |
042ac60f5bf9
simplified build of curl
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
26
diff
changeset
|
46 |
15 | 47 set_property( |
48 SOURCE ${CURL_SOURCES} | |
29
042ac60f5bf9
simplified build of curl
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
26
diff
changeset
|
49 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 | 50 |
29
042ac60f5bf9
simplified build of curl
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
26
diff
changeset
|
51 if ("${CMAKE_SIZEOF_VOID_P}" EQUAL "8") |
042ac60f5bf9
simplified build of curl
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
26
diff
changeset
|
52 add_definitions( |
042ac60f5bf9
simplified build of curl
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
26
diff
changeset
|
53 -DRECV_TYPE_ARG1=int |
042ac60f5bf9
simplified build of curl
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
26
diff
changeset
|
54 -DRECV_TYPE_ARG2=void* |
042ac60f5bf9
simplified build of curl
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
26
diff
changeset
|
55 -DRECV_TYPE_ARG3=size_t |
042ac60f5bf9
simplified build of curl
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
26
diff
changeset
|
56 -DRECV_TYPE_ARG4=int |
042ac60f5bf9
simplified build of curl
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
26
diff
changeset
|
57 -DRECV_TYPE_RETV=ssize_t |
042ac60f5bf9
simplified build of curl
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
26
diff
changeset
|
58 -DSEND_TYPE_ARG1=int |
042ac60f5bf9
simplified build of curl
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
26
diff
changeset
|
59 -DSEND_TYPE_ARG2=void* |
042ac60f5bf9
simplified build of curl
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
26
diff
changeset
|
60 -DSEND_QUAL_ARG2=const |
042ac60f5bf9
simplified build of curl
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
26
diff
changeset
|
61 -DSEND_TYPE_ARG3=size_t |
042ac60f5bf9
simplified build of curl
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
26
diff
changeset
|
62 -DSEND_TYPE_ARG4=int |
042ac60f5bf9
simplified build of curl
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
26
diff
changeset
|
63 -DSEND_TYPE_RETV=ssize_t |
042ac60f5bf9
simplified build of curl
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
26
diff
changeset
|
64 -DSIZEOF_SHORT=2 |
042ac60f5bf9
simplified build of curl
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
26
diff
changeset
|
65 -DSIZEOF_INT=4 |
042ac60f5bf9
simplified build of curl
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
26
diff
changeset
|
66 -DSIZEOF_SIZE_T=8 |
042ac60f5bf9
simplified build of curl
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
26
diff
changeset
|
67 ) |
042ac60f5bf9
simplified build of curl
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
26
diff
changeset
|
68 elseif ("${CMAKE_SIZEOF_VOID_P}" EQUAL "4") |
042ac60f5bf9
simplified build of curl
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
26
diff
changeset
|
69 add_definitions( |
32 | 70 -DRECV_TYPE_ARG1=int |
71 -DRECV_TYPE_ARG2=void* | |
72 -DRECV_TYPE_ARG3=size_t | |
29
042ac60f5bf9
simplified build of curl
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
26
diff
changeset
|
73 -DRECV_TYPE_ARG4=int |
042ac60f5bf9
simplified build of curl
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
26
diff
changeset
|
74 -DRECV_TYPE_RETV=int |
32 | 75 -DSEND_TYPE_ARG1=int |
76 -DSEND_TYPE_ARG2=void* | |
29
042ac60f5bf9
simplified build of curl
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
26
diff
changeset
|
77 -DSEND_QUAL_ARG2=const |
32 | 78 -DSEND_TYPE_ARG3=size_t |
29
042ac60f5bf9
simplified build of curl
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
26
diff
changeset
|
79 -DSEND_TYPE_ARG4=int |
042ac60f5bf9
simplified build of curl
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
26
diff
changeset
|
80 -DSEND_TYPE_RETV=int |
042ac60f5bf9
simplified build of curl
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
26
diff
changeset
|
81 -DSIZEOF_SHORT=2 |
042ac60f5bf9
simplified build of curl
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
26
diff
changeset
|
82 -DSIZEOF_INT=4 |
042ac60f5bf9
simplified build of curl
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
26
diff
changeset
|
83 -DSIZEOF_SIZE_T=4 |
042ac60f5bf9
simplified build of curl
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
26
diff
changeset
|
84 ) |
042ac60f5bf9
simplified build of curl
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
26
diff
changeset
|
85 else() |
042ac60f5bf9
simplified build of curl
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
26
diff
changeset
|
86 message(FATAL_ERROR "Support your platform here") |
042ac60f5bf9
simplified build of curl
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
26
diff
changeset
|
87 endif() |
15 | 88 endif() |
89 | |
2 | 90 else() |
91 include(FindCURL) | |
92 include_directories(${CURL_INCLUDE_DIRS}) | |
93 link_libraries(${CURL_LIBRARIES}) | |
94 | |
95 if (NOT ${CURL_FOUND}) | |
96 message(FATAL_ERROR "Unable to find LibCurl") | |
97 endif() | |
98 endif() |