comparison Resources/CMake/QtConfiguration.cmake @ 365:ef31240a73f6 am-2

no automatic call to moc and uic, CircleMeasureTracker using Orthanc fonts
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 31 Oct 2018 18:10:29 +0100
parents 10d188d6e5cc
children 574fc54056af b70e9be013e4
comparison
equal deleted inserted replaced
364:aad2f9293089 365:ef31240a73f6
15 # 15 #
16 # You should have received a copy of the GNU Affero General Public License 16 # You should have received a copy of the GNU Affero General Public License
17 # along with this program. If not, see <http://www.gnu.org/licenses/>. 17 # along with this program. If not, see <http://www.gnu.org/licenses/>.
18 18
19 19
20 # Instruct CMake to run moc automatically when needed. 20 set(CMAKE_AUTOMOC OFF)
21 set(CMAKE_AUTOMOC ON) 21 set(CMAKE_AUTOUIC OFF)
22 SET(CMAKE_AUTOUIC ON)
23 set(CMAKE_INCLUDE_CURRENT_DIR ON)
24 22
25 # Find the QtWidgets library 23 # Find the QtWidgets library
26 find_package(Qt5Widgets QUIET) 24 find_package(Qt5Widgets QUIET)
27 25
28 if (Qt5Widgets_FOUND) 26 if (Qt5Widgets_FOUND)
30 find_package(Qt5Core REQUIRED) 28 find_package(Qt5Core REQUIRED)
31 link_libraries( 29 link_libraries(
32 Qt5::Widgets 30 Qt5::Widgets
33 Qt5::Core 31 Qt5::Core
34 ) 32 )
33
34 # Create aliases for the CMake commands
35 macro(ORTHANC_QT_WRAP_UI)
36 QT5_WRAP_UI(${ARGN})
37 endmacro()
38
39 macro(ORTHANC_QT_WRAP_CPP)
40 QT5_WRAP_CPP(${ARGN})
41 endmacro()
42
35 else() 43 else()
36 message("Qt5 has not been found, trying with Qt4") 44 message("Qt5 has not been found, trying with Qt4")
37 find_package(Qt4 REQUIRED QtGui) 45 find_package(Qt4 REQUIRED QtGui)
38 link_libraries( 46 link_libraries(
39 Qt4::QtGui 47 Qt4::QtGui
40 ) 48 )
49
50 # Create aliases for the CMake commands
51 macro(ORTHANC_QT_WRAP_UI)
52 QT4_WRAP_UI(${ARGN})
53 endmacro()
54
55 macro(ORTHANC_QT_WRAP_CPP)
56 QT4_WRAP_CPP(${ARGN})
57 endmacro()
58
41 endif() 59 endif()
42 60
43 list(APPEND QT_SOURCES 61 list(APPEND QT_SOURCES
44 ${ORTHANC_STONE_ROOT}/Applications/Qt/QCairoWidget.cpp 62 ${ORTHANC_STONE_ROOT}/Applications/Qt/QCairoWidget.cpp
45 ${ORTHANC_STONE_ROOT}/Applications/Qt/QtStoneApplicationRunner.cpp 63 ${ORTHANC_STONE_ROOT}/Applications/Qt/QtStoneApplicationRunner.cpp
46 ${ORTHANC_STONE_ROOT}/Applications/Qt/QStoneMainWindow.cpp 64 ${ORTHANC_STONE_ROOT}/Applications/Qt/QStoneMainWindow.cpp
47 ) 65 )
48 66
49 include_directories(${ORTHANC_STONE_ROOT}/Applications/Qt/)
50 67
68 # NB: Including CMAKE_CURRENT_BINARY_DIR is mandatory, as the CMake
69 # macros for Qt will put their result in that directory, which cannot
70 # be changed.
71 # https://stackoverflow.com/a/4016784/881731
72
73 include_directories(
74 ${ORTHANC_STONE_ROOT}/Applications/Qt/
75 ${CMAKE_CURRENT_BINARY_DIR}
76 )
77