Mercurial > hg > orthanc
changeset 569:701d748cf327 laaw
fixes
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Wed, 25 Sep 2013 13:18:19 +0200 |
parents | 3f27814104f7 |
children | 86c5bb651bfa |
files | CMakeLists.txt OrthancCppClient/Package/AUTOGENERATED/Windows32.def Resources/CMake/Compiler.cmake Resources/CMake/GoogleLogConfiguration.cmake |
diffstat | 4 files changed, 23 insertions(+), 9 deletions(-) [+] |
line wrap: on
line diff
--- a/CMakeLists.txt Wed Sep 25 12:45:33 2013 +0200 +++ b/CMakeLists.txt Wed Sep 25 13:18:19 2013 +0200 @@ -53,7 +53,7 @@ ##################################################################### # Configuration of the standalone builds -if (${CMAKE_CROSSCOMPILING}) +if (CMAKE_CROSSCOMPILING) # Cross-compilation implies the standalone build SET(STANDALONE_BUILD ON) endif() @@ -268,7 +268,10 @@ include_directories(${ORTHANC_ROOT}/OrthancCppClient/Package/Laaw) if (${CMAKE_SYSTEM_NAME} STREQUAL "Windows") - if (CMAKE_CROSS_COMPILING) + if (CMAKE_CROSSCOMPILING) + # Remove the default "lib" prefix from "libOrthancClient.dll" if cross-compiling + set(CMAKE_SHARED_LIBRARY_PREFIX "") + 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) @@ -311,16 +314,17 @@ PROPERTIES LINK_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--no-undefined -Wl,--as-needed -Wl,--version-script=${ORTHANC_ROOT}/OrthancCppClient/Package/Laaw/VersionScript.map" ) target_link_libraries(OrthancClient pthread) + elseif (${CMAKE_SYSTEM_NAME} STREQUAL "Windows") - if (CMAKE_CROSS_COMPILING) - target_link_libraries(OrthancClient OpenSSL) + if (CMAKE_CROSSCOMPILING) + target_link_libraries(OrthancClient OpenSSL ws2_32) 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") endif()
--- a/OrthancCppClient/Package/AUTOGENERATED/Windows32.def Wed Sep 25 12:45:33 2013 +0200 +++ b/OrthancCppClient/Package/AUTOGENERATED/Windows32.def Wed Sep 25 13:18:19 2013 +0200 @@ -60,4 +60,11 @@ _LAAW_EXTERNC_6f2d77a26edc91c28d89408dbc3c271e@8 = LAAW_EXTERNC_6f2d77a26edc91c28d89408dbc3c271e@8 _LAAW_EXTERNC_6c5ad02f91b583e29cebd0bd319ce21d@12 = LAAW_EXTERNC_6c5ad02f91b583e29cebd0bd319ce21d@12 _LAAW_EXTERNC_4068241c44a9c1367fe0e57be523f207@4 = LAAW_EXTERNC_4068241c44a9c1367fe0e57be523f207@4 - _LAAW_EXTERNC_GetDescription@0 = LAAW_EXTERNC_GetDescription@0 _LAAW_EXTERNC_GetCompany@0 = LAAW_EXTERNC_GetCompany@0 _LAAW_EXTERNC_GetProduct@0 = LAAW_EXTERNC_GetProduct@0 _LAAW_EXTERNC_GetCopyright@0 = LAAW_EXTERNC_GetCopyright@0 _LAAW_EXTERNC_GetVersion@0 = LAAW_EXTERNC_GetVersion@0 _LAAW_EXTERNC_GetFileVersion@0 = LAAW_EXTERNC_GetFileVersion@0 _LAAW_EXTERNC_GetFullVersion@0 = LAAW_EXTERNC_GetFullVersion@0 _LAAW_EXTERNC_FreeString@4 = LAAW_EXTERNC_FreeString@4 \ No newline at end of file + _LAAW_EXTERNC_GetDescription@0 = LAAW_EXTERNC_GetDescription@0 + _LAAW_EXTERNC_GetCompany@0 = LAAW_EXTERNC_GetCompany@0 + _LAAW_EXTERNC_GetProduct@0 = LAAW_EXTERNC_GetProduct@0 + _LAAW_EXTERNC_GetCopyright@0 = LAAW_EXTERNC_GetCopyright@0 + _LAAW_EXTERNC_GetVersion@0 = LAAW_EXTERNC_GetVersion@0 + _LAAW_EXTERNC_GetFileVersion@0 = LAAW_EXTERNC_GetFileVersion@0 + _LAAW_EXTERNC_GetFullVersion@0 = LAAW_EXTERNC_GetFullVersion@0 + _LAAW_EXTERNC_FreeString@4 = LAAW_EXTERNC_FreeString@4
--- a/Resources/CMake/Compiler.cmake Wed Sep 25 12:45:33 2013 +0200 +++ b/Resources/CMake/Compiler.cmake Wed Sep 25 13:18:19 2013 +0200 @@ -6,6 +6,8 @@ # -pedantic gives a lot of warnings on OpenSSL set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -pedantic -Wno-long-long -Wno-variadic-macros") elseif (${MSVC}) + # Use static runtime under Visual Studio + # http://www.cmake.org/Wiki/CMake_FAQ#Dynamic_Replace # http://stackoverflow.com/a/6510446 foreach(flag_var CMAKE_C_FLAGS_DEBUG @@ -19,6 +21,7 @@ string(REGEX REPLACE "/MD" "/MT" ${flag_var} "${${flag_var}}") string(REGEX REPLACE "/MDd" "/MTd" ${flag_var} "${${flag_var}}") endforeach(flag_var) + add_definitions( -D_CRT_SECURE_NO_WARNINGS=1 -D_CRT_SECURE_NO_DEPRECATE=1
--- a/Resources/CMake/GoogleLogConfiguration.cmake Wed Sep 25 12:45:33 2013 +0200 +++ b/Resources/CMake/GoogleLogConfiguration.cmake Wed Sep 25 13:18:19 2013 +0200 @@ -49,7 +49,7 @@ ) if (CMAKE_COMPILER_IS_GNUCXX) - if (${CMAKE_SYSTEM_VERSION} STREQUAL "LinuxStandardBase") + if ("${CMAKE_SYSTEM_VERSION}" STREQUAL "LinuxStandardBase") execute_process( COMMAND patch utilities.cc ${CMAKE_SOURCE_DIR}/Resources/Patches/glog-utilities-lsb.diff WORKING_DIRECTORY ${GOOGLE_LOG_SOURCES_DIR}/src @@ -72,7 +72,7 @@ endif() if (${CMAKE_SYSTEM_NAME} STREQUAL "Linux") - if (${CMAKE_SYSTEM_VERSION} STREQUAL "LinuxStandardBase") + if ("${CMAKE_SYSTEM_VERSION}" STREQUAL "LinuxStandardBase") # Install the specific configuration for LSB SDK configure_file( ${CMAKE_SOURCE_DIR}/Resources/CMake/GoogleLogConfigurationLSB.h