changeset 2148:e18023c2fdfb

fix visual studio 2015 build
author Sebastien Jodogne <s.jodogne@gmail.com>
date Thu, 10 Nov 2016 08:47:31 +0100
parents 8466aa60544a
children e438b5964d77
files Resources/CMake/Compiler.cmake
diffstat 1 files changed, 11 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/Resources/CMake/Compiler.cmake	Wed Nov 09 17:37:47 2016 +0100
+++ b/Resources/CMake/Compiler.cmake	Thu Nov 10 08:47:31 2016 +0100
@@ -41,7 +41,17 @@
     -D_CRT_SECURE_NO_WARNINGS=1
     -D_CRT_SECURE_NO_DEPRECATE=1
     )
-  include_directories(${ORTHANC_ROOT}/Resources/ThirdParty/VisualStudio)
+
+  if (MSVC_VERSION LESS 1600)
+    # Starting with Visual Studio >= 2010 (i.e. macro _MSC_VER >=
+    # 1600), Microsoft ships a standard-compliant <stdint.h>
+    # header. For earlier versions of Visual Studio, give access to a
+    # compatibility header.
+    # http://stackoverflow.com/a/70630/881731
+    # https://en.wikibooks.org/wiki/C_Programming/C_Reference/stdint.h#External_links
+    include_directories(${ORTHANC_ROOT}/Resources/ThirdParty/VisualStudio)
+  endif()
+
   link_libraries(netapi32)
 endif()