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