Mercurial > hg > orthanc
diff CMakeLists.txt @ 569:701d748cf327 laaw
fixes
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Wed, 25 Sep 2013 13:18:19 +0200 |
parents | 3f27814104f7 |
children | 86c5bb651bfa |
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()