Mercurial > hg > orthanc
annotate Plugins/Samples/ServeFolders/CMakeLists.txt @ 1379:d0bb3dd34e2d
find build on old versions of MinGW
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Fri, 29 May 2015 12:59:43 +0200 |
parents | a761deb85729 |
children | 92da9e1c2daa |
rev | line source |
---|---|
1322
f497a72d9f71
fixes to the sample plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1 cmake_minimum_required(VERSION 2.8) |
f497a72d9f71
fixes to the sample plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2 |
f497a72d9f71
fixes to the sample plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3 project(ServeFolders) |
f497a72d9f71
fixes to the sample plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4 |
1323
5a92665dee23
Sample plugin: Serve folders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1322
diff
changeset
|
5 set(ALLOW_DOWNLOADS ON) |
5a92665dee23
Sample plugin: Serve folders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1322
diff
changeset
|
6 set(USE_SYSTEM_JSONCPP OFF) |
5a92665dee23
Sample plugin: Serve folders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1322
diff
changeset
|
7 include(../../../Resources/CMake/DownloadPackage.cmake) |
5a92665dee23
Sample plugin: Serve folders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1322
diff
changeset
|
8 include(../../../Resources/CMake/JsonCppConfiguration.cmake) |
5a92665dee23
Sample plugin: Serve folders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1322
diff
changeset
|
9 |
1322
f497a72d9f71
fixes to the sample plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
10 if (${CMAKE_SYSTEM_NAME} STREQUAL "Linux") |
f497a72d9f71
fixes to the sample plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
11 link_libraries(uuid) |
f497a72d9f71
fixes to the sample plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
12 SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -pthread") |
f497a72d9f71
fixes to the sample plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
13 SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -pthread") |
f497a72d9f71
fixes to the sample plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
14 elseif (${CMAKE_SYSTEM_NAME} STREQUAL "Windows") |
f497a72d9f71
fixes to the sample plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
15 link_libraries(rpcrt4 ws2_32 secur32) |
f497a72d9f71
fixes to the sample plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
16 if (CMAKE_COMPILER_IS_GNUCXX) |
f497a72d9f71
fixes to the sample plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
17 SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -static-libgcc -static-libstdc++") |
f497a72d9f71
fixes to the sample plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
18 endif() |
f497a72d9f71
fixes to the sample plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
19 endif () |
f497a72d9f71
fixes to the sample plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
20 |
f497a72d9f71
fixes to the sample plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
21 if (CMAKE_COMPILER_IS_GNUCXX) |
f497a72d9f71
fixes to the sample plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
22 SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--version-script=${CMAKE_SOURCE_DIR}/VersionScript.map -Wl,--no-undefined") |
f497a72d9f71
fixes to the sample plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
23 endif() |
f497a72d9f71
fixes to the sample plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
24 |
f497a72d9f71
fixes to the sample plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
25 include_directories(${CMAKE_SOURCE_DIR}/../../Include/) |
1325 | 26 add_library(ServeFolders SHARED |
1323
5a92665dee23
Sample plugin: Serve folders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1322
diff
changeset
|
27 Plugin.cpp |
5a92665dee23
Sample plugin: Serve folders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1322
diff
changeset
|
28 ${THIRD_PARTY_SOURCES} |
5a92665dee23
Sample plugin: Serve folders
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1322
diff
changeset
|
29 ) |
1322
f497a72d9f71
fixes to the sample plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
30 |
f497a72d9f71
fixes to the sample plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
31 if (${CMAKE_SYSTEM_NAME} STREQUAL "Linux") |
f497a72d9f71
fixes to the sample plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
32 # Linking with "pthread" is necessary, otherwise the software crashes |
f497a72d9f71
fixes to the sample plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
33 # http://sourceware.org/bugzilla/show_bug.cgi?id=10652#c17 |
1325 | 34 target_link_libraries(ServeFolders dl rt) |
1322
f497a72d9f71
fixes to the sample plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
35 endif() |