annotate Resources/CMake/LibCurlConfiguration.cmake @ 8:3a584803783e

build with visual studio
author jodogne
date Fri, 20 Jul 2012 11:00:49 +0200
parents 67a6978503b7
children 2fcf8e5e789c
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)
8
3a584803783e build with visual studio
jodogne
parents: 2
diff changeset
26 set_property(
3a584803783e build with visual studio
jodogne
parents: 2
diff changeset
27 SOURCE ${CURL_SOURCES}
3a584803783e build with visual studio
jodogne
parents: 2
diff changeset
28 PROPERTY COMPILE_DEFINITIONS HAVE_CONFIG_H)
2
67a6978503b7 fixing Windows build
Jodogne@Laptop
parents: 0
diff changeset
29 elseif (${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
67a6978503b7 fixing Windows build
Jodogne@Laptop
parents: 0
diff changeset
30 configure_file("${SOURCE_CONFIG}/curlbuild.h" "${CURL_SOURCES_DIR}/include/curl/curlbuild.h" COPYONLY)
67a6978503b7 fixing Windows build
Jodogne@Laptop
parents: 0
diff changeset
31 endif()
67a6978503b7 fixing Windows build
Jodogne@Laptop
parents: 0
diff changeset
32
67a6978503b7 fixing Windows build
Jodogne@Laptop
parents: 0
diff changeset
33 include_directories(${CURL_SOURCES_DIR}/include)
67a6978503b7 fixing Windows build
Jodogne@Laptop
parents: 0
diff changeset
34
67a6978503b7 fixing Windows build
Jodogne@Laptop
parents: 0
diff changeset
35 AUX_SOURCE_DIRECTORY(${CURL_SOURCES_DIR}/lib CURL_SOURCES)
8
3a584803783e build with visual studio
jodogne
parents: 2
diff changeset
36 source_group(ThirdParty\\LibCurl REGULAR_EXPRESSION ${CURL_SOURCES_DIR}/.*)
2
67a6978503b7 fixing Windows build
Jodogne@Laptop
parents: 0
diff changeset
37
67a6978503b7 fixing Windows build
Jodogne@Laptop
parents: 0
diff changeset
38 list(APPEND THIRD_PARTY_SOURCES ${CURL_SOURCES})
67a6978503b7 fixing Windows build
Jodogne@Laptop
parents: 0
diff changeset
39
67a6978503b7 fixing Windows build
Jodogne@Laptop
parents: 0
diff changeset
40 add_definitions(
67a6978503b7 fixing Windows build
Jodogne@Laptop
parents: 0
diff changeset
41 -DCURL_STATICLIB=1
67a6978503b7 fixing Windows build
Jodogne@Laptop
parents: 0
diff changeset
42 -DBUILDING_LIBCURL=1
8
3a584803783e build with visual studio
jodogne
parents: 2
diff changeset
43 -DCURL_DISABLE_LDAPS=1
3a584803783e build with visual studio
jodogne
parents: 2
diff changeset
44 -DCURL_DISABLE_LDAP=1
3a584803783e build with visual studio
jodogne
parents: 2
diff changeset
45 -D_WIN32_WINNT=0x0501
2
67a6978503b7 fixing Windows build
Jodogne@Laptop
parents: 0
diff changeset
46 )
67a6978503b7 fixing Windows build
Jodogne@Laptop
parents: 0
diff changeset
47
67a6978503b7 fixing Windows build
Jodogne@Laptop
parents: 0
diff changeset
48 else()
67a6978503b7 fixing Windows build
Jodogne@Laptop
parents: 0
diff changeset
49 include(FindCURL)
67a6978503b7 fixing Windows build
Jodogne@Laptop
parents: 0
diff changeset
50 include_directories(${CURL_INCLUDE_DIRS})
67a6978503b7 fixing Windows build
Jodogne@Laptop
parents: 0
diff changeset
51 link_libraries(${CURL_LIBRARIES})
67a6978503b7 fixing Windows build
Jodogne@Laptop
parents: 0
diff changeset
52
67a6978503b7 fixing Windows build
Jodogne@Laptop
parents: 0
diff changeset
53 if (NOT ${CURL_FOUND})
67a6978503b7 fixing Windows build
Jodogne@Laptop
parents: 0
diff changeset
54 message(FATAL_ERROR "Unable to find LibCurl")
67a6978503b7 fixing Windows build
Jodogne@Laptop
parents: 0
diff changeset
55 endif()
67a6978503b7 fixing Windows build
Jodogne@Laptop
parents: 0
diff changeset
56 endif()