annotate Resources/CMake/LibCurlConfiguration.cmake @ 184:d4e967d401d3

debugging for msvc
author Sebastien Jodogne <s.jodogne@gmail.com>
date Mon, 12 Nov 2012 15:01:39 +0100
parents 0c3e317f35e8
children b45bc565d82a 61ab5fa36754
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
2
67a6978503b7 fixing Windows build
Jodogne@Laptop
parents: 0
diff changeset
1 if (${STATIC_BUILD})
67a6978503b7 fixing Windows build
Jodogne@Laptop
parents: 0
diff changeset
2 SET(CURL_SOURCES_DIR ${CMAKE_BINARY_DIR}/curl-7.26.0)
67a6978503b7 fixing Windows build
Jodogne@Laptop
parents: 0
diff changeset
3 DownloadPackage("http://curl.haxx.se/download/curl-7.26.0.tar.gz" "${CURL_SOURCES_DIR}" "" "")
67a6978503b7 fixing Windows build
Jodogne@Laptop
parents: 0
diff changeset
4
67a6978503b7 fixing Windows build
Jodogne@Laptop
parents: 0
diff changeset
5 include_directories(${CURL_SOURCES_DIR}/include)
67a6978503b7 fixing Windows build
Jodogne@Laptop
parents: 0
diff changeset
6 AUX_SOURCE_DIRECTORY(${CURL_SOURCES_DIR}/lib CURL_SOURCES)
8
3a584803783e build with visual studio
jodogne
parents: 2
diff changeset
7 source_group(ThirdParty\\LibCurl REGULAR_EXPRESSION ${CURL_SOURCES_DIR}/.*)
2
67a6978503b7 fixing Windows build
Jodogne@Laptop
parents: 0
diff changeset
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
67a6978503b7 fixing Windows build
Jodogne@Laptop
parents: 0
diff changeset
12 add_definitions(
67a6978503b7 fixing Windows build
Jodogne@Laptop
parents: 0
diff changeset
13 -DCURL_STATICLIB=1
67a6978503b7 fixing Windows build
Jodogne@Laptop
parents: 0
diff changeset
14 -DBUILDING_LIBCURL=1
8
3a584803783e build with visual studio
jodogne
parents: 2
diff changeset
15 -DCURL_DISABLE_LDAPS=1
3a584803783e build with visual studio
jodogne
parents: 2
diff changeset
16 -DCURL_DISABLE_LDAP=1
3a584803783e build with visual studio
jodogne
parents: 2
diff changeset
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
67a6978503b7 fixing Windows build
Jodogne@Laptop
parents: 0
diff changeset
30 )
67a6978503b7 fixing Windows build
Jodogne@Laptop
parents: 0
diff changeset
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
2fcf8e5e789c mini fix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 8
diff changeset
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
2fcf8e5e789c mini fix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 8
diff changeset
47 set_property(
2fcf8e5e789c mini fix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 8
diff changeset
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
0c3e317f35e8 fix for linux32
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 30
diff changeset
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
0c3e317f35e8 fix for linux32
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 30
diff changeset
70 -DRECV_TYPE_ARG1=int
0c3e317f35e8 fix for linux32
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 30
diff changeset
71 -DRECV_TYPE_ARG2=void*
0c3e317f35e8 fix for linux32
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 30
diff changeset
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
0c3e317f35e8 fix for linux32
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 30
diff changeset
75 -DSEND_TYPE_ARG1=int
0c3e317f35e8 fix for linux32
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 30
diff changeset
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
0c3e317f35e8 fix for linux32
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 30
diff changeset
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
2fcf8e5e789c mini fix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 8
diff changeset
88 endif()
2fcf8e5e789c mini fix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 8
diff changeset
89
2
67a6978503b7 fixing Windows build
Jodogne@Laptop
parents: 0
diff changeset
90 else()
67a6978503b7 fixing Windows build
Jodogne@Laptop
parents: 0
diff changeset
91 include(FindCURL)
67a6978503b7 fixing Windows build
Jodogne@Laptop
parents: 0
diff changeset
92 include_directories(${CURL_INCLUDE_DIRS})
67a6978503b7 fixing Windows build
Jodogne@Laptop
parents: 0
diff changeset
93 link_libraries(${CURL_LIBRARIES})
67a6978503b7 fixing Windows build
Jodogne@Laptop
parents: 0
diff changeset
94
67a6978503b7 fixing Windows build
Jodogne@Laptop
parents: 0
diff changeset
95 if (NOT ${CURL_FOUND})
67a6978503b7 fixing Windows build
Jodogne@Laptop
parents: 0
diff changeset
96 message(FATAL_ERROR "Unable to find LibCurl")
67a6978503b7 fixing Windows build
Jodogne@Laptop
parents: 0
diff changeset
97 endif()
67a6978503b7 fixing Windows build
Jodogne@Laptop
parents: 0
diff changeset
98 endif()