From 238a5824be1d1dd65d7118f4c09a5fe407766589 Mon Sep 17 00:00:00 2001 From: sandstranger Date: Thu, 3 Dec 2015 08:54:14 +0300 Subject: [PATCH] add custom new variable fot Qt --- CMakeLists.txt | 17 +++++-- apps/openmw/CMakeLists.txt | 22 +------- components/CMakeLists.txt | 68 ++++++++++--------------- components/sdlutil/sdlcursormanager.cpp | 3 -- 4 files changed, 40 insertions(+), 70 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 61a44b758..b41f0773f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -168,14 +168,23 @@ endif (ANDROID) option(OPENGL_ES "enable opengl es support" FALSE ) +option(USE_QT "Use Qt in building" TRUE ) + +if (NOT BUILD_LAUNCHER AND NOT BUILD_OPENCS) + set(USE_QT FALSE CACHE BOOL "disable Qt" FORCE ) +else() + set(USE_QT TRUE CACHE BOOL "enable Qt" FORCE ) +endif() + +add_definitions (-DUSE_QT) + if (OPENGL_ES) - INCLUDE(cmake/FindOpenGLES.cmake) + find_package(OpenGLES) add_definitions (-DOPENGL_ES) - INCLUDE_DIRECTORIES(${OPENGLES_INCLUDE_DIR}) endif (OPENGLES) # Dependencies -if (NOT ANDROID) +if (USE_QT) set(DESIRED_QT_VERSION 4 CACHE STRING "The QT version OpenMW should use (4 or 5)") message(STATUS "Using Qt${DESIRED_QT_VERSION}") @@ -220,7 +229,7 @@ IF(BOOST_STATIC) set(Boost_USE_STATIC_LIBS ON) endif() -if (NOT ANDROID) +if (USE_QT) find_package(OpenSceneGraph 3.2.0 REQUIRED osgDB osgViewer osgText osgGA osgAnimation osgParticle osgQt osgUtil osgFX) else() find_package(OpenSceneGraph 3.2.0 REQUIRED osgDB osgViewer osgText osgGA osgAnimation osgParticle osgUtil osgFX) diff --git a/apps/openmw/CMakeLists.txt b/apps/openmw/CMakeLists.txt index 4512e004d..03ce71f5c 100644 --- a/apps/openmw/CMakeLists.txt +++ b/apps/openmw/CMakeLists.txt @@ -155,35 +155,15 @@ if (ANDROID) android log dl - MyGUIEngineStatic - BulletCollision - LinearMath z - osg - osgDB - osgAnimation - osgText - osgUtil - osgShadow ${OPENSCENEGRAPH_LIBRARIES} ${OSG_PLUGINS} - ${Boost_SYSTEM_LIBRARY} - ${Boost_THREAD_LIBRARY} - ${Boost_FILESYSTEM_LIBRARY} - ${Boost_PROGRAM_OPTIONS_LIBRARY} jpeg gif - png + png ) endif (ANDROID) - -if (OPENGL_ES) - target_link_libraries(openmw - ${OPENGLES_gl_LIBRARY} - ) -endif (OPENGL_ES) - if (USE_SYSTEM_TINYXML) target_link_libraries(openmw ${TINYXML_LIBRARIES}) endif() diff --git a/components/CMakeLists.txt b/components/CMakeLists.txt index 92e11c51c..edc7b7c25 100644 --- a/components/CMakeLists.txt +++ b/components/CMakeLists.txt @@ -139,7 +139,7 @@ add_component_dir (version set (ESM_UI ${CMAKE_SOURCE_DIR}/files/ui/contentselector.ui ) -if (NOT ANDROID) +if (USE_QT) add_component_qt_dir (contentselector model/modelitem model/esmfile model/naturalsort model/contentmodel @@ -176,55 +176,39 @@ include_directories(${BULLET_INCLUDE_DIRS} ${CMAKE_CURRENT_BINARY_DIR}) add_library(components STATIC ${COMPONENT_FILES} ${MOC_SRCS} ${ESM_UI_HDR}) -if (NOT ANDROID) - target_link_libraries(components - ${Boost_SYSTEM_LIBRARY} - ${Boost_FILESYSTEM_LIBRARY} - ${Boost_THREAD_LIBRARY} - ${Boost_PROGRAM_OPTIONS_LIBRARY} - ${OSG_LIBRARIES} - ${OPENTHREADS_LIBRARIES} - ${OSGPARTICLE_LIBRARIES} - ${OSGUTIL_LIBRARIES} - ${OSGDB_LIBRARIES} - ${OSGVIEWER_LIBRARIES} - ${OSGGA_LIBRARIES} - ${OSGFX_LIBRARIES} - ${OSGANIMATION_LIBRARIES} - ${BULLET_LIBRARIES} - ${SDL2_LIBRARY} - # For MyGUI platform - ${OPENGL_gl_LIBRARY} - ${MYGUI_LIBRARIES} - ) +if (OPENGL_ES) + set(GL_LIB ${OPENGLES_gl_LIBRARY}) else() - target_link_libraries(components - ${Boost_SYSTEM_LIBRARY} - ${Boost_FILESYSTEM_LIBRARY} - ${Boost_THREAD_LIBRARY} - ${Boost_PROGRAM_OPTIONS_LIBRARY} - ${OSG_LIBRARIES} - ${OPENTHREADS_LIBRARIES} - ${OSGPARTICLE_LIBRARIES} - ${OSGUTIL_LIBRARIES} - ${OSGDB_LIBRARIES} - ${OSGVIEWER_LIBRARIES} - ${OSGGA_LIBRARIES} - ${OSGFX_LIBRARIES} - ${OSGANIMATION_LIBRARIES} - ${BULLET_LIBRARIES} - ${SDL2_LIBRARY} - # For MyGUI platform - ${MYGUI_LIBRARIES} - ) + set(GL_LIB ${OPENGL_gl_LIBRARY}) endif() +target_link_libraries(components + ${Boost_SYSTEM_LIBRARY} + ${Boost_FILESYSTEM_LIBRARY} + ${Boost_THREAD_LIBRARY} + ${Boost_PROGRAM_OPTIONS_LIBRARY} + ${OSG_LIBRARIES} + ${OPENTHREADS_LIBRARIES} + ${OSGPARTICLE_LIBRARIES} + ${OSGUTIL_LIBRARIES} + ${OSGDB_LIBRARIES} + ${OSGVIEWER_LIBRARIES} + ${OSGGA_LIBRARIES} + ${OSGFX_LIBRARIES} + ${OSGANIMATION_LIBRARIES} + ${BULLET_LIBRARIES} + ${SDL2_LIBRARY} + # For MyGUI platform + ${GL_LIB} + ${MYGUI_LIBRARIES} + ) + if (WIN32) target_link_libraries(components ${Boost_LOCALE_LIBRARY}) endif() -if (NOT ANDROID) +if (USE_QT) if (DESIRED_QT_VERSION MATCHES 4) target_link_libraries(components ${QT_QTCORE_LIBRARY} diff --git a/components/sdlutil/sdlcursormanager.cpp b/components/sdlutil/sdlcursormanager.cpp index c131621a8..0eb161a64 100644 --- a/components/sdlutil/sdlcursormanager.cpp +++ b/components/sdlutil/sdlcursormanager.cpp @@ -221,9 +221,6 @@ namespace SDLUtil return; #endif - if (mCursorMap.find(name) != mCursorMap.end()) - return; - if (mCursorMap.find(name) != mCursorMap.end()) return;