forked from mirror/openmw-tes3mp
Reduced server dependings
This commit is contained in:
parent
1f0d6eba80
commit
ed3dc8ca7b
2 changed files with 75 additions and 62 deletions
127
CMakeLists.txt
127
CMakeLists.txt
|
@ -155,10 +155,11 @@ else()
|
||||||
cmake_minimum_required(VERSION 2.6)
|
cmake_minimum_required(VERSION 2.6)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Sound setup
|
IF(BUILD_OPENMW OR BUILD_OPENCS)
|
||||||
find_package(FFmpeg REQUIRED COMPONENTS AVCODEC AVFORMAT AVUTIL SWSCALE SWRESAMPLE)
|
# Sound setup
|
||||||
# Required for building the FFmpeg headers
|
find_package(FFmpeg REQUIRED COMPONENTS AVCODEC AVFORMAT AVUTIL SWSCALE SWRESAMPLE)
|
||||||
add_definitions(-D__STDC_CONSTANT_MACROS)
|
# Required for building the FFmpeg headers
|
||||||
|
add_definitions(-D__STDC_CONSTANT_MACROS)
|
||||||
|
|
||||||
# TinyXML
|
# TinyXML
|
||||||
option(USE_SYSTEM_TINYXML "Use system TinyXML library instead of internal." OFF)
|
option(USE_SYSTEM_TINYXML "Use system TinyXML library instead of internal." OFF)
|
||||||
|
@ -167,6 +168,7 @@ if (USE_SYSTEM_TINYXML)
|
||||||
add_definitions (-DTIXML_USE_STL)
|
add_definitions (-DTIXML_USE_STL)
|
||||||
include_directories(SYSTEM ${TinyXML_INCLUDE_DIRS})
|
include_directories(SYSTEM ${TinyXML_INCLUDE_DIRS})
|
||||||
endif()
|
endif()
|
||||||
|
ENDIF(BUILD_OPENMW OR BUILD_OPENCS)
|
||||||
|
|
||||||
# Platform specific
|
# Platform specific
|
||||||
if (WIN32)
|
if (WIN32)
|
||||||
|
@ -216,77 +218,80 @@ IF(BOOST_STATIC)
|
||||||
set(Boost_USE_STATIC_LIBS ON)
|
set(Boost_USE_STATIC_LIBS ON)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
find_package(OpenSceneGraph 3.3.4 REQUIRED osgDB osgViewer osgText osgGA osgAnimation osgParticle osgUtil osgFX)
|
IF(BUILD_OPENMW OR BUILD_OPENCS)
|
||||||
|
find_package(OpenSceneGraph 3.3.4 REQUIRED osgDB osgViewer osgText osgGA osgAnimation osgParticle osgUtil osgFX)
|
||||||
|
|
||||||
include_directories(${OPENSCENEGRAPH_INCLUDE_DIRS})
|
include_directories(${OPENSCENEGRAPH_INCLUDE_DIRS})
|
||||||
|
|
||||||
if(OSG_STATIC)
|
if(OSG_STATIC)
|
||||||
macro(use_static_osg_plugin_library PLUGIN_NAME)
|
macro(use_static_osg_plugin_library PLUGIN_NAME)
|
||||||
set(PLUGIN_NAME_DBG ${PLUGIN_NAME}d ${PLUGIN_NAME}D ${PLUGIN_NAME}_d ${PLUGIN_NAME}_D ${PLUGIN_NAME}_debug ${PLUGIN_NAME})
|
set(PLUGIN_NAME_DBG ${PLUGIN_NAME}d ${PLUGIN_NAME}D ${PLUGIN_NAME}_d ${PLUGIN_NAME}_D ${PLUGIN_NAME}_debug ${PLUGIN_NAME})
|
||||||
|
|
||||||
# For now, users wishing to do a static build will need to pass the path to where the plugins reside
|
# For now, users wishing to do a static build will need to pass the path to where the plugins reside
|
||||||
# More clever logic would need to deduce the path, probably installed under <OpenSceneGraph>/lib/osgPlugins-<X.X.X>
|
# More clever logic would need to deduce the path, probably installed under <OpenSceneGraph>/lib/osgPlugins-<X.X.X>
|
||||||
include(FindPkgMacros)
|
include(FindPkgMacros)
|
||||||
find_library(${PLUGIN_NAME}_LIBRARY_REL NAMES ${PLUGIN_NAME} HINTS ${OSG_PLUGIN_LIB_SEARCH_PATH})
|
find_library(${PLUGIN_NAME}_LIBRARY_REL NAMES ${PLUGIN_NAME} HINTS ${OSG_PLUGIN_LIB_SEARCH_PATH})
|
||||||
find_library(${PLUGIN_NAME}_LIBRARY_DBG NAMES ${PLUGIN_NAME_DBG} HINTS ${OSG_PLUGIN_LIB_SEARCH_PATH})
|
find_library(${PLUGIN_NAME}_LIBRARY_DBG NAMES ${PLUGIN_NAME_DBG} HINTS ${OSG_PLUGIN_LIB_SEARCH_PATH})
|
||||||
make_library_set(${PLUGIN_NAME}_LIBRARY)
|
make_library_set(${PLUGIN_NAME}_LIBRARY)
|
||||||
|
|
||||||
if("${${PLUGIN_NAME}_LIBRARY}" STREQUAL "")
|
if("${${PLUGIN_NAME}_LIBRARY}" STREQUAL "")
|
||||||
message(FATAL_ERROR "Unable to find static OpenSceneGraph plugin: ${PLUGIN_NAME}")
|
message(FATAL_ERROR "Unable to find static OpenSceneGraph plugin: ${PLUGIN_NAME}")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
set(OPENSCENEGRAPH_LIBRARIES ${OPENSCENEGRAPH_LIBRARIES} ${${PLUGIN_NAME}_LIBRARY})
|
set(OPENSCENEGRAPH_LIBRARIES ${OPENSCENEGRAPH_LIBRARIES} ${${PLUGIN_NAME}_LIBRARY})
|
||||||
endmacro()
|
endmacro()
|
||||||
|
|
||||||
add_definitions(-DOSG_LIBRARY_STATIC)
|
add_definitions(-DOSG_LIBRARY_STATIC)
|
||||||
|
|
||||||
set(PLUGIN_LIST
|
set(PLUGIN_LIST
|
||||||
osgdb_png # depends on libpng, zlib
|
osgdb_png # depends on libpng, zlib
|
||||||
osgdb_tga
|
osgdb_tga
|
||||||
osgdb_dds
|
osgdb_dds
|
||||||
osgdb_jpeg # depends on libjpeg
|
osgdb_jpeg # depends on libjpeg
|
||||||
)
|
)
|
||||||
|
|
||||||
foreach(PLUGIN ${PLUGIN_LIST})
|
foreach(PLUGIN ${PLUGIN_LIST})
|
||||||
use_static_osg_plugin_library(${PLUGIN})
|
use_static_osg_plugin_library(${PLUGIN})
|
||||||
endforeach()
|
endforeach()
|
||||||
|
|
||||||
# OSG static plugins need to linked against their respective dependencies
|
# OSG static plugins need to linked against their respective dependencies
|
||||||
set(PLUGIN_DEPS_LIST
|
set(PLUGIN_DEPS_LIST
|
||||||
PNG # needed by osgdb_png
|
PNG # needed by osgdb_png
|
||||||
ZLIB # needed by osgdb_png
|
ZLIB # needed by osgdb_png
|
||||||
JPEG # needed by osgdb_jpeg
|
JPEG # needed by osgdb_jpeg
|
||||||
)
|
)
|
||||||
|
|
||||||
macro(use_static_osg_plugin_dep DEPENDENCY)
|
macro(use_static_osg_plugin_dep DEPENDENCY)
|
||||||
find_package(${DEPENDENCY} REQUIRED)
|
find_package(${DEPENDENCY} REQUIRED)
|
||||||
|
|
||||||
set(OPENSCENEGRAPH_LIBRARIES ${OPENSCENEGRAPH_LIBRARIES} ${${DEPENDENCY}_LIBRARIES})
|
set(OPENSCENEGRAPH_LIBRARIES ${OPENSCENEGRAPH_LIBRARIES} ${${DEPENDENCY}_LIBRARIES})
|
||||||
endmacro()
|
endmacro()
|
||||||
foreach(DEPENDENCY ${PLUGIN_DEPS_LIST})
|
foreach(DEPENDENCY ${PLUGIN_DEPS_LIST})
|
||||||
use_static_osg_plugin_dep(${DEPENDENCY})
|
use_static_osg_plugin_dep(${DEPENDENCY})
|
||||||
endforeach()
|
endforeach()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(QT_STATIC)
|
if(QT_STATIC)
|
||||||
if(WIN32)
|
if(WIN32)
|
||||||
if(DESIRED_QT_VERSION MATCHES 4)
|
if(DESIRED_QT_VERSION MATCHES 4)
|
||||||
# QtCore needs WSAAsyncSelect from Ws2_32.lib
|
# QtCore needs WSAAsyncSelect from Ws2_32.lib
|
||||||
set(QT_QTCORE_LIBRARY ${QT_QTCORE_LIBRARY} Ws2_32.lib)
|
set(QT_QTCORE_LIBRARY ${QT_QTCORE_LIBRARY} Ws2_32.lib)
|
||||||
message("QT_QTCORE_LIBRARY: ${QT_QTCORE_LIBRARY}")
|
message("QT_QTCORE_LIBRARY: ${QT_QTCORE_LIBRARY}")
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
find_package(MyGUI REQUIRED)
|
find_package(MyGUI REQUIRED)
|
||||||
if (${MYGUI_VERSION} VERSION_LESS "3.2.1")
|
if (${MYGUI_VERSION} VERSION_LESS "3.2.1")
|
||||||
message(FATAL_ERROR "OpenMW requires MyGUI 3.2.1 or later, please install the latest version from http://mygui.info")
|
message(FATAL_ERROR "OpenMW requires MyGUI 3.2.1 or later, please install the latest version from http://mygui.info")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
find_package(SDL2 REQUIRED)
|
||||||
|
find_package(OpenAL REQUIRED)
|
||||||
|
find_package(Bullet 283 REQUIRED COMPONENTS BulletCollision LinearMath)
|
||||||
|
ENDIF(BUILD_OPENMW OR BUILD_OPENCS)
|
||||||
|
|
||||||
find_package(Boost REQUIRED COMPONENTS ${BOOST_COMPONENTS})
|
find_package(Boost REQUIRED COMPONENTS ${BOOST_COMPONENTS})
|
||||||
find_package(SDL2 REQUIRED)
|
|
||||||
find_package(OpenAL REQUIRED)
|
|
||||||
find_package(Bullet 283 REQUIRED COMPONENTS BulletCollision LinearMath)
|
|
||||||
|
|
||||||
include_directories("."
|
include_directories("."
|
||||||
SYSTEM
|
SYSTEM
|
||||||
|
@ -556,11 +561,13 @@ if(WIN32)
|
||||||
endif(WIN32)
|
endif(WIN32)
|
||||||
|
|
||||||
# Extern
|
# Extern
|
||||||
|
IF(BUILD_OPENMW OR BUILD_OPENCS)
|
||||||
add_subdirectory (extern/osg-ffmpeg-videoplayer)
|
add_subdirectory (extern/osg-ffmpeg-videoplayer)
|
||||||
add_subdirectory (extern/oics)
|
add_subdirectory (extern/oics)
|
||||||
if (USE_QT)
|
if (USE_QT)
|
||||||
add_subdirectory (extern/osgQt)
|
add_subdirectory (extern/osgQt)
|
||||||
endif()
|
endif()
|
||||||
|
ENDIF(BUILD_OPENMW OR BUILD_OPENCS)
|
||||||
|
|
||||||
# Components
|
# Components
|
||||||
add_subdirectory (components)
|
add_subdirectory (components)
|
||||||
|
|
|
@ -40,6 +40,7 @@ add_component_dir (vfs
|
||||||
manager archive bsaarchive filesystemarchive registerarchives
|
manager archive bsaarchive filesystemarchive registerarchives
|
||||||
)
|
)
|
||||||
|
|
||||||
|
IF(BUILD_OPENMW OR BUILD_OPENCS)
|
||||||
add_component_dir (resource
|
add_component_dir (resource
|
||||||
scenemanager keyframemanager imagemanager bulletshapemanager bulletshape niffilemanager objectcache multiobjectcache resourcesystem resourcemanager
|
scenemanager keyframemanager imagemanager bulletshapemanager bulletshape niffilemanager objectcache multiobjectcache resourcesystem resourcemanager
|
||||||
)
|
)
|
||||||
|
@ -64,6 +65,7 @@ add_component_dir (nifosg
|
||||||
add_component_dir (nifbullet
|
add_component_dir (nifbullet
|
||||||
bulletnifloader
|
bulletnifloader
|
||||||
)
|
)
|
||||||
|
ENDIF(BUILD_OPENMW OR BUILD_OPENCS)
|
||||||
|
|
||||||
add_component_dir (to_utf8
|
add_component_dir (to_utf8
|
||||||
to_utf8
|
to_utf8
|
||||||
|
@ -121,6 +123,7 @@ add_component_dir (loadinglistener
|
||||||
loadinglistener
|
loadinglistener
|
||||||
)
|
)
|
||||||
|
|
||||||
|
IF(BUILD_OPENMW OR BUILD_OPENCS)
|
||||||
add_component_dir (myguiplatform
|
add_component_dir (myguiplatform
|
||||||
myguirendermanager myguidatamanager myguiplatform myguitexture myguiloglistener additivelayer scalinglayer
|
myguirendermanager myguidatamanager myguiplatform myguitexture myguiloglistener additivelayer scalinglayer
|
||||||
)
|
)
|
||||||
|
@ -136,6 +139,7 @@ add_component_dir (fontloader
|
||||||
add_component_dir (sdlutil
|
add_component_dir (sdlutil
|
||||||
sdlgraphicswindow imagetosurface sdlinputwrapper sdlvideowrapper OISCompat events sdlcursormanager
|
sdlgraphicswindow imagetosurface sdlinputwrapper sdlvideowrapper OISCompat events sdlcursormanager
|
||||||
)
|
)
|
||||||
|
ENDIF(BUILD_OPENMW OR BUILD_OPENCS)
|
||||||
|
|
||||||
add_component_dir (version
|
add_component_dir (version
|
||||||
version
|
version
|
||||||
|
@ -155,6 +159,7 @@ add_component_dir (fallback
|
||||||
set (ESM_UI ${CMAKE_SOURCE_DIR}/files/ui/contentselector.ui
|
set (ESM_UI ${CMAKE_SOURCE_DIR}/files/ui/contentselector.ui
|
||||||
)
|
)
|
||||||
|
|
||||||
|
IF(BUILD_OPENMW OR BUILD_OPENCS)
|
||||||
if (USE_QT)
|
if (USE_QT)
|
||||||
add_component_qt_dir (contentselector
|
add_component_qt_dir (contentselector
|
||||||
model/modelitem model/esmfile
|
model/modelitem model/esmfile
|
||||||
|
@ -181,6 +186,7 @@ if (USE_QT)
|
||||||
QT5_WRAP_CPP(MOC_SRCS ${COMPONENT_MOC_FILES})
|
QT5_WRAP_CPP(MOC_SRCS ${COMPONENT_MOC_FILES})
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
ENDIF(BUILD_OPENMW OR BUILD_OPENCS)
|
||||||
|
|
||||||
if (CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
|
if (CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
|
||||||
if("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "x86_64" AND NOT APPLE)
|
if("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "x86_64" AND NOT APPLE)
|
||||||
|
|
Loading…
Reference in a new issue