]> SALOME platform Git repositories - modules/shaper.git/blob - CMakeCommon/FindQt.cmake
Salome HOME
Merge branch 'master' of newgeom:newgeom.git
[modules/shaper.git] / CMakeCommon / FindQt.cmake
1 CMAKE_MINIMUM_REQUIRED(VERSION 2.8.11)
2
3 IF(WIN32)
4     SET(Q_WS_WIN ON)
5     SET(QT_USE_QTMAIN ON)
6 ELSE()
7     SET(Q_WS_X11 ON)
8 ENDIF()
9
10 # Widgets finds its own dependencies (QtGui and QtCore).
11 FIND_PACKAGE(Qt4 REQUIRED)
12
13 IF(Qt4_FOUND)
14     SET(QT_VERSION_STRING "${QT_VERSION_MAJOR}.${QT_VERSION_MINOR}.${QT_VERSION_PATCH}")
15         MESSAGE(STATUS "Found Qt version: "  ${QT_VERSION_STRING})
16 ENDIF()
17
18 INCLUDE(${QT_USE_FILE})
19
20 # The Qt5Widgets_INCLUDES also includes the include directories for
21 # dependencies QtCore and QtGui
22 INCLUDE_DIRECTORIES(${QT_INCLUDES})
23
24 # We need add -DQT_WIDGETS_LIB when using QtWidgets in Qt 5.
25 ADD_DEFINITIONS(${QT_DEFINITIONS})
26
27 # Executables fail to build with Qt 5 in the default configuration
28 # without -fPIE. We add that here.
29 #SET(CMAKE_CXX_FLAGS "${Qt5Widgets_EXECUTABLE_COMPILE_FLAGS}")