diff Plugins/Samples/Common/OrthancPlugins.cmake @ 1669:a412ad57f0f9 db-changes

refactoring of sample plugins, OrthancPluginReconstructMainDicomTags
author Sebastien Jodogne <s.jodogne@gmail.com>
date Thu, 01 Oct 2015 11:55:25 +0200
parents fe458dde986e
children 41b70d5b44c9
line wrap: on
line diff
--- a/Plugins/Samples/Common/OrthancPlugins.cmake	Wed Sep 30 17:18:39 2015 +0200
+++ b/Plugins/Samples/Common/OrthancPlugins.cmake	Thu Oct 01 11:55:25 2015 +0200
@@ -1,34 +1,11 @@
+set(ORTHANC_ROOT ${SAMPLES_ROOT}/../..)
 include(CheckIncludeFiles)
+include(CheckIncludeFileCXX)
 include(CheckLibraryExists)
-
-
-if (${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
-  link_libraries(uuid)
-  SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -pthread")
-  SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -pthread")
-
-elseif (${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
-  link_libraries(rpcrt4 ws2_32 secur32)
-  if (CMAKE_COMPILER_IS_GNUCXX)
-    SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -static-libgcc -static-libstdc++")
-  endif()
-
-  CHECK_LIBRARY_EXISTS(winpthread pthread_create "" HAVE_WIN_PTHREAD)
-  if (HAVE_WIN_PTHREAD)
-    # This line is necessary to compile with recent versions of MinGW,
-    # otherwise "libwinpthread-1.dll" is not statically linked.
-    SET(CMAKE_CXX_STANDARD_LIBRARIES "${CMAKE_CXX_STANDARD_LIBRARIES} -Wl,-Bstatic -lstdc++ -lpthread -Wl,-Bdynamic")
-  endif()
-endif ()
-
-
-if (${CMAKE_SYSTEM_NAME} STREQUAL "Linux" OR
-    ${CMAKE_SYSTEM_NAME} STREQUAL "kFreeBSD" OR
-    ${CMAKE_SYSTEM_NAME} STREQUAL "FreeBSD")
-  SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--version-script=${SAMPLES_ROOT}/Common/VersionScript.map -Wl,--no-undefined")
-elseif (${CMAKE_SYSTEM_NAME} STREQUAL "Darwin")
-  SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -exported_symbols_list ${CMAKE_SOURCE_DIR}/Plugins/Samples/Common/ExportedSymbols.list")
-endif()
+include(FindPythonInterp)
+include(${ORTHANC_ROOT}/Resources/CMake/AutoGeneratedCode.cmake)
+include(${ORTHANC_ROOT}/Resources/CMake/DownloadPackage.cmake)
+include(${ORTHANC_ROOT}/Resources/CMake/Compiler.cmake)
 
 
 if (CMAKE_COMPILER_IS_GNUCXX)
@@ -43,8 +20,10 @@
   link_libraries(dl rt)
 endif()
 
+
 include_directories(${SAMPLES_ROOT}/../Include/)
 
+
 if (MSVC)
   include_directories(${SAMPLES_ROOT}/../../Resources/ThirdParty/VisualStudio/)
 endif()