Mercurial > hg > orthanc-stone
annotate Resources/CMake/QtConfiguration.cmake @ 1186:3284c3fd96ad broker
merge
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Fri, 22 Nov 2019 09:51:47 +0100 |
parents | 5035354b1369 |
children | 0ca50d275b9a |
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 |
439 | 4 # Copyright (C) 2017-2019 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 () |
b60d70e8b55c
compatibility macros for LSB and Qt
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
71 endmacro () |
b60d70e8b55c
compatibility macros for LSB and Qt
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
72 ## |
b60d70e8b55c
compatibility macros for LSB and Qt
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
73 ## End of "Qt4Macros.cmake" adaptation. |
b60d70e8b55c
compatibility macros for LSB and Qt
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
74 ## |
1145 | 75 endfunction() |
76 | |
77 | |
78 if ("${CMAKE_SYSTEM_VERSION}" STREQUAL "LinuxStandardBase") | |
79 # Linux Standard Base version 5 ships Qt 4.2.3 | |
80 DEFINE_QT_MACROS() | |
81 | |
82 # The script "LinuxStandardBaseUic.py" is just a wrapper around the | |
83 # "uic" compiler from LSB that does not support the "<?xml ...?>" | |
84 # header that is automatically added by Qt Creator | |
85 set(QT_UIC_EXECUTABLE ${CMAKE_CURRENT_LIST_DIR}/LinuxStandardBaseUic.py) | |
86 | |
87 set(QT_MOC_EXECUTABLE ${LSB_PATH}/bin/moc) | |
88 | |
89 include_directories( | |
90 ${LSB_PATH}/include/QtCore | |
91 ${LSB_PATH}/include/QtGui | |
92 ${LSB_PATH}/include/QtOpenGL | |
93 ) | |
94 | |
95 link_libraries(QtCore QtGui QtOpenGL) | |
96 | |
97 elseif (${CMAKE_SYSTEM_NAME} STREQUAL "Windows") | |
98 DEFINE_QT_MACROS() | |
99 | |
100 include_directories(${QT5_INSTALL_ROOT}/include) | |
101 link_directories(${QT5_INSTALL_ROOT}/lib) | |
1146
5035354b1369
working static compilation with qt
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
102 |
5035354b1369
working static compilation with qt
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
103 if (OFF) #CMAKE_CROSSCOMPILING) |
5035354b1369
working static compilation with qt
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
104 set(QT_UIC_EXECUTABLE wine ${QT5_INSTALL_ROOT}/bin/uic.exe) |
5035354b1369
working static compilation with qt
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
105 set(QT_MOC_EXECUTABLE wine ${QT5_INSTALL_ROOT}/bin/moc.exe) |
5035354b1369
working static compilation with qt
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
106 else() |
5035354b1369
working static compilation with qt
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
107 set(QT_UIC_EXECUTABLE ${QT5_INSTALL_ROOT}/bin/uic) |
5035354b1369
working static compilation with qt
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
108 set(QT_MOC_EXECUTABLE ${QT5_INSTALL_ROOT}/bin/moc) |
5035354b1369
working static compilation with qt
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
109 endif() |
1145 | 110 |
111 include_directories( | |
112 ${QT5_INSTALL_ROOT}/include/QtCore | |
113 ${QT5_INSTALL_ROOT}/include/QtGui | |
114 ${QT5_INSTALL_ROOT}/include/QtOpenGL | |
115 ${QT5_INSTALL_ROOT}/include/QtWidgets | |
116 ) | |
117 | |
1146
5035354b1369
working static compilation with qt
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
118 if (OFF) |
5035354b1369
working static compilation with qt
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
119 # Dynamic Qt |
5035354b1369
working static compilation with qt
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
120 link_libraries(Qt5Core Qt5Gui Qt5OpenGL Qt5Widgets) |
5035354b1369
working static compilation with qt
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
121 |
5035354b1369
working static compilation with qt
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
122 file(COPY |
5035354b1369
working static compilation with qt
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
123 ${QT5_INSTALL_ROOT}/bin/Qt5Core.dll |
5035354b1369
working static compilation with qt
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
124 ${QT5_INSTALL_ROOT}/bin/Qt5Gui.dll |
5035354b1369
working static compilation with qt
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
125 ${QT5_INSTALL_ROOT}/bin/Qt5OpenGL.dll |
5035354b1369
working static compilation with qt
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
126 ${QT5_INSTALL_ROOT}/bin/Qt5Widgets.dll |
5035354b1369
working static compilation with qt
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
127 ${QT5_INSTALL_ROOT}/bin/libstdc++-6.dll |
5035354b1369
working static compilation with qt
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
128 ${QT5_INSTALL_ROOT}/bin/libgcc_s_dw2-1.dll |
5035354b1369
working static compilation with qt
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
129 ${QT5_INSTALL_ROOT}/bin/libwinpthread-1.dll |
5035354b1369
working static compilation with qt
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
130 DESTINATION ${CMAKE_CURRENT_BINARY_DIR}) |
5035354b1369
working static compilation with qt
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
131 |
5035354b1369
working static compilation with qt
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
132 file(COPY |
5035354b1369
working static compilation with qt
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
133 ${QT5_INSTALL_ROOT}/plugins/platforms/qwindows.dll |
5035354b1369
working static compilation with qt
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
134 DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/platforms) |
1145 | 135 |
1146
5035354b1369
working static compilation with qt
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
136 else() |
5035354b1369
working static compilation with qt
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
137 # Static Qt |
5035354b1369
working static compilation with qt
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
138 link_libraries( |
5035354b1369
working static compilation with qt
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
139 ${QT5_INSTALL_ROOT}/lib/libQt5Widgets.a |
5035354b1369
working static compilation with qt
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
140 ${QT5_INSTALL_ROOT}/lib/libQt5Gui.a |
5035354b1369
working static compilation with qt
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
141 ${QT5_INSTALL_ROOT}/lib/libQt5OpenGL.a |
5035354b1369
working static compilation with qt
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
142 ${QT5_INSTALL_ROOT}/lib/libQt5Core.a |
5035354b1369
working static compilation with qt
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
143 ${QT5_INSTALL_ROOT}/lib/libqtharfbuzz.a |
5035354b1369
working static compilation with qt
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
144 ${QT5_INSTALL_ROOT}/lib/libqtpcre2.a |
5035354b1369
working static compilation with qt
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
145 ${QT5_INSTALL_ROOT}/lib/libQt5FontDatabaseSupport.a |
5035354b1369
working static compilation with qt
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
146 ${QT5_INSTALL_ROOT}/lib/libQt5EventDispatcherSupport.a |
5035354b1369
working static compilation with qt
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
147 ${QT5_INSTALL_ROOT}/lib/libQt5ThemeSupport.a |
5035354b1369
working static compilation with qt
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
148 ${QT5_INSTALL_ROOT}/plugins/platforms/libqwindows.a |
5035354b1369
working static compilation with qt
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
149 winmm |
5035354b1369
working static compilation with qt
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
150 version |
5035354b1369
working static compilation with qt
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
151 ws2_32 |
5035354b1369
working static compilation with qt
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
152 uxtheme |
5035354b1369
working static compilation with qt
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
153 imm32 |
5035354b1369
working static compilation with qt
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
154 dwmapi |
5035354b1369
working static compilation with qt
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
155 ) |
5035354b1369
working static compilation with qt
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
156 endif() |
5035354b1369
working static compilation with qt
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
157 |
1040 | 158 else() |
1145 | 159 # Not using Windows, not using Linux Standard Base, |
1040 | 160 # Find the QtWidgets library |
161 find_package(Qt5Widgets QUIET) | |
162 | |
163 if (Qt5Widgets_FOUND) | |
164 message("Qt5 has been detected") | |
165 find_package(Qt5Core REQUIRED) | |
166 link_libraries( | |
167 Qt5::Widgets | |
168 Qt5::Core | |
169 ) | |
170 | |
171 if (ENABLE_OPENGL) | |
172 find_package(Qt5OpenGL REQUIRED) | |
173 link_libraries( | |
174 Qt5::OpenGL | |
175 ) | |
176 endif() | |
177 | |
178 # Create aliases for the CMake commands | |
179 macro(ORTHANC_QT_WRAP_UI) | |
180 QT5_WRAP_UI(${ARGN}) | |
181 endmacro() | |
182 | |
183 macro(ORTHANC_QT_WRAP_CPP) | |
184 QT5_WRAP_CPP(${ARGN}) | |
185 endmacro() | |
186 | |
187 else() | |
188 message("Qt5 has not been found, trying with Qt4") | |
189 find_package(Qt4 REQUIRED QtGui) | |
190 link_libraries( | |
191 Qt4::QtGui | |
192 ) | |
193 | |
194 if (ENABLE_OPENGL) | |
195 find_package(Qt4 REQUIRED QtOpenGL) | |
196 link_libraries( | |
197 Qt4::QtOpenGL | |
198 ) | |
199 endif() | |
200 | |
201 # Create aliases for the CMake commands | |
202 macro(ORTHANC_QT_WRAP_UI) | |
203 QT4_WRAP_UI(${ARGN}) | |
204 endmacro() | |
205 | |
206 macro(ORTHANC_QT_WRAP_CPP) | |
207 QT4_WRAP_CPP(${ARGN}) | |
208 endmacro() | |
209 endif() | |
320
10d188d6e5cc
compatibility with Qt4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
292
diff
changeset
|
210 endif() |
276
5de5699ad570
first display in QCairoWidget; no mouse interaction yet
am@osimis.io
parents:
274
diff
changeset
|
211 |
1028 | 212 |
213 if (ENABLE_STONE_DEPRECATED) | |
214 list(APPEND QT_SOURCES | |
1040 | 215 ${ORTHANC_STONE_ROOT}/Applications/Qt/QCairoWidget.cpp |
216 ${ORTHANC_STONE_ROOT}/Applications/Qt/QStoneMainWindow.cpp | |
1028 | 217 ${ORTHANC_STONE_ROOT}/Applications/Qt/QtStoneApplicationRunner.cpp |
218 ) | |
219 | |
220 ORTHANC_QT_WRAP_CPP(QT_SOURCES | |
1040 | 221 ${ORTHANC_STONE_ROOT}/Applications/Qt/QCairoWidget.h |
1028 | 222 ${ORTHANC_STONE_ROOT}/Applications/Qt/QStoneMainWindow.h |
223 ) | |
224 endif() | |
225 | |
365
ef31240a73f6
no automatic call to moc and uic, CircleMeasureTracker using Orthanc fonts
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
320
diff
changeset
|
226 |
ef31240a73f6
no automatic call to moc and uic, CircleMeasureTracker using Orthanc fonts
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
320
diff
changeset
|
227 # 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
|
228 # 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
|
229 # be changed. |
ef31240a73f6
no automatic call to moc and uic, CircleMeasureTracker using Orthanc fonts
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
320
diff
changeset
|
230 # https://stackoverflow.com/a/4016784/881731 |
276
5de5699ad570
first display in QCairoWidget; no mouse interaction yet
am@osimis.io
parents:
274
diff
changeset
|
231 |
365
ef31240a73f6
no automatic call to moc and uic, CircleMeasureTracker using Orthanc fonts
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
320
diff
changeset
|
232 include_directories( |
ef31240a73f6
no automatic call to moc and uic, CircleMeasureTracker using Orthanc fonts
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
320
diff
changeset
|
233 ${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
|
234 ${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
|
235 ) |
ef31240a73f6
no automatic call to moc and uic, CircleMeasureTracker using Orthanc fonts
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
320
diff
changeset
|
236 |