Salome HOME
Merge branch 'origin/BR_PORTING_CENTOS_6_3'
[modules/shaper.git] / CMakeCommon / FindQt.cmake
1 CMAKE_MINIMUM_REQUIRED(VERSION 2.8.10)
2 IF(WIN32)
3     SET(QT_USE_QTMAIN ON)
4 ENDIF()
5
6 # Widgets finds its own dependencies (QtGui and QtCore).
7 FIND_PACKAGE(Qt4 REQUIRED)
8
9 IF(NOT QT4_FOUND)
10     MESSAGE(FATAL_ERROR "Qt not found.")
11 ENDIF()
12
13 INCLUDE(${QT_USE_FILE})
14
15 # The Qt5Widgets_INCLUDES also includes the include directories for
16 # dependencies QtCore and QtGui
17 INCLUDE_DIRECTORIES(${QT_INCLUDES})
18
19 # We need add -DQT_WIDGETS_LIB when using QtWidgets in Qt 5.
20 ADD_DEFINITIONS(${QT_DEFINITIONS})
21
22 # Executables fail to build with Qt 5 in the default configuration
23 # without -fPIE. We add that here.
24 #SET(CMAKE_CXX_FLAGS "${Qt5Widgets_EXECUTABLE_COMPILE_FLAGS}")