changeset 1536:1b03676d68c2

fix windows build
author Sebastien Jodogne <s.jodogne@gmail.com>
date Thu, 13 Aug 2015 14:16:11 +0200
parents 34c8954544e8
children fbf763bb1fa3
files Resources/CMake/LibCurlConfiguration.cmake
diffstat 1 files changed, 12 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/Resources/CMake/LibCurlConfiguration.cmake	Thu Aug 13 13:41:59 2015 +0200
+++ b/Resources/CMake/LibCurlConfiguration.cmake	Thu Aug 13 14:16:11 2015 +0200
@@ -7,7 +7,6 @@
 
   include_directories(
     ${CURL_SOURCES_DIR}/include
-    ${CURL_SOURCES_DIR}/lib
     )
 
   AUX_SOURCE_DIRECTORY(${CURL_SOURCES_DIR}/lib CURL_SOURCES)
@@ -15,12 +14,10 @@
   source_group(ThirdParty\\LibCurl REGULAR_EXPRESSION ${CURL_SOURCES_DIR}/.*)
 
   add_definitions(
+    -DBUILDING_LIBCURL=1
     -DCURL_STATICLIB=1
-    -DBUILDING_LIBCURL=1
     -DCURL_DISABLE_LDAPS=1
     -DCURL_DISABLE_LDAP=1
-    -D_WIN32_WINNT=0x0501
-
     -DCURL_DISABLE_DICT=1
     -DCURL_DISABLE_FILE=1
     -DCURL_DISABLE_FTP=1
@@ -34,6 +31,10 @@
     -DCURL_DISABLE_TFTP=1
     )
 
+  if (${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
+    add_definitions(-D_WIN32_WINNT=0x0501)
+  endif()
+
   if (ENABLE_SSL)
     add_definitions(
       #-DHAVE_LIBSSL=1
@@ -44,10 +45,14 @@
 
   file(WRITE ${CURL_SOURCES_DIR}/lib/curl_config.h "")
 
+  file(GLOB CURL_LIBS_HEADERS ${CURL_SOURCES_DIR}/lib/*.h)
+  foreach (header IN LISTS CURL_LIBS_HEADERS)
+    get_filename_component(filename ${header} NAME)
+    file(WRITE ${CURL_SOURCES_DIR}/lib/vtls/${filename} "#include \"../${filename}\"\n")
+  endforeach()
+
   if (MSVC)
-    #add_definitions(
-    #  -DHAVE_BOOL_T=1
-    #  )
+    add_definitions(-DHAVE_BOOL_T=1)
 
   elseif (${CMAKE_SYSTEM_NAME} STREQUAL "Linux" OR
       ${CMAKE_SYSTEM_NAME} STREQUAL "Darwin" OR