From: sbh Date: Wed, 9 Apr 2014 13:48:43 +0000 (+0400) Subject: Switching back to qt 4.8.4. Do not forget to fetch the qt product from \\slotex X-Git-Tag: V_0.1~32 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=678dd90d889ac8085a7211dccbb4519f96369d02;p=modules%2Fshaper.git Switching back to qt 4.8.4. Do not forget to fetch the qt product from \\slotex --- diff --git a/CMakeCommon/FindQt.cmake b/CMakeCommon/FindQt.cmake new file mode 100644 index 000000000..7c6d8c61e --- /dev/null +++ b/CMakeCommon/FindQt.cmake @@ -0,0 +1,29 @@ +CMAKE_MINIMUM_REQUIRED(VERSION 2.8.11) + +IF(WIN32) + SET(Q_WS_WIN ON) + SET(QT_USE_QTMAIN ON) +ELSE() + SET(Q_WS_X11 ON) +ENDIF() + +# Widgets finds its own dependencies (QtGui and QtCore). +FIND_PACKAGE(Qt4 REQUIRED) + +IF(Qt4_FOUND) + SET(QT_VERSION_STRING "${QT_VERSION_MAJOR}.${QT_VERSION_MINOR}.${QT_VERSION_PATCH}") + MESSAGE(STATUS "Found Qt version: " ${QT_VERSION_STRING}) +ENDIF() + +INCLUDE(${QT_USE_FILE}) + +# The Qt5Widgets_INCLUDES also includes the include directories for +# dependencies QtCore and QtGui +INCLUDE_DIRECTORIES(${QT_INCLUDES}) + +# We need add -DQT_WIDGETS_LIB when using QtWidgets in Qt 5. +ADD_DEFINITIONS(${QT_DEFINITIONS}) + +# Executables fail to build with Qt 5 in the default configuration +# without -fPIE. We add that here. +#SET(CMAKE_CXX_FLAGS "${Qt5Widgets_EXECUTABLE_COMPILE_FLAGS}") \ No newline at end of file diff --git a/CMakeCommon/FindQt5.cmake b/CMakeCommon/FindQt5.cmake deleted file mode 100644 index bed3180b2..000000000 --- a/CMakeCommon/FindQt5.cmake +++ /dev/null @@ -1,22 +0,0 @@ -CMAKE_MINIMUM_REQUIRED(VERSION 2.8.11) -#Append Qt5's install prefix into CMAKE_MODULE_PATH -SET(CMAKE_MODULE_PATH "$ENV{QTDIR}" ${CMAKE_MODULE_PATH}) - -# Widgets finds its own dependencies (QtGui and QtCore). -FIND_PACKAGE(Qt5Widgets REQUIRED) -FIND_PACKAGE(Qt5LinguistTools REQUIRED) - -IF(Qt5Widgets_FOUND) - MESSAGE(STATUS "Found Qt version:" ${Qt5Widgets_VERSION_STRING}) -ENDIF() - -# The Qt5Widgets_INCLUDES also includes the include directories for -# dependencies QtCore and QtGui -INCLUDE_DIRECTORIES(${Qt5Widgets_INCLUDES}) - -# We need add -DQT_WIDGETS_LIB when using QtWidgets in Qt 5. -ADD_DEFINITIONS(${Qt5Widgets_DEFINITIONS}) - -# Executables fail to build with Qt 5 in the default configuration -# without -fPIE. We add that here. -SET(CMAKE_CXX_FLAGS "${Qt5Widgets_EXECUTABLE_COMPILE_FLAGS}") diff --git a/CMakeLists.txt b/CMakeLists.txt index 29ee4ab93..5639cfb13 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -5,7 +5,7 @@ PROJECT (NewGEOM) SET(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/CMakeCommon" ${CMAKE_MODULE_PATH}) INCLUDE(Common) -INCLUDE(FindQt5) +INCLUDE(FindQt) INCLUDE(FindPython) ADD_SUBDIRECTORY (src/Config) diff --git a/env.bat b/env.bat index 2ac0c4d6a..9affd5422 100644 --- a/env.bat +++ b/env.bat @@ -81,10 +81,12 @@ set PATH=%CMAKEDIR%\bin;%PATH% @REM ------------------------- @REM QT -if "%QTDIR%" == "" ( - @SET QTDIR=%PDIR%\Qt-5.2.0\5.2.0\msvc2010 -) +@SET QTDIR=%PDIR%\qt-4.8.4 +@ECHO -- Creating qt.conf... +@ECHO [Paths] > %QTDIR%/bin/qt.conf +@ECHO Prefix = %QTDIR:\=/% >> %QTDIR%/bin/qt.conf @SET PATH=%QTDIR%\bin;%PATH% + @REM ------------------------- @REM ------------------------- diff --git a/src/ModuleBase/CMakeLists.txt b/src/ModuleBase/CMakeLists.txt index 00adfbb5a..240c0da62 100644 --- a/src/ModuleBase/CMakeLists.txt +++ b/src/ModuleBase/CMakeLists.txt @@ -14,7 +14,7 @@ SET(PROJECT_SOURCES SET(PROJECT_LIBRARIES ModelAPI - ${Qt5Widgets_LIBRARIES} + ${QT_LIBRARIES} ) SET(PROJECT_AUTOMOC diff --git a/src/PartSet/CMakeLists.txt b/src/PartSet/CMakeLists.txt index 0fc2e748b..337a75ad6 100644 --- a/src/PartSet/CMakeLists.txt +++ b/src/PartSet/CMakeLists.txt @@ -23,15 +23,15 @@ SET(TEXT_RESOURCES SET(PROJECT_LIBRARIES ModuleBase Config - ${Qt5Widgets_LIBRARIES} + ${QT_LIBRARIES} ) SET(PROJECT_AUTOMOC ${CMAKE_CURRENT_BINARY_DIR}/PartSet_automoc.cpp ) -QT5_ADD_RESOURCES(PROJECT_COMPILED_RESOURCES ${PROJECT_RESOURCES}) -QT5_ADD_TRANSLATION(QM_RESOURCES ${TEXT_RESOURCES}) +QT4_ADD_RESOURCES(PROJECT_COMPILED_RESOURCES ${PROJECT_RESOURCES}) +QT4_ADD_TRANSLATION(QM_RESOURCES ${TEXT_RESOURCES}) SOURCE_GROUP ("Generated Files" FILES ${PROJECT_AUTOMOC} ${PROJECT_COMPILED_RESOURCES} ${QM_RESOURCES}) SOURCE_GROUP ("Resource Files" FILES ${TEXT_RESOURCES} ${PROJECT_RESOURCES}) diff --git a/src/PyConsole/CMakeLists.txt b/src/PyConsole/CMakeLists.txt index 5d8b5820e..b623b64cf 100644 --- a/src/PyConsole/CMakeLists.txt +++ b/src/PyConsole/CMakeLists.txt @@ -36,10 +36,10 @@ SET(PROJECT_SOURCES SET(PROJECT_LIBRARIES PyInterp - ${Qt5Widgets_LIBRARIES} + ${QT_LIBRARIES} ) -QT5_ADD_TRANSLATION(QM_RESOURCES ${TEXT_RESOURCES}) +QT4_ADD_TRANSLATION(QM_RESOURCES ${TEXT_RESOURCES}) SOURCE_GROUP ("Generated Files" FILES ${PROJECT_AUTOMOC} ${QM_RESOURCES}) diff --git a/src/PyEvent/CMakeLists.txt b/src/PyEvent/CMakeLists.txt index 393b79774..833c4616f 100644 --- a/src/PyEvent/CMakeLists.txt +++ b/src/PyEvent/CMakeLists.txt @@ -19,6 +19,6 @@ ADD_LIBRARY(PyEvent STATIC ${PROJECT_HEADERS} ) -TARGET_LINK_LIBRARIES(PyEvent ${Qt5Widgets_LIBRARIES}) +TARGET_LINK_LIBRARIES(PyEvent ${QT_LIBRARIES}) #INSTALL(TARGETS PyEvent DESTINATION bin) diff --git a/src/PyInterp/CMakeLists.txt b/src/PyInterp/CMakeLists.txt index 09585ebb8..d7f7a53d6 100644 --- a/src/PyInterp/CMakeLists.txt +++ b/src/PyInterp/CMakeLists.txt @@ -25,7 +25,7 @@ SET(PROJECT_SOURCES SET(PROJECT_LIBRARIES PyEvent - ${Qt5Core_LIBRARIES} + ${QT_LIBRARIES} ) SOURCE_GROUP ("Generated Files" FILES ${PROJECT_AUTOMOC}) diff --git a/src/XGUI/CMakeLists.txt b/src/XGUI/CMakeLists.txt index c91ec1451..078e6aa4f 100644 --- a/src/XGUI/CMakeLists.txt +++ b/src/XGUI/CMakeLists.txt @@ -60,7 +60,8 @@ SET(PROJECT_LIBRARIES opengl32 Event Config - ${Qt5Widgets_LIBRARIES} + ${QT_LIBRARIES} + ${QT_QTMAIN_LIBRARY} ${CAS_VIEWER} ${CAS_KERNEL} PyConsole @@ -70,7 +71,7 @@ SET(PROJECT_LIBRARIES ModuleBase ) -QT5_ADD_RESOURCES(PROJECT_COMPILED_RESOURCES ${PROJECT_RESOURCES}) +QT4_ADD_RESOURCES(PROJECT_COMPILED_RESOURCES ${PROJECT_RESOURCES}) #QT5_ADD_TRANSLATION(QM_RESOURCES ${TEXT_RESOURCES}) #SOURCE_GROUP ("Generated Files" FILES ${PROJECT_AUTOMOC} ${PROJECT_COMPILED_RESOURCES} ${QM_RESOURCES}) @@ -93,7 +94,6 @@ ADD_EXECUTABLE(XGUI WIN32 ${PROJECT_SOURCES} ${PROJECT_HEADERS} ${PROJECT_COMPILED_RESOURCES} - ${TEXT_RESOURCES} ) ADD_DEPENDENCIES(XGUI ModelAPI) diff --git a/src/XGUI/XGUI_ViewPort.cpp b/src/XGUI/XGUI_ViewPort.cpp index 5a8b5cb7c..4398cabaa 100644 --- a/src/XGUI/XGUI_ViewPort.cpp +++ b/src/XGUI/XGUI_ViewPort.cpp @@ -14,7 +14,6 @@ #include "XGUI_Viewer.h" #include "XGUI_Constants.h" -#include #include #include #include