changeset 1560:307b9ea6c39b

fixes for Visual Studio 2013 and QtCreator
author Sebastien Jodogne <s.jodogne@gmail.com>
date Fri, 21 Aug 2015 11:43:24 +0200
parents 1e6fbb2dcc6f
children c9e0e709485b 2084b7c20478
files Resources/CMake/Compiler.cmake Resources/CMake/LibCurlConfiguration.cmake Resources/CMake/VisualStudioPrecompiledHeaders.cmake
diffstat 3 files changed, 18 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/Resources/CMake/Compiler.cmake	Fri Aug 21 10:12:56 2015 +0200
+++ b/Resources/CMake/Compiler.cmake	Fri Aug 21 11:43:24 2015 +0200
@@ -69,8 +69,24 @@
   endif()
 
 elseif(${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
+  if (MSVC)
+    message("MSVC compiler version = " ${MSVC_VERSION} "\n")
+    # Starting Visual Studio 2013 (version 1800), it is not possible
+    # to target Windows XP anymore
+    if (MSVC_VERSION LESS 1800)
+      add_definitions(
+        -DWINVER=0x0501
+        -D_WIN32_WINNT=0x0501
+        )
+    endif()
+  else()
+    add_definitions(
+      -DWINVER=0x0501
+      -D_WIN32_WINNT=0x0501
+      )
+  endif()
+
   add_definitions(
-    -DWINVER=0x0501
     -D_CRT_SECURE_NO_WARNINGS=1
     )
   link_libraries(rpcrt4 ws2_32)
--- a/Resources/CMake/LibCurlConfiguration.cmake	Fri Aug 21 10:12:56 2015 +0200
+++ b/Resources/CMake/LibCurlConfiguration.cmake	Fri Aug 21 11:43:24 2015 +0200
@@ -31,10 +31,6 @@
     -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
--- a/Resources/CMake/VisualStudioPrecompiledHeaders.cmake	Fri Aug 21 10:12:56 2015 +0200
+++ b/Resources/CMake/VisualStudioPrecompiledHeaders.cmake	Fri Aug 21 11:43:24 2015 +0200
@@ -1,6 +1,6 @@
 macro(ADD_VISUAL_STUDIO_PRECOMPILED_HEADERS PrecompiledHeaders PrecompiledSource Sources)
   get_filename_component(PrecompiledBasename ${PrecompiledHeaders} NAME_WE)
-  set(PrecompiledBinary "$(IntDir)/${PrecompiledBasename}.pch")
+  set(PrecompiledBinary "${PrecompiledBasename}_$(Configuration).pch")
 
   set_source_files_properties(${PrecompiledSource}
     PROPERTIES COMPILE_FLAGS "/Yc\"${PrecompiledHeaders}\" /Fp\"${PrecompiledBinary}\""