Mercurial > hg > orthanc
annotate Plugins/Samples/WebSkeleton/Framework/Framework.cmake @ 1318:6e275e35d01c Orthanc-0.8.6
set version
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Thu, 12 Feb 2015 14:47:38 +0100 |
parents | 6e7e5ed91c2d |
children | 3d76e26b3865 |
rev | line source |
---|---|
1181
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1 # Orthanc - A Lightweight, RESTful DICOM Store |
1288
6e7e5ed91c2d
upgrade to year 2015
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1181
diff
changeset
|
2 # Copyright (C) 2012-2015 Sebastien Jodogne, Medical Physics |
6e7e5ed91c2d
upgrade to year 2015
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1181
diff
changeset
|
3 # Department, University Hospital of Liege, Belgium |
1181
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4 # |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5 # This program is free software: you can redistribute it and/or |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
6 # modify it under the terms of the GNU General Public License as |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
7 # published by the Free Software Foundation, either version 3 of the |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
8 # License, or (at your option) any later version. |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
9 # |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
10 # In addition, as a special exception, the copyright holders of this |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
11 # program give permission to link the code of its release with the |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
12 # OpenSSL project's "OpenSSL" library (or with modified versions of it |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
13 # that use the same license as the "OpenSSL" library), and distribute |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
14 # the linked executables. You must obey the GNU General Public License |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
15 # in all respects for all of the code used other than "OpenSSL". If you |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
16 # modify file(s) with this exception, you may extend this exception to |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
17 # your version of the file(s), but you are not obligated to do so. If |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
18 # you do not wish to do so, delete this exception statement from your |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
19 # version. If you delete this exception statement from all source files |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
20 # in the program, then also delete it here. |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
21 # |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
22 # This program is distributed in the hope that it will be useful, but |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
23 # WITHOUT ANY WARRANTY; without even the implied warranty of |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
24 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
25 # General Public License for more details. |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
26 # |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
27 # You should have received a copy of the GNU General Public License |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
28 # along with this program. If not, see <http://www.gnu.org/licenses/>. |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
29 |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
30 |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
31 if (${CMAKE_COMPILER_IS_GNUCXX}) |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
32 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -pedantic -Werror -Wno-unused-function") |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
33 endif() |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
34 |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
35 if (${CMAKE_SYSTEM_NAME} STREQUAL "Linux") |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
36 # Linking with "pthread" is necessary, otherwise the software might crash |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
37 # http://sourceware.org/bugzilla/show_bug.cgi?id=10652#c17 |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
38 link_libraries(pthread dl) |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
39 endif() |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
40 |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
41 if (STANDALONE_BUILD) |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
42 add_definitions(-DORTHANC_PLUGIN_STANDALONE=1) |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
43 |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
44 set(AUTOGENERATED_DIR "${CMAKE_CURRENT_BINARY_DIR}/AUTOGENERATED") |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
45 set(AUTOGENERATED_SOURCES "${AUTOGENERATED_DIR}/EmbeddedResources.cpp") |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
46 |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
47 file(MAKE_DIRECTORY ${AUTOGENERATED_DIR}) |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
48 include_directories(${AUTOGENERATED_DIR}) |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
49 |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
50 set(TARGET_BASE "${AUTOGENERATED_DIR}/EmbeddedResources") |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
51 add_custom_command( |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
52 OUTPUT |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
53 "${AUTOGENERATED_DIR}/EmbeddedResources.h" |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
54 "${AUTOGENERATED_DIR}/EmbeddedResources.cpp" |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
55 COMMAND |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
56 python |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
57 "${CMAKE_CURRENT_SOURCE_DIR}/Framework/EmbedResources.py" |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
58 "${AUTOGENERATED_DIR}/EmbeddedResources" |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
59 STATIC_RESOURCES |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
60 ${RESOURCES_ROOT} |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
61 DEPENDS |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
62 "${CMAKE_CURRENT_SOURCE_DIR}/Framework/EmbedResources.py" |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
63 ${STATIC_RESOURCES} |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
64 ) |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
65 |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
66 else() |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
67 add_definitions( |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
68 -DORTHANC_PLUGIN_STANDALONE=0 |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
69 -DORTHANC_PLUGIN_RESOURCES_ROOT="${RESOURCES_ROOT}" |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
70 ) |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
71 endif() |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
72 |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
73 |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
74 list(APPEND AUTOGENERATED_SOURCES |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
75 "${CMAKE_CURRENT_SOURCE_DIR}/Framework/Plugin.cpp" |
17302d83abfd
Sample plugin framework to serve static resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
76 ) |