comparison Plugins/Samples/ServeFolders/CMakeLists.txt @ 1390:92da9e1c2daa

improvement of samples
author Sebastien Jodogne <s.jodogne@gmail.com>
date Fri, 29 May 2015 17:24:01 +0200
parents a761deb85729
children b3119c32c920
comparison
equal deleted inserted replaced
1389:c236a8b35a3b 1390:92da9e1c2daa
1 cmake_minimum_required(VERSION 2.8) 1 cmake_minimum_required(VERSION 2.8)
2 2
3 project(ServeFolders) 3 project(ServeFolders)
4 4
5 set(ALLOW_DOWNLOADS ON) 5 SET(ALLOW_DOWNLOADS OFF CACHE BOOL "Allow CMake to download packages")
6 set(USE_SYSTEM_JSONCPP OFF) 6 SET(USE_SYSTEM_JSONCPP ON CACHE BOOL "Use the system version of JsonCpp")
7 include(../../../Resources/CMake/DownloadPackage.cmake)
8 include(../../../Resources/CMake/JsonCppConfiguration.cmake)
9 7
10 if (${CMAKE_SYSTEM_NAME} STREQUAL "Linux") 8 set(ORTHANC_ROOT ${CMAKE_SOURCE_DIR}/../../../)
11 link_libraries(uuid)
12 SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -pthread")
13 SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -pthread")
14 elseif (${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
15 link_libraries(rpcrt4 ws2_32 secur32)
16 if (CMAKE_COMPILER_IS_GNUCXX)
17 SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -static-libgcc -static-libstdc++")
18 endif()
19 endif ()
20 9
21 if (CMAKE_COMPILER_IS_GNUCXX) 10 include(CheckIncludeFiles)
22 SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--version-script=${CMAKE_SOURCE_DIR}/VersionScript.map -Wl,--no-undefined") 11 include(CheckIncludeFileCXX)
23 endif() 12 include(${CMAKE_SOURCE_DIR}/../Common/OrthancPlugins.cmake)
13 include(${ORTHANC_ROOT}/Resources/CMake/DownloadPackage.cmake)
14 include(${ORTHANC_ROOT}/Resources/CMake/JsonCppConfiguration.cmake)
24 15
25 include_directories(${CMAKE_SOURCE_DIR}/../../Include/)
26 add_library(ServeFolders SHARED 16 add_library(ServeFolders SHARED
27 Plugin.cpp 17 Plugin.cpp
28 ${THIRD_PARTY_SOURCES} 18 ${THIRD_PARTY_SOURCES}
29 ) 19 )
30
31 if (${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
32 # Linking with "pthread" is necessary, otherwise the software crashes
33 # http://sourceware.org/bugzilla/show_bug.cgi?id=10652#c17
34 target_link_libraries(ServeFolders dl rt)
35 endif()