--- /dev/null
+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
+++ /dev/null
-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}")
SET(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/CMakeCommon" ${CMAKE_MODULE_PATH})
INCLUDE(Common)
-INCLUDE(FindQt5)
+INCLUDE(FindQt)
INCLUDE(FindPython)
ADD_SUBDIRECTORY (src/Config)
@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 -------------------------
SET(PROJECT_LIBRARIES
ModelAPI
- ${Qt5Widgets_LIBRARIES}
+ ${QT_LIBRARIES}
)
SET(PROJECT_AUTOMOC
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})
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})
${PROJECT_HEADERS}
)
-TARGET_LINK_LIBRARIES(PyEvent ${Qt5Widgets_LIBRARIES})
+TARGET_LINK_LIBRARIES(PyEvent ${QT_LIBRARIES})
#INSTALL(TARGETS PyEvent DESTINATION bin)
SET(PROJECT_LIBRARIES
PyEvent
- ${Qt5Core_LIBRARIES}
+ ${QT_LIBRARIES}
)
SOURCE_GROUP ("Generated Files" FILES ${PROJECT_AUTOMOC})
opengl32
Event
Config
- ${Qt5Widgets_LIBRARIES}
+ ${QT_LIBRARIES}
+ ${QT_QTMAIN_LIBRARY}
${CAS_VIEWER}
${CAS_KERNEL}
PyConsole
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})
${PROJECT_SOURCES}
${PROJECT_HEADERS}
${PROJECT_COMPILED_RESOURCES}
- ${TEXT_RESOURCES}
)
ADD_DEPENDENCIES(XGUI ModelAPI)
#include "XGUI_Viewer.h"
#include "XGUI_Constants.h"
-#include <QGuiApplication>
#include <QPaintEvent>
#include <QPainter>
#include <QFileInfo>