annotate Resources/CMake/LibCurlConfiguration.cmake @ 15:2fcf8e5e789c

mini fix
author Sebastien Jodogne <s.jodogne@gmail.com>
date Fri, 20 Jul 2012 13:35:59 +0200
parents 3a584803783e
children 6ba765ecf3db
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 if (${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
67a6978503b7 fixing Windows build
Jodogne@Laptop
parents: 0
diff changeset
6 if ("${CMAKE_SIZEOF_VOID_P}" EQUAL "8")
67a6978503b7 fixing Windows build
Jodogne@Laptop
parents: 0
diff changeset
7 SET(SOURCE_CONFIG ${CMAKE_SOURCE_DIR}/Resources/libcurl/x86_64-linux)
67a6978503b7 fixing Windows build
Jodogne@Laptop
parents: 0
diff changeset
8 elseif ("${CMAKE_SIZEOF_VOID_P}" EQUAL "4")
67a6978503b7 fixing Windows build
Jodogne@Laptop
parents: 0
diff changeset
9 SET(SOURCE_CONFIG ${CMAKE_SOURCE_DIR}/Resources/libcurl/i686-pc-linux-gnu)
67a6978503b7 fixing Windows build
Jodogne@Laptop
parents: 0
diff changeset
10 else()
67a6978503b7 fixing Windows build
Jodogne@Laptop
parents: 0
diff changeset
11 message(FATAL_ERROR "Support your platform here")
67a6978503b7 fixing Windows build
Jodogne@Laptop
parents: 0
diff changeset
12 endif()
67a6978503b7 fixing Windows build
Jodogne@Laptop
parents: 0
diff changeset
13 elseif(${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
67a6978503b7 fixing Windows build
Jodogne@Laptop
parents: 0
diff changeset
14 if (${MSVC})
67a6978503b7 fixing Windows build
Jodogne@Laptop
parents: 0
diff changeset
15 SET(SOURCE_CONFIG ${CMAKE_SOURCE_DIR}/Resources/libcurl/msvc)
67a6978503b7 fixing Windows build
Jodogne@Laptop
parents: 0
diff changeset
16 else()
67a6978503b7 fixing Windows build
Jodogne@Laptop
parents: 0
diff changeset
17 SET(SOURCE_CONFIG ${CMAKE_SOURCE_DIR}/Resources/libcurl/i586-mingw32msvc)
67a6978503b7 fixing Windows build
Jodogne@Laptop
parents: 0
diff changeset
18 endif()
67a6978503b7 fixing Windows build
Jodogne@Laptop
parents: 0
diff changeset
19 else()
67a6978503b7 fixing Windows build
Jodogne@Laptop
parents: 0
diff changeset
20 message(FATAL_ERROR "Support your platform here")
67a6978503b7 fixing Windows build
Jodogne@Laptop
parents: 0
diff changeset
21 endif()
67a6978503b7 fixing Windows build
Jodogne@Laptop
parents: 0
diff changeset
22
67a6978503b7 fixing Windows build
Jodogne@Laptop
parents: 0
diff changeset
23 if (${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
67a6978503b7 fixing Windows build
Jodogne@Laptop
parents: 0
diff changeset
24 configure_file("${SOURCE_CONFIG}/curl_config.h" "${CURL_SOURCES_DIR}/lib/curl_config.h" COPYONLY)
67a6978503b7 fixing Windows build
Jodogne@Laptop
parents: 0
diff changeset
25 configure_file("${SOURCE_CONFIG}/curlbuild.h" "${CURL_SOURCES_DIR}/include/curl/curlbuild.h" COPYONLY)
67a6978503b7 fixing Windows build
Jodogne@Laptop
parents: 0
diff changeset
26 elseif (${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
67a6978503b7 fixing Windows build
Jodogne@Laptop
parents: 0
diff changeset
27 configure_file("${SOURCE_CONFIG}/curlbuild.h" "${CURL_SOURCES_DIR}/include/curl/curlbuild.h" COPYONLY)
67a6978503b7 fixing Windows build
Jodogne@Laptop
parents: 0
diff changeset
28 endif()
67a6978503b7 fixing Windows build
Jodogne@Laptop
parents: 0
diff changeset
29
67a6978503b7 fixing Windows build
Jodogne@Laptop
parents: 0
diff changeset
30 include_directories(${CURL_SOURCES_DIR}/include)
67a6978503b7 fixing Windows build
Jodogne@Laptop
parents: 0
diff changeset
31
67a6978503b7 fixing Windows build
Jodogne@Laptop
parents: 0
diff changeset
32 AUX_SOURCE_DIRECTORY(${CURL_SOURCES_DIR}/lib CURL_SOURCES)
8
3a584803783e build with visual studio
jodogne
parents: 2
diff changeset
33 source_group(ThirdParty\\LibCurl REGULAR_EXPRESSION ${CURL_SOURCES_DIR}/.*)
2
67a6978503b7 fixing Windows build
Jodogne@Laptop
parents: 0
diff changeset
34
67a6978503b7 fixing Windows build
Jodogne@Laptop
parents: 0
diff changeset
35 list(APPEND THIRD_PARTY_SOURCES ${CURL_SOURCES})
67a6978503b7 fixing Windows build
Jodogne@Laptop
parents: 0
diff changeset
36
67a6978503b7 fixing Windows build
Jodogne@Laptop
parents: 0
diff changeset
37 add_definitions(
67a6978503b7 fixing Windows build
Jodogne@Laptop
parents: 0
diff changeset
38 -DCURL_STATICLIB=1
67a6978503b7 fixing Windows build
Jodogne@Laptop
parents: 0
diff changeset
39 -DBUILDING_LIBCURL=1
8
3a584803783e build with visual studio
jodogne
parents: 2
diff changeset
40 -DCURL_DISABLE_LDAPS=1
3a584803783e build with visual studio
jodogne
parents: 2
diff changeset
41 -DCURL_DISABLE_LDAP=1
3a584803783e build with visual studio
jodogne
parents: 2
diff changeset
42 -D_WIN32_WINNT=0x0501
2
67a6978503b7 fixing Windows build
Jodogne@Laptop
parents: 0
diff changeset
43 )
67a6978503b7 fixing Windows build
Jodogne@Laptop
parents: 0
diff changeset
44
15
2fcf8e5e789c mini fix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 8
diff changeset
45 if (${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
2fcf8e5e789c mini fix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 8
diff changeset
46 set_property(
2fcf8e5e789c mini fix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 8
diff changeset
47 SOURCE ${CURL_SOURCES}
2fcf8e5e789c mini fix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 8
diff changeset
48 PROPERTY COMPILE_DEFINITIONS HAVE_CONFIG_H)
2fcf8e5e789c mini fix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 8
diff changeset
49 endif()
2fcf8e5e789c mini fix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 8
diff changeset
50
2
67a6978503b7 fixing Windows build
Jodogne@Laptop
parents: 0
diff changeset
51 else()
67a6978503b7 fixing Windows build
Jodogne@Laptop
parents: 0
diff changeset
52 include(FindCURL)
67a6978503b7 fixing Windows build
Jodogne@Laptop
parents: 0
diff changeset
53 include_directories(${CURL_INCLUDE_DIRS})
67a6978503b7 fixing Windows build
Jodogne@Laptop
parents: 0
diff changeset
54 link_libraries(${CURL_LIBRARIES})
67a6978503b7 fixing Windows build
Jodogne@Laptop
parents: 0
diff changeset
55
67a6978503b7 fixing Windows build
Jodogne@Laptop
parents: 0
diff changeset
56 if (NOT ${CURL_FOUND})
67a6978503b7 fixing Windows build
Jodogne@Laptop
parents: 0
diff changeset
57 message(FATAL_ERROR "Unable to find LibCurl")
67a6978503b7 fixing Windows build
Jodogne@Laptop
parents: 0
diff changeset
58 endif()
67a6978503b7 fixing Windows build
Jodogne@Laptop
parents: 0
diff changeset
59 endif()