comparison CMakeLists.txt @ 525:ff8bee6459cd laaw

fix build
author Sebastien Jodogne <s.jodogne@gmail.com>
date Fri, 19 Jul 2013 16:47:41 +0200
parents 81cb140941a5
children eaca3d38b2aa
comparison
equal deleted inserted replaced
522:81cb140941a5 525:ff8bee6459cd
275 275
276 include_directories(${ORTHANC_ROOT}/OrthancCppClient/Package/Laaw) 276 include_directories(${ORTHANC_ROOT}/OrthancCppClient/Package/Laaw)
277 277
278 if (${CMAKE_SYSTEM_NAME} STREQUAL "Windows") 278 if (${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
279 if (${CMAKE_SIZEOF_VOID_P} EQUAL 4) 279 if (${CMAKE_SIZEOF_VOID_P} EQUAL 4)
280 set(ORTHANC_CPP_CLIENT_DEF ${ORTHANC_ROOT}/OrthancCppClient/Package/Build/Windows32.def) 280 set(ORTHANC_CPP_CLIENT_AUX ${ORTHANC_ROOT}/OrthancCppClient/Package/Build/Windows32.def)
281 elseif (${CMAKE_SIZEOF_VOID_P} EQUAL 8) 281 elseif (${CMAKE_SIZEOF_VOID_P} EQUAL 8)
282 set(ORTHANC_CPP_CLIENT_DEF ${ORTHANC_ROOT}/OrthancCppClient/Package/Build/Windows64.def) 282 set(ORTHANC_CPP_CLIENT_AUX ${ORTHANC_ROOT}/OrthancCppClient/Package/Build/Windows64.def)
283 else() 283 else()
284 message(FATAL_ERROR "Support your platform here") 284 message(FATAL_ERROR "Support your platform here")
285 endif() 285 endif()
286 else()
287 set(ORTHANC_CPP_CLIENT_AUX ${OPENSSL_SOURCES})
286 endif() 288 endif()
287 289
288 add_library(OrthancCppClient SHARED 290 add_library(OrthancCppClient SHARED
289 ${ORTHANC_ROOT}/Core/OrthancException.cpp 291 ${ORTHANC_ROOT}/Core/OrthancException.cpp
290 ${ORTHANC_ROOT}/Core/Enumerations.cpp 292 ${ORTHANC_ROOT}/Core/Enumerations.cpp
301 ${ORTHANC_ROOT}/OrthancCppClient/Patient.cpp 303 ${ORTHANC_ROOT}/OrthancCppClient/Patient.cpp
302 ${ORTHANC_ROOT}/OrthancCppClient/Package/SharedLibrary.cpp 304 ${ORTHANC_ROOT}/OrthancCppClient/Package/SharedLibrary.cpp
303 ${ORTHANC_ROOT}/Resources/sha1/sha1.cpp 305 ${ORTHANC_ROOT}/Resources/sha1/sha1.cpp
304 ${ORTHANC_ROOT}/Resources/md5/md5.c 306 ${ORTHANC_ROOT}/Resources/md5/md5.c
305 ${ORTHANC_ROOT}/Resources/base64/base64.cpp 307 ${ORTHANC_ROOT}/Resources/base64/base64.cpp
306 ${ORTHANC_CPP_CLIENT_DEF} 308 ${ORTHANC_CPP_CLIENT_AUX}
307 ${THIRD_PARTY_SOURCES} 309 ${THIRD_PARTY_SOURCES}
308 ${OPENSSL_SOURCES}
309 ${CURL_SOURCES} 310 ${CURL_SOURCES}
310 ) 311 )
311 312
312 if (${CMAKE_SYSTEM_NAME} STREQUAL "Linux") 313 if (${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
313 set_target_properties(OrthancCppClient 314 set_target_properties(OrthancCppClient
314 PROPERTIES LINK_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--no-undefined -Wl,--as-needed -Wl,--version-script=${ORTHANC_ROOT}/OrthancCppClient/Package/Laaw/VersionScript.map" 315 PROPERTIES LINK_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--no-undefined -Wl,--as-needed -Wl,--version-script=${ORTHANC_ROOT}/OrthancCppClient/Package/Laaw/VersionScript.map"
315 ) 316 )
316 target_link_libraries(OrthancCppClient pthread) 317 target_link_libraries(OrthancCppClient pthread)
317 elseif (${CMAKE_SYSTEM_NAME} STREQUAL "Windows") 318 elseif (${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
319 target_link_libraries(OrthancCppClient OpenSSL)
320
318 if (${CMAKE_COMPILER_IS_GNUCXX}) 321 if (${CMAKE_COMPILER_IS_GNUCXX})
319 set_target_properties(OrthancCppClient 322 set_target_properties(OrthancCppClient
320 PROPERTIES LINK_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--allow-multiple-definition -static-libgcc -static-libstdc++" 323 PROPERTIES LINK_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--allow-multiple-definition -static-libgcc -static-libstdc++"
321 ) 324 )
322 target_link_libraries(OrthancCppClient ws2_32) 325 target_link_libraries(OrthancCppClient ws2_32)