diff CMakeLists.txt @ 540:eaca3d38b2aa laaw

many fixes
author Sebastien Jodogne <s.jodogne@gmail.com>
date Thu, 12 Sep 2013 12:55:07 +0200
parents ff8bee6459cd
children fe796b053863
line wrap: on
line diff
--- a/CMakeLists.txt	Mon Aug 12 10:56:35 2013 +0200
+++ b/CMakeLists.txt	Thu Sep 12 12:55:07 2013 +0200
@@ -287,7 +287,7 @@
   set(ORTHANC_CPP_CLIENT_AUX ${OPENSSL_SOURCES})
 endif()
 
-add_library(OrthancCppClient SHARED
+add_library(OrthancClient SHARED
   ${ORTHANC_ROOT}/Core/OrthancException.cpp
   ${ORTHANC_ROOT}/Core/Enumerations.cpp
   ${ORTHANC_ROOT}/Core/Toolbox.cpp
@@ -311,18 +311,18 @@
   )
 
 if (${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
-  set_target_properties(OrthancCppClient
+  set_target_properties(OrthancClient
     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(OrthancCppClient pthread)
+  target_link_libraries(OrthancClient pthread)
 elseif (${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
-  target_link_libraries(OrthancCppClient OpenSSL)
+  target_link_libraries(OrthancClient OpenSSL)
 
   if (${CMAKE_COMPILER_IS_GNUCXX})
-    set_target_properties(OrthancCppClient
+    set_target_properties(OrthancClient
       PROPERTIES LINK_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--allow-multiple-definition -static-libgcc -static-libstdc++"
       )
-    target_link_libraries(OrthancCppClient ws2_32)
+    target_link_libraries(OrthancClient ws2_32)
   else()
     message(FATAL_ERROR "Support Visual Studio here")
   endif()
@@ -330,6 +330,12 @@
   message(FATAL_ERROR "Support your platform here")
 endif()
 
+# Copy the header file of the client library to the build directory
+add_custom_command(
+  TARGET OrthancClient PRE_BUILD
+  COMMAND ${CMAKE_COMMAND} -E copy
+  ${ORTHANC_ROOT}/OrthancCppClient/Package/AUTOGENERATED/OrthancCppClient.h 
+  ${CMAKE_BINARY_DIR})
 
 
 #####################################################################