comparison Resources/CMake/QtConfiguration.cmake @ 1145:4f99c7905f8d broker

mingw qt
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 12 Nov 2019 18:28:46 +0100
parents b60d70e8b55c
children 5035354b1369
comparison
equal deleted inserted replaced
1144:7d23c43ba555 1145:4f99c7905f8d
18 18
19 19
20 set(CMAKE_AUTOMOC OFF) 20 set(CMAKE_AUTOMOC OFF)
21 set(CMAKE_AUTOUIC OFF) 21 set(CMAKE_AUTOUIC OFF)
22 22
23 if ("${CMAKE_SYSTEM_VERSION}" STREQUAL "LinuxStandardBase") 23
24 # Linux Standard Base version 5 ships Qt 4.2.3 24 ## Note that these set of macros MUST be defined as a "function()",
25 ## otherwise it fails
26 function(DEFINE_QT_MACROS)
25 include(Qt4Macros) 27 include(Qt4Macros)
26
27 # The script "LinuxStandardBaseUic.py" is just a wrapper around the
28 # "uic" compiler from LSB that does not support the "<?xml ...?>"
29 # header that is automatically added by Qt Creator
30 set(QT_UIC_EXECUTABLE ${CMAKE_CURRENT_LIST_DIR}/LinuxStandardBaseUic.py)
31
32 set(QT_MOC_EXECUTABLE ${LSB_PATH}/bin/moc)
33
34 include_directories(
35 ${LSB_PATH}/include/QtCore
36 ${LSB_PATH}/include/QtGui
37 ${LSB_PATH}/include/QtOpenGL
38 )
39
40 link_libraries(QtCore QtGui QtOpenGL)
41
42 28
43 ## 29 ##
44 ## This part is adapted from file "Qt4Macros.cmake" shipped with 30 ## This part is adapted from file "Qt4Macros.cmake" shipped with
45 ## CMake 3.5.1, released under the following license: 31 ## CMake 3.5.1, released under the following license:
46 ## 32 ##
84 endforeach () 70 endforeach ()
85 endmacro () 71 endmacro ()
86 ## 72 ##
87 ## End of "Qt4Macros.cmake" adaptation. 73 ## End of "Qt4Macros.cmake" adaptation.
88 ## 74 ##
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)
102
103 set(QT_UIC_EXECUTABLE ${QT5_INSTALL_ROOT}/bin/uic)
104 set(QT_MOC_EXECUTABLE ${QT5_INSTALL_ROOT}/bin/moc)
105
106 include_directories(
107 ${QT5_INSTALL_ROOT}/include/QtCore
108 ${QT5_INSTALL_ROOT}/include/QtGui
109 ${QT5_INSTALL_ROOT}/include/QtOpenGL
110 ${QT5_INSTALL_ROOT}/include/QtWidgets
111 )
112
113 link_libraries(Qt5Core Qt5Gui Qt5OpenGL Qt5Widgets)
114
115 file(COPY
116 ${QT5_INSTALL_ROOT}/bin/Qt5Core.dll
117 ${QT5_INSTALL_ROOT}/bin/Qt5Gui.dll
118 ${QT5_INSTALL_ROOT}/bin/Qt5OpenGL.dll
119 ${QT5_INSTALL_ROOT}/bin/Qt5Widgets.dll
120 DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
121
122 file(COPY
123 ${QT5_INSTALL_ROOT}/plugins/platforms/qwindows.dll
124 DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/platforms)
89 125
90 else() 126 else()
91 # Not using Linux Standard Base 127 # Not using Windows, not using Linux Standard Base,
92 # Find the QtWidgets library 128 # Find the QtWidgets library
93 find_package(Qt5Widgets QUIET) 129 find_package(Qt5Widgets QUIET)
94 130
95 if (Qt5Widgets_FOUND) 131 if (Qt5Widgets_FOUND)
96 message("Qt5 has been detected") 132 message("Qt5 has been detected")