# HG changeset patch # User jodogne # Date 1380105933 -7200 # Node ID 3f27814104f7e3bfee4e95ee77f1bbaead490644 # Parent 6a3e2ca7a7a009101cc70272e5361ca2f8a87a07 compile with msvc diff -r 6a3e2ca7a7a0 -r 3f27814104f7 CMakeLists.txt --- a/CMakeLists.txt Tue Sep 24 15:12:51 2013 +0200 +++ b/CMakeLists.txt Wed Sep 25 12:45:33 2013 +0200 @@ -268,12 +268,16 @@ include_directories(${ORTHANC_ROOT}/OrthancCppClient/Package/Laaw) if (${CMAKE_SYSTEM_NAME} STREQUAL "Windows") - if (${CMAKE_SIZEOF_VOID_P} EQUAL 4) - set(ORTHANC_CPP_CLIENT_AUX ${ORTHANC_ROOT}/OrthancCppClient/Package/AUTOGENERATED/Windows32.def) - elseif (${CMAKE_SIZEOF_VOID_P} EQUAL 8) - set(ORTHANC_CPP_CLIENT_AUX ${ORTHANC_ROOT}/OrthancCppClient/Package/AUTOGENERATED/Windows64.def) + if (CMAKE_CROSS_COMPILING) + if (${CMAKE_SIZEOF_VOID_P} EQUAL 4) + set(ORTHANC_CPP_CLIENT_AUX ${ORTHANC_ROOT}/OrthancCppClient/Package/AUTOGENERATED/Windows32.def) + elseif (${CMAKE_SIZEOF_VOID_P} EQUAL 8) + set(ORTHANC_CPP_CLIENT_AUX ${ORTHANC_ROOT}/OrthancCppClient/Package/AUTOGENERATED/Windows64.def) + else() + message(FATAL_ERROR "Support your platform here") + endif() else() - message(FATAL_ERROR "Support your platform here") + set(ORTHANC_CPP_CLIENT_AUX ${OPENSSL_SOURCES}) endif() else() set(ORTHANC_CPP_CLIENT_AUX ${OPENSSL_SOURCES}) @@ -308,15 +312,14 @@ ) target_link_libraries(OrthancClient pthread) elseif (${CMAKE_SYSTEM_NAME} STREQUAL "Windows") - target_link_libraries(OrthancClient OpenSSL) - - if (${CMAKE_COMPILER_IS_GNUCXX}) + if (CMAKE_CROSS_COMPILING) + target_link_libraries(OrthancClient OpenSSL) set_target_properties(OrthancClient PROPERTIES LINK_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--allow-multiple-definition -static-libgcc -static-libstdc++" ) target_link_libraries(OrthancClient ws2_32) else() - message(FATAL_ERROR "Support Visual Studio here") + #message(FATAL_ERROR "Support Visual Studio here") endif() else() message(FATAL_ERROR "Support your platform here") diff -r 6a3e2ca7a7a0 -r 3f27814104f7 Core/Compression/ZipWriter.cpp --- a/Core/Compression/ZipWriter.cpp Tue Sep 24 15:12:51 2013 +0200 +++ b/Core/Compression/ZipWriter.cpp Wed Sep 25 12:45:33 2013 +0200 @@ -29,11 +29,15 @@ * along with this program. If not, see . **/ +#ifdef _WIN32 +#define NOMINMAX +#endif #include "ZipWriter.h" #include "../../Resources/minizip/zip.h" #include +#include #include "../OrthancException.h" diff -r 6a3e2ca7a7a0 -r 3f27814104f7 Core/Toolbox.cpp --- a/Core/Toolbox.cpp Tue Sep 24 15:12:51 2013 +0200 +++ b/Core/Toolbox.cpp Wed Sep 25 12:45:33 2013 +0200 @@ -68,6 +68,19 @@ #include "../Resources/sha1/sha1.h" +#ifdef _MSC_VER +// Patch for the missing "_strtoll" symbol when compiling with Visual Studio +extern "C" +{ +int64_t _strtoi64(const char *nptr, char **endptr, int base); +int64_t strtoll(const char *nptr, char **endptr, int base) +{ + return _strtoi64(nptr, endptr, base); +} +} +#endif + + #if BOOST_HAS_LOCALE == 0 namespace {