Mercurial > hg > orthanc-wsi
changeset 52:5f0c6f3871a3
fix for msvc
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Wed, 16 Nov 2016 22:47:14 +0100 |
parents | 742ecdb006a1 |
children | 175d06fa292e |
files | Resources/CMake/LibTiffConfiguration.cmake |
diffstat | 1 files changed, 16 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/Resources/CMake/LibTiffConfiguration.cmake Wed Nov 16 21:51:08 2016 +0100 +++ b/Resources/CMake/LibTiffConfiguration.cmake Wed Nov 16 22:47:14 2016 +0100 @@ -19,7 +19,7 @@ # include <windows.h> # define ssize_t SSIZE_T # endif -# if !defined(snprintf) +# if !defined(snprintf) && (_MSC_VER < 1900) # define snprintf _snprintf # endif #endif @@ -51,11 +51,22 @@ -DHAVE_SNPRINTF=1 -DJPEG_SUPPORT=1 -DLZW_SUPPORT=1 + ) - -DTIFF_INT64_FORMAT="%lld" - -DTIFF_UINT64_FORMAT="%llu" - -DTIFF_SSIZE_FORMAT="%d" - ) + if (MSVC) + # The "%" must be escaped if using Visual Studio + add_definitions( + -DTIFF_INT64_FORMAT="%%lld" + -DTIFF_UINT64_FORMAT="%%llu" + -DTIFF_SSIZE_FORMAT="%%d" + ) + else() + add_definitions( + -DTIFF_INT64_FORMAT="%lld" + -DTIFF_UINT64_FORMAT="%llu" + -DTIFF_SSIZE_FORMAT="%d" + ) + endif() set(LIBTIFF_SOURCES #${LIBTIFF_SOURCES_DIR}/libtiff/mkg3states.c