annotate Resources/CMake/QtConfiguration.cmake @ 427:3f9017db1738 am-vsol-upgrade-radiography-export

wip
author am@osimis.io
date Fri, 23 Nov 2018 16:06:23 +0100
parents 574fc54056af
children a750f11892ec
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
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
5de5699ad570 first display in QCairoWidget; no mouse interaction yet
am@osimis.io
parents: 274
diff changeset
4 # Copyright (C) 2017-2018 Osimis S.A., Belgium
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
5de5699ad570 first display in QCairoWidget; no mouse interaction yet
am@osimis.io
parents: 274
diff changeset
23 # Find the QtWidgets library
320
10d188d6e5cc compatibility with Qt4
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 292
diff changeset
24 find_package(Qt5Widgets QUIET)
10d188d6e5cc compatibility with Qt4
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 292
diff changeset
25
10d188d6e5cc compatibility with Qt4
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 292
diff changeset
26 if (Qt5Widgets_FOUND)
10d188d6e5cc compatibility with Qt4
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 292
diff changeset
27 message("Qt5 has been detected")
10d188d6e5cc compatibility with Qt4
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 292
diff changeset
28 find_package(Qt5Core REQUIRED)
10d188d6e5cc compatibility with Qt4
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 292
diff changeset
29 link_libraries(
10d188d6e5cc compatibility with Qt4
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 292
diff changeset
30 Qt5::Widgets
10d188d6e5cc compatibility with Qt4
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 292
diff changeset
31 Qt5::Core
10d188d6e5cc compatibility with Qt4
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 292
diff changeset
32 )
365
ef31240a73f6 no automatic call to moc and uic, CircleMeasureTracker using Orthanc fonts
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 320
diff changeset
33
ef31240a73f6 no automatic call to moc and uic, CircleMeasureTracker using Orthanc fonts
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 320
diff changeset
34 # Create aliases for the CMake commands
ef31240a73f6 no automatic call to moc and uic, CircleMeasureTracker using Orthanc fonts
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 320
diff changeset
35 macro(ORTHANC_QT_WRAP_UI)
ef31240a73f6 no automatic call to moc and uic, CircleMeasureTracker using Orthanc fonts
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 320
diff changeset
36 QT5_WRAP_UI(${ARGN})
ef31240a73f6 no automatic call to moc and uic, CircleMeasureTracker using Orthanc fonts
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 320
diff changeset
37 endmacro()
ef31240a73f6 no automatic call to moc and uic, CircleMeasureTracker using Orthanc fonts
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 320
diff changeset
38
ef31240a73f6 no automatic call to moc and uic, CircleMeasureTracker using Orthanc fonts
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 320
diff changeset
39 macro(ORTHANC_QT_WRAP_CPP)
ef31240a73f6 no automatic call to moc and uic, CircleMeasureTracker using Orthanc fonts
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 320
diff changeset
40 QT5_WRAP_CPP(${ARGN})
ef31240a73f6 no automatic call to moc and uic, CircleMeasureTracker using Orthanc fonts
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 320
diff changeset
41 endmacro()
ef31240a73f6 no automatic call to moc and uic, CircleMeasureTracker using Orthanc fonts
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 320
diff changeset
42
320
10d188d6e5cc compatibility with Qt4
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 292
diff changeset
43 else()
10d188d6e5cc compatibility with Qt4
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 292
diff changeset
44 message("Qt5 has not been found, trying with Qt4")
10d188d6e5cc compatibility with Qt4
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 292
diff changeset
45 find_package(Qt4 REQUIRED QtGui)
10d188d6e5cc compatibility with Qt4
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 292
diff changeset
46 link_libraries(
10d188d6e5cc compatibility with Qt4
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 292
diff changeset
47 Qt4::QtGui
10d188d6e5cc compatibility with Qt4
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 292
diff changeset
48 )
365
ef31240a73f6 no automatic call to moc and uic, CircleMeasureTracker using Orthanc fonts
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 320
diff changeset
49
ef31240a73f6 no automatic call to moc and uic, CircleMeasureTracker using Orthanc fonts
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 320
diff changeset
50 # Create aliases for the CMake commands
ef31240a73f6 no automatic call to moc and uic, CircleMeasureTracker using Orthanc fonts
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 320
diff changeset
51 macro(ORTHANC_QT_WRAP_UI)
ef31240a73f6 no automatic call to moc and uic, CircleMeasureTracker using Orthanc fonts
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 320
diff changeset
52 QT4_WRAP_UI(${ARGN})
ef31240a73f6 no automatic call to moc and uic, CircleMeasureTracker using Orthanc fonts
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 320
diff changeset
53 endmacro()
ef31240a73f6 no automatic call to moc and uic, CircleMeasureTracker using Orthanc fonts
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 320
diff changeset
54
ef31240a73f6 no automatic call to moc and uic, CircleMeasureTracker using Orthanc fonts
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 320
diff changeset
55 macro(ORTHANC_QT_WRAP_CPP)
ef31240a73f6 no automatic call to moc and uic, CircleMeasureTracker using Orthanc fonts
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 320
diff changeset
56 QT4_WRAP_CPP(${ARGN})
ef31240a73f6 no automatic call to moc and uic, CircleMeasureTracker using Orthanc fonts
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 320
diff changeset
57 endmacro()
ef31240a73f6 no automatic call to moc and uic, CircleMeasureTracker using Orthanc fonts
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 320
diff changeset
58
320
10d188d6e5cc compatibility with Qt4
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 292
diff changeset
59 endif()
276
5de5699ad570 first display in QCairoWidget; no mouse interaction yet
am@osimis.io
parents: 274
diff changeset
60
5de5699ad570 first display in QCairoWidget; no mouse interaction yet
am@osimis.io
parents: 274
diff changeset
61 list(APPEND QT_SOURCES
320
10d188d6e5cc compatibility with Qt4
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 292
diff changeset
62 ${ORTHANC_STONE_ROOT}/Applications/Qt/QCairoWidget.cpp
10d188d6e5cc compatibility with Qt4
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 292
diff changeset
63 ${ORTHANC_STONE_ROOT}/Applications/Qt/QtStoneApplicationRunner.cpp
10d188d6e5cc compatibility with Qt4
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 292
diff changeset
64 ${ORTHANC_STONE_ROOT}/Applications/Qt/QStoneMainWindow.cpp
10d188d6e5cc compatibility with Qt4
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 292
diff changeset
65 )
276
5de5699ad570 first display in QCairoWidget; no mouse interaction yet
am@osimis.io
parents: 274
diff changeset
66
423
574fc54056af WRAP_UI and WRAP_CPP commonly used files in stone makefile instead of project makefile
am@osimis.io
parents: 365
diff changeset
67 ORTHANC_QT_WRAP_CPP(QT_SOURCES
574fc54056af WRAP_UI and WRAP_CPP commonly used files in stone makefile instead of project makefile
am@osimis.io
parents: 365
diff changeset
68 ${ORTHANC_STONE_ROOT}/Applications/Qt/QCairoWidget.h
574fc54056af WRAP_UI and WRAP_CPP commonly used files in stone makefile instead of project makefile
am@osimis.io
parents: 365
diff changeset
69 ${ORTHANC_STONE_ROOT}/Applications/Qt/QStoneMainWindow.h
574fc54056af WRAP_UI and WRAP_CPP commonly used files in stone makefile instead of project makefile
am@osimis.io
parents: 365
diff changeset
70 )
574fc54056af WRAP_UI and WRAP_CPP commonly used files in stone makefile instead of project makefile
am@osimis.io
parents: 365
diff changeset
71
365
ef31240a73f6 no automatic call to moc and uic, CircleMeasureTracker using Orthanc fonts
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 320
diff changeset
72
ef31240a73f6 no automatic call to moc and uic, CircleMeasureTracker using Orthanc fonts
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 320
diff changeset
73 # NB: Including CMAKE_CURRENT_BINARY_DIR is mandatory, as the CMake
ef31240a73f6 no automatic call to moc and uic, CircleMeasureTracker using Orthanc fonts
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 320
diff changeset
74 # macros for Qt will put their result in that directory, which cannot
ef31240a73f6 no automatic call to moc and uic, CircleMeasureTracker using Orthanc fonts
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 320
diff changeset
75 # be changed.
ef31240a73f6 no automatic call to moc and uic, CircleMeasureTracker using Orthanc fonts
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 320
diff changeset
76 # https://stackoverflow.com/a/4016784/881731
276
5de5699ad570 first display in QCairoWidget; no mouse interaction yet
am@osimis.io
parents: 274
diff changeset
77
365
ef31240a73f6 no automatic call to moc and uic, CircleMeasureTracker using Orthanc fonts
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 320
diff changeset
78 include_directories(
ef31240a73f6 no automatic call to moc and uic, CircleMeasureTracker using Orthanc fonts
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 320
diff changeset
79 ${ORTHANC_STONE_ROOT}/Applications/Qt/
ef31240a73f6 no automatic call to moc and uic, CircleMeasureTracker using Orthanc fonts
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 320
diff changeset
80 ${CMAKE_CURRENT_BINARY_DIR}
ef31240a73f6 no automatic call to moc and uic, CircleMeasureTracker using Orthanc fonts
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 320
diff changeset
81 )
ef31240a73f6 no automatic call to moc and uic, CircleMeasureTracker using Orthanc fonts
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 320
diff changeset
82