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
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
439
b70e9be013e4 preparing for 2019
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 365
diff changeset
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
4f99c7905f8d mingw qt
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1044
diff changeset
23
4f99c7905f8d mingw qt
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1044
diff changeset
24 ## Note that these set of macros MUST be defined as a "function()",
4f99c7905f8d mingw qt
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1044
diff changeset
25 ## otherwise it fails
4f99c7905f8d mingw qt
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1044
diff changeset
26 function(DEFINE_QT_MACROS)
1040
14c0a29cd9ec qt and lsb
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1037
diff changeset
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
4f99c7905f8d mingw qt
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1044
diff changeset
75 endfunction()
4f99c7905f8d mingw qt
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1044
diff changeset
76
4f99c7905f8d mingw qt
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1044
diff changeset
77
4f99c7905f8d mingw qt
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1044
diff changeset
78 if ("${CMAKE_SYSTEM_VERSION}" STREQUAL "LinuxStandardBase")
4f99c7905f8d mingw qt
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1044
diff changeset
79 # Linux Standard Base version 5 ships Qt 4.2.3
4f99c7905f8d mingw qt
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1044
diff changeset
80 DEFINE_QT_MACROS()
4f99c7905f8d mingw qt
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1044
diff changeset
81
4f99c7905f8d mingw qt
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1044
diff changeset
82 # The script "LinuxStandardBaseUic.py" is just a wrapper around the
4f99c7905f8d mingw qt
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1044
diff changeset
83 # "uic" compiler from LSB that does not support the "<?xml ...?>"
4f99c7905f8d mingw qt
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1044
diff changeset
84 # header that is automatically added by Qt Creator
4f99c7905f8d mingw qt
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1044
diff changeset
85 set(QT_UIC_EXECUTABLE ${CMAKE_CURRENT_LIST_DIR}/LinuxStandardBaseUic.py)
4f99c7905f8d mingw qt
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1044
diff changeset
86
4f99c7905f8d mingw qt
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1044
diff changeset
87 set(QT_MOC_EXECUTABLE ${LSB_PATH}/bin/moc)
4f99c7905f8d mingw qt
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1044
diff changeset
88
4f99c7905f8d mingw qt
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1044
diff changeset
89 include_directories(
4f99c7905f8d mingw qt
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1044
diff changeset
90 ${LSB_PATH}/include/QtCore
4f99c7905f8d mingw qt
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1044
diff changeset
91 ${LSB_PATH}/include/QtGui
4f99c7905f8d mingw qt
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1044
diff changeset
92 ${LSB_PATH}/include/QtOpenGL
4f99c7905f8d mingw qt
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1044
diff changeset
93 )
4f99c7905f8d mingw qt
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1044
diff changeset
94
4f99c7905f8d mingw qt
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1044
diff changeset
95 link_libraries(QtCore QtGui QtOpenGL)
4f99c7905f8d mingw qt
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1044
diff changeset
96
4f99c7905f8d mingw qt
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1044
diff changeset
97 elseif (${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
4f99c7905f8d mingw qt
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1044
diff changeset
98 DEFINE_QT_MACROS()
4f99c7905f8d mingw qt
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1044
diff changeset
99
4f99c7905f8d mingw qt
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1044
diff changeset
100 include_directories(${QT5_INSTALL_ROOT}/include)
4f99c7905f8d mingw qt
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1044
diff changeset
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
4f99c7905f8d mingw qt
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1044
diff changeset
110
4f99c7905f8d mingw qt
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1044
diff changeset
111 include_directories(
4f99c7905f8d mingw qt
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1044
diff changeset
112 ${QT5_INSTALL_ROOT}/include/QtCore
4f99c7905f8d mingw qt
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1044
diff changeset
113 ${QT5_INSTALL_ROOT}/include/QtGui
4f99c7905f8d mingw qt
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1044
diff changeset
114 ${QT5_INSTALL_ROOT}/include/QtOpenGL
4f99c7905f8d mingw qt
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1044
diff changeset
115 ${QT5_INSTALL_ROOT}/include/QtWidgets
4f99c7905f8d mingw qt
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1044
diff changeset
116 )
4f99c7905f8d mingw qt
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1044
diff changeset
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
4f99c7905f8d mingw qt
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1044
diff changeset
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
14c0a29cd9ec qt and lsb
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1037
diff changeset
158 else()
1145
4f99c7905f8d mingw qt
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1044
diff changeset
159 # Not using Windows, not using Linux Standard Base,
1040
14c0a29cd9ec qt and lsb
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1037
diff changeset
160 # Find the QtWidgets library
14c0a29cd9ec qt and lsb
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1037
diff changeset
161 find_package(Qt5Widgets QUIET)
14c0a29cd9ec qt and lsb
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1037
diff changeset
162
14c0a29cd9ec qt and lsb
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1037
diff changeset
163 if (Qt5Widgets_FOUND)
14c0a29cd9ec qt and lsb
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1037
diff changeset
164 message("Qt5 has been detected")
14c0a29cd9ec qt and lsb
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1037
diff changeset
165 find_package(Qt5Core REQUIRED)
14c0a29cd9ec qt and lsb
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1037
diff changeset
166 link_libraries(
14c0a29cd9ec qt and lsb
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1037
diff changeset
167 Qt5::Widgets
14c0a29cd9ec qt and lsb
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1037
diff changeset
168 Qt5::Core
14c0a29cd9ec qt and lsb
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1037
diff changeset
169 )
14c0a29cd9ec qt and lsb
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1037
diff changeset
170
14c0a29cd9ec qt and lsb
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1037
diff changeset
171 if (ENABLE_OPENGL)
14c0a29cd9ec qt and lsb
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1037
diff changeset
172 find_package(Qt5OpenGL REQUIRED)
14c0a29cd9ec qt and lsb
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1037
diff changeset
173 link_libraries(
14c0a29cd9ec qt and lsb
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1037
diff changeset
174 Qt5::OpenGL
14c0a29cd9ec qt and lsb
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1037
diff changeset
175 )
14c0a29cd9ec qt and lsb
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1037
diff changeset
176 endif()
14c0a29cd9ec qt and lsb
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1037
diff changeset
177
14c0a29cd9ec qt and lsb
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1037
diff changeset
178 # Create aliases for the CMake commands
14c0a29cd9ec qt and lsb
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1037
diff changeset
179 macro(ORTHANC_QT_WRAP_UI)
14c0a29cd9ec qt and lsb
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1037
diff changeset
180 QT5_WRAP_UI(${ARGN})
14c0a29cd9ec qt and lsb
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1037
diff changeset
181 endmacro()
14c0a29cd9ec qt and lsb
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1037
diff changeset
182
14c0a29cd9ec qt and lsb
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1037
diff changeset
183 macro(ORTHANC_QT_WRAP_CPP)
14c0a29cd9ec qt and lsb
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1037
diff changeset
184 QT5_WRAP_CPP(${ARGN})
14c0a29cd9ec qt and lsb
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1037
diff changeset
185 endmacro()
14c0a29cd9ec qt and lsb
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1037
diff changeset
186
14c0a29cd9ec qt and lsb
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1037
diff changeset
187 else()
14c0a29cd9ec qt and lsb
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1037
diff changeset
188 message("Qt5 has not been found, trying with Qt4")
14c0a29cd9ec qt and lsb
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1037
diff changeset
189 find_package(Qt4 REQUIRED QtGui)
14c0a29cd9ec qt and lsb
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1037
diff changeset
190 link_libraries(
14c0a29cd9ec qt and lsb
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1037
diff changeset
191 Qt4::QtGui
14c0a29cd9ec qt and lsb
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1037
diff changeset
192 )
14c0a29cd9ec qt and lsb
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1037
diff changeset
193
14c0a29cd9ec qt and lsb
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1037
diff changeset
194 if (ENABLE_OPENGL)
14c0a29cd9ec qt and lsb
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1037
diff changeset
195 find_package(Qt4 REQUIRED QtOpenGL)
14c0a29cd9ec qt and lsb
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1037
diff changeset
196 link_libraries(
14c0a29cd9ec qt and lsb
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1037
diff changeset
197 Qt4::QtOpenGL
14c0a29cd9ec qt and lsb
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1037
diff changeset
198 )
14c0a29cd9ec qt and lsb
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1037
diff changeset
199 endif()
14c0a29cd9ec qt and lsb
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1037
diff changeset
200
14c0a29cd9ec qt and lsb
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1037
diff changeset
201 # Create aliases for the CMake commands
14c0a29cd9ec qt and lsb
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1037
diff changeset
202 macro(ORTHANC_QT_WRAP_UI)
14c0a29cd9ec qt and lsb
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1037
diff changeset
203 QT4_WRAP_UI(${ARGN})
14c0a29cd9ec qt and lsb
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1037
diff changeset
204 endmacro()
14c0a29cd9ec qt and lsb
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1037
diff changeset
205
14c0a29cd9ec qt and lsb
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1037
diff changeset
206 macro(ORTHANC_QT_WRAP_CPP)
14c0a29cd9ec qt and lsb
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1037
diff changeset
207 QT4_WRAP_CPP(${ARGN})
14c0a29cd9ec qt and lsb
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1037
diff changeset
208 endmacro()
14c0a29cd9ec qt and lsb
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1037
diff changeset
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
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 440
diff changeset
212
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 440
diff changeset
213 if (ENABLE_STONE_DEPRECATED)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 440
diff changeset
214 list(APPEND QT_SOURCES
1040
14c0a29cd9ec qt and lsb
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1037
diff changeset
215 ${ORTHANC_STONE_ROOT}/Applications/Qt/QCairoWidget.cpp
14c0a29cd9ec qt and lsb
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1037
diff changeset
216 ${ORTHANC_STONE_ROOT}/Applications/Qt/QStoneMainWindow.cpp
1028
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 440
diff changeset
217 ${ORTHANC_STONE_ROOT}/Applications/Qt/QtStoneApplicationRunner.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 440
diff changeset
218 )
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 440
diff changeset
219
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 440
diff changeset
220 ORTHANC_QT_WRAP_CPP(QT_SOURCES
1040
14c0a29cd9ec qt and lsb
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1037
diff changeset
221 ${ORTHANC_STONE_ROOT}/Applications/Qt/QCairoWidget.h
1028
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 440
diff changeset
222 ${ORTHANC_STONE_ROOT}/Applications/Qt/QStoneMainWindow.h
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 440
diff changeset
223 )
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 440
diff changeset
224 endif()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 440
diff changeset
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