Mercurial > hg > orthanc-stone
annotate Resources/CMake/QtConfiguration.cmake @ 1326:55166e57a77c broker
doc
author | Benjamin Golinvaux <bgo@osimis.io> |
---|---|
date | Tue, 24 Mar 2020 21:32:35 +0100 |
parents | 7ec8fea061b9 |
children |
rev | line source |
---|---|
276
5de5699ad570
first display in QCairoWidget; no mouse interaction yet
am@osimis.io
parents:
274
diff
changeset
|
1 # Stone of Orthanc |
5de5699ad570
first display in QCairoWidget; no mouse interaction yet
am@osimis.io
parents:
274
diff
changeset
|
2 # Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics |
5de5699ad570
first display in QCairoWidget; no mouse interaction yet
am@osimis.io
parents:
274
diff
changeset
|
3 # Department, University Hospital of Liege, Belgium |
1270
2d8ab34c8c91
upgrade to year 2020
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1044
diff
changeset
|
4 # Copyright (C) 2017-2020 Osimis S.A., Belgium |
276
5de5699ad570
first display in QCairoWidget; no mouse interaction yet
am@osimis.io
parents:
274
diff
changeset
|
5 # |
5de5699ad570
first display in QCairoWidget; no mouse interaction yet
am@osimis.io
parents:
274
diff
changeset
|
6 # This program is free software: you can redistribute it and/or |
5de5699ad570
first display in QCairoWidget; no mouse interaction yet
am@osimis.io
parents:
274
diff
changeset
|
7 # modify it under the terms of the GNU Affero General Public License |
5de5699ad570
first display in QCairoWidget; no mouse interaction yet
am@osimis.io
parents:
274
diff
changeset
|
8 # as published by the Free Software Foundation, either version 3 of |
5de5699ad570
first display in QCairoWidget; no mouse interaction yet
am@osimis.io
parents:
274
diff
changeset
|
9 # the License, or (at your option) any later version. |
5de5699ad570
first display in QCairoWidget; no mouse interaction yet
am@osimis.io
parents:
274
diff
changeset
|
10 # |
5de5699ad570
first display in QCairoWidget; no mouse interaction yet
am@osimis.io
parents:
274
diff
changeset
|
11 # This program is distributed in the hope that it will be useful, but |
5de5699ad570
first display in QCairoWidget; no mouse interaction yet
am@osimis.io
parents:
274
diff
changeset
|
12 # WITHOUT ANY WARRANTY; without even the implied warranty of |
5de5699ad570
first display in QCairoWidget; no mouse interaction yet
am@osimis.io
parents:
274
diff
changeset
|
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
5de5699ad570
first display in QCairoWidget; no mouse interaction yet
am@osimis.io
parents:
274
diff
changeset
|
14 # Affero General Public License for more details. |
5de5699ad570
first display in QCairoWidget; no mouse interaction yet
am@osimis.io
parents:
274
diff
changeset
|
15 # |
5de5699ad570
first display in QCairoWidget; no mouse interaction yet
am@osimis.io
parents:
274
diff
changeset
|
16 # You should have received a copy of the GNU Affero General Public License |
5de5699ad570
first display in QCairoWidget; no mouse interaction yet
am@osimis.io
parents:
274
diff
changeset
|
17 # along with this program. If not, see <http://www.gnu.org/licenses/>. |
5de5699ad570
first display in QCairoWidget; no mouse interaction yet
am@osimis.io
parents:
274
diff
changeset
|
18 |
5de5699ad570
first display in QCairoWidget; no mouse interaction yet
am@osimis.io
parents:
274
diff
changeset
|
19 |
365
ef31240a73f6
no automatic call to moc and uic, CircleMeasureTracker using Orthanc fonts
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
320
diff
changeset
|
20 set(CMAKE_AUTOMOC OFF) |
ef31240a73f6
no automatic call to moc and uic, CircleMeasureTracker using Orthanc fonts
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
320
diff
changeset
|
21 set(CMAKE_AUTOUIC OFF) |
276
5de5699ad570
first display in QCairoWidget; no mouse interaction yet
am@osimis.io
parents:
274
diff
changeset
|
22 |
1145 | 23 |
24 ## Note that these set of macros MUST be defined as a "function()", | |
25 ## otherwise it fails | |
26 function(DEFINE_QT_MACROS) | |
1040 | 27 include(Qt4Macros) |
320
10d188d6e5cc
compatibility with Qt4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
292
diff
changeset
|
28 |
1044
b60d70e8b55c
compatibility macros for LSB and Qt
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
29 ## |
b60d70e8b55c
compatibility macros for LSB and Qt
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
30 ## This part is adapted from file "Qt4Macros.cmake" shipped with |
b60d70e8b55c
compatibility macros for LSB and Qt
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
31 ## CMake 3.5.1, released under the following license: |
b60d70e8b55c
compatibility macros for LSB and Qt
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
32 ## |
b60d70e8b55c
compatibility macros for LSB and Qt
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
33 ##============================================================================= |
b60d70e8b55c
compatibility macros for LSB and Qt
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
34 ## Copyright 2005-2009 Kitware, Inc. |
b60d70e8b55c
compatibility macros for LSB and Qt
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
35 ## |
b60d70e8b55c
compatibility macros for LSB and Qt
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
36 ## Distributed under the OSI-approved BSD License (the "License"); |
b60d70e8b55c
compatibility macros for LSB and Qt
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
37 ## see accompanying file Copyright.txt for details. |
b60d70e8b55c
compatibility macros for LSB and Qt
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
38 ## |
b60d70e8b55c
compatibility macros for LSB and Qt
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
39 ## This software is distributed WITHOUT ANY WARRANTY; without even the |
b60d70e8b55c
compatibility macros for LSB and Qt
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
40 ## implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
b60d70e8b55c
compatibility macros for LSB and Qt
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
41 ## See the License for more information. |
b60d70e8b55c
compatibility macros for LSB and Qt
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
42 ##============================================================================= |
b60d70e8b55c
compatibility macros for LSB and Qt
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
43 ## |
b60d70e8b55c
compatibility macros for LSB and Qt
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
44 macro (ORTHANC_QT_WRAP_UI outfiles) |
b60d70e8b55c
compatibility macros for LSB and Qt
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
45 QT4_EXTRACT_OPTIONS(ui_files ui_options ui_target ${ARGN}) |
b60d70e8b55c
compatibility macros for LSB and Qt
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
46 foreach (it ${ui_files}) |
b60d70e8b55c
compatibility macros for LSB and Qt
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
47 get_filename_component(outfile ${it} NAME_WE) |
b60d70e8b55c
compatibility macros for LSB and Qt
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
48 get_filename_component(infile ${it} ABSOLUTE) |
b60d70e8b55c
compatibility macros for LSB and Qt
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
49 set(outfile ${CMAKE_CURRENT_BINARY_DIR}/ui_${outfile}.h) |
b60d70e8b55c
compatibility macros for LSB and Qt
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
50 add_custom_command(OUTPUT ${outfile} |
b60d70e8b55c
compatibility macros for LSB and Qt
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
51 COMMAND ${QT_UIC_EXECUTABLE} |
b60d70e8b55c
compatibility macros for LSB and Qt
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
52 ARGS ${ui_options} -o ${outfile} ${infile} |
b60d70e8b55c
compatibility macros for LSB and Qt
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
53 MAIN_DEPENDENCY ${infile} VERBATIM) |
b60d70e8b55c
compatibility macros for LSB and Qt
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
54 set(${outfiles} ${${outfiles}} ${outfile}) |
b60d70e8b55c
compatibility macros for LSB and Qt
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
55 endforeach () |
b60d70e8b55c
compatibility macros for LSB and Qt
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
56 endmacro () |
365
ef31240a73f6
no automatic call to moc and uic, CircleMeasureTracker using Orthanc fonts
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
320
diff
changeset
|
57 |
1044
b60d70e8b55c
compatibility macros for LSB and Qt
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
58 macro (ORTHANC_QT_WRAP_CPP outfiles ) |
b60d70e8b55c
compatibility macros for LSB and Qt
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
59 QT4_GET_MOC_FLAGS(moc_flags) |
b60d70e8b55c
compatibility macros for LSB and Qt
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
60 QT4_EXTRACT_OPTIONS(moc_files moc_options moc_target ${ARGN}) |
b60d70e8b55c
compatibility macros for LSB and Qt
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
61 foreach (it ${moc_files}) |
b60d70e8b55c
compatibility macros for LSB and Qt
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
62 get_filename_component(outfile ${it} NAME_WE) |
b60d70e8b55c
compatibility macros for LSB and Qt
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
63 get_filename_component(infile ${it} ABSOLUTE) |
b60d70e8b55c
compatibility macros for LSB and Qt
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
64 set(outfile ${CMAKE_CURRENT_BINARY_DIR}/moc_${outfile}.cxx) |
b60d70e8b55c
compatibility macros for LSB and Qt
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
65 add_custom_command(OUTPUT ${outfile} |
b60d70e8b55c
compatibility macros for LSB and Qt
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
66 COMMAND ${QT_MOC_EXECUTABLE} |
b60d70e8b55c
compatibility macros for LSB and Qt
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
67 ARGS ${infile} "${moc_flags}" -o ${outfile} |
b60d70e8b55c
compatibility macros for LSB and Qt
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
68 MAIN_DEPENDENCY ${infile} VERBATIM) |
b60d70e8b55c
compatibility macros for LSB and Qt
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
69 set(${outfiles} ${${outfiles}} ${outfile}) |
b60d70e8b55c
compatibility macros for LSB and Qt
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
70 endforeach () |