Salome HOME
Merge branch 'master' of newgeom:newgeom
[modules/shaper.git] / CMakeCommon / FindQt5.cmake
1 CMAKE_MINIMUM_REQUIRED(VERSION 2.8.11)
2 #Append Qt5's install prefix into CMAKE_MODULE_PATH
3 SET(CMAKE_MODULE_PATH "$ENV{QTDIR}" ${CMAKE_MODULE_PATH})
4
5 # Widgets finds its own dependencies (QtGui and QtCore).
6 FIND_PACKAGE(Qt5Widgets REQUIRED)
7 FIND_PACKAGE(Qt5LinguistTools REQUIRED)
8
9 IF(Qt5Widgets_FOUND)
10         MESSAGE(STATUS "Found Qt version:" ${Qt5Widgets_VERSION_STRING})
11 ENDIF()
12
13 # The Qt5Widgets_INCLUDES also includes the include directories for
14 # dependencies QtCore and QtGui
15 INCLUDE_DIRECTORIES(${Qt5Widgets_INCLUDES})
16
17 # We need add -DQT_WIDGETS_LIB when using QtWidgets in Qt 5.
18 ADD_DEFINITIONS(${Qt5Widgets_DEFINITIONS})
19
20 # Executables fail to build with Qt 5 in the default configuration
21 # without -fPIE. We add that here.
22 SET(CMAKE_CXX_FLAGS "${Qt5Widgets_EXECUTABLE_COMPILE_FLAGS}")