1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-15 20:49:56 +00:00
openmw-tes3mp/components/CMakeLists.txt

302 lines
9.4 KiB
Text
Raw Normal View History

2011-11-06 08:30:15 +00:00
project (Components)
# Version file
set (VERSION_IN_FILE "${OpenMW_SOURCE_DIR}/files/version.in")
set (VERSION_FILE "${OpenMW_BINARY_DIR}/resources/version")
if (GIT_CHECKOUT)
add_custom_target (git-version
COMMAND ${CMAKE_COMMAND}
-DGIT_EXECUTABLE=${GIT_EXECUTABLE}
-DPROJECT_SOURCE_DIR=${PROJECT_SOURCE_DIR}
-DVERSION_IN_FILE=${VERSION_IN_FILE}
-DVERSION_FILE=${VERSION_FILE}
-DOPENMW_VERSION_MAJOR=${OPENMW_VERSION_MAJOR}
-DOPENMW_VERSION_MINOR=${OPENMW_VERSION_MINOR}
-DOPENMW_VERSION_RELEASE=${OPENMW_VERSION_RELEASE}
-DOPENMW_VERSION=${OPENMW_VERSION}
-P ${CMAKE_CURRENT_SOURCE_DIR}/../cmake/GitVersion.cmake
VERBATIM)
else (GIT_CHECKOUT)
configure_file(${VERSION_IN_FILE} ${VERSION_FILE})
endif (GIT_CHECKOUT)
2017-01-03 11:03:51 +00:00
if(BUILD_OPENMW OR BUILD_OPENCS)
if (OPENGL_ES)
find_package(OpenGLES REQUIRED)
else()
find_package(OpenGL REQUIRED)
endif()
endif(BUILD_OPENMW OR BUILD_OPENCS)
2015-04-30 23:15:25 +00:00
2011-11-06 08:30:15 +00:00
# source files
2012-03-30 16:38:33 +00:00
add_component_dir (settings
settings
)
2011-11-06 08:30:15 +00:00
add_component_dir (bsa
2015-02-17 16:08:55 +00:00
bsa_file
2011-11-06 08:30:15 +00:00
)
add_component_dir (vfs
manager archive bsaarchive filesystemarchive registerarchives
)
2016-08-02 10:52:58 +00:00
IF(BUILD_OPENMW OR BUILD_OPENCS)
2015-03-26 17:02:51 +00:00
add_component_dir (resource
scenemanager keyframemanager imagemanager bulletshapemanager bulletshape niffilemanager objectcache multiobjectcache resourcesystem resourcemanager stats
2015-03-26 17:02:51 +00:00
)
add_component_dir (shader
shadermanager shadervisitor
)
2015-03-26 17:02:51 +00:00
add_component_dir (sceneutil
2016-01-06 12:19:15 +00:00
clone attach visitor util statesetupdater controller skeleton riggeometry lightcontroller
lightmanager lightutil positionattitudetransform workqueue unrefqueue pathgridutil waterutil writescene serialize optimizer
2015-03-26 17:02:51 +00:00
)
2011-11-06 08:30:15 +00:00
add_component_dir (nif
2015-09-24 13:21:42 +00:00
controlled effect niftypes record controller extra node record_ptr data niffile property nifkey base nifstream
2011-11-06 08:30:15 +00:00
)
add_component_dir (nifosg
2015-04-21 18:30:48 +00:00
nifloader controller particle userdata
)
add_component_dir (nifbullet
bulletnifloader
)
2016-08-02 10:52:58 +00:00
ENDIF(BUILD_OPENMW OR BUILD_OPENCS)
2011-11-06 08:30:15 +00:00
add_component_dir (to_utf8
to_utf8
)
add_component_dir (esm
attr defs esmcommon esmreader esmwriter loadacti loadalch loadappa loadarmo loadbody loadbook loadbsgn loadcell
2015-01-19 12:16:12 +00:00
loadclas loadclot loadcont loadcrea loaddial loaddoor loadench loadfact loadglob loadgmst
loadinfo loadingr loadland loadlevlist loadligh loadlock loadprob loadrepa loadltex loadmgef loadmisc
2011-11-06 08:30:15 +00:00
loadnpc loadpgrd loadrace loadregn loadscpt loadskil loadsndg loadsoun loadspel loadsscr loadstat
loadweap records aipackage effectlist spelllist variant variantimp loadtes3 cellref filter
savedgame journalentry queststate locals globalscript player objectstate cellid cellstate globalmap inventorystate containerstate npcstate creaturestate dialoguestate statstate
2014-08-03 08:12:03 +00:00
npcstats creaturestats weatherstate quickkeys fogstate spellstate activespells creaturelevliststate doorstate projectilestate debugprofile
2016-10-20 00:12:01 +00:00
aisequence magiceffects util custommarkerstate stolenitems transport animationstate controlsstate
2011-11-06 08:30:15 +00:00
)
add_component_dir (esmterrain
storage
2011-11-06 08:30:15 +00:00
)
add_component_dir (misc
utf8stream stringops resourcehelpers rng messageformatparser
2011-11-06 08:30:15 +00:00
)
IF(NOT WIN32 AND NOT APPLE)
add_definitions(-DGLOBAL_DATA_PATH="${GLOBAL_DATA_PATH}")
add_definitions(-DGLOBAL_CONFIG_PATH="${GLOBAL_CONFIG_PATH}")
ENDIF()
2011-11-06 08:30:15 +00:00
add_component_dir (files
linuxpath androidpath windowspath macospath fixedpath multidircollection collections configurationmanager escape
2015-05-28 00:34:38 +00:00
lowlevelfile constrainedfilestream memorystream
2011-11-06 08:30:15 +00:00
)
add_component_dir (compiler
context controlparser errorhandler exception exprparser extensions fileparser generator
lineparser literals locals output parser scanner scriptparser skipparser streamerrorhandler
2014-02-10 12:01:52 +00:00
stringparser tokenloc nullerrorhandler opcodes extensions0 declarationparser
quickfileparser discardparser junkparser
2011-11-06 08:30:15 +00:00
)
add_component_dir (interpreter
context controlopcodes genericopcodes installopcodes interpreter localopcodes mathopcodes
miscopcodes opcodes runtime scriptopcodes spatialopcodes types defines
2011-11-06 08:30:15 +00:00
)
add_component_dir (translation
translation
2012-12-23 19:23:24 +00:00
)
add_component_dir (terrain
storage world buffercache defs terraingrid material terraindrawable texturemanager chunkmanager compositemaprenderer quadtreeworld quadtreenode viewdata
)
add_component_dir (loadinglistener
loadinglistener
)
2016-08-02 10:52:58 +00:00
IF(BUILD_OPENMW OR BUILD_OPENCS)
2015-04-30 23:15:25 +00:00
add_component_dir (myguiplatform
myguirendermanager myguidatamanager myguiplatform myguitexture myguiloglistener additivelayer scalinglayer
2015-04-30 23:15:25 +00:00
)
add_component_dir (widgets
box imagebutton tags list numericeditbox sharedstatebutton windowcaption widgets
)
add_component_dir (fontloader
fontloader
)
add_component_dir (sdlutil
sdlgraphicswindow imagetosurface sdlinputwrapper sdlvideowrapper OISCompat events sdlcursormanager
)
2016-08-02 10:52:58 +00:00
ENDIF(BUILD_OPENMW OR BUILD_OPENCS)
add_component_dir (version
version
)
add_component_dir (openmw-mp
Log Utils NetworkMessages Version
)
add_component_dir (openmw-mp\\Base
BaseActor BaseEvent BasePacketProcessor BasePlayer BaseStructs
)
add_component_dir (openmw-mp\\Controllers
PlayerPacketController ActorPacketController WorldPacketController
)
add_component_dir(openmw-mp\\Master
2017-04-23 05:39:38 +00:00
MasterData PacketMasterQuery PacketMasterUpdate PacketMasterAnnounce BaseMasterPacket ProxyMasterPacket
)
add_component_dir (openmw-mp\\Packets
BasePacket PacketPreInit
)
add_component_dir (openmw-mp\\Packets\\Actor
ActorPacket
PacketActorList PacketActorAuthority PacketActorTest PacketActorAnimPlay PacketActorAttack PacketActorCellChange
PacketActorAnimFlags PacketActorStatsDynamic PacketActorPosition PacketActorSpeech
)
add_component_dir (openmw-mp\\Packets\\Player
PlayerPacket
PacketHandshake PacketChatMessage PacketPlayerBaseInfo PacketPlayerPosition PacketPlayerEquipment
PacketPlayerAttack PacketPlayerStatsDynamic PacketPlayerAnimFlags PacketPlayerCharGen PacketPlayerAttribute
PacketPlayerSkill PacketPlayerLevel PacketPlayerClass PacketPlayerInventory PacketPlayerSpellbook
PacketPlayerJournal PacketPlayerActiveSkills PacketPlayerCellChange PacketPlayerCellState PacketPlayerDeath
PacketPlayerResurrect PacketGUIBoxes PacketTime
)
add_component_dir (openmw-mp\\Packets\\World
WorldPacket
PacketObjectDelete PacketObjectPlace PacketObjectScale PacketObjectLock PacketObjectUnlock PacketObjectMove
PacketObjectRotate PacketObjectAnimPlay PacketContainer PacketDoorState PacketMusicPlay PacketVideoPlay
PacketScriptLocalShort PacketScriptLocalFloat PacketScriptMemberShort PacketScriptGlobalShort
)
2016-01-06 11:46:06 +00:00
add_component_dir (fallback
fallback validate
)
set (ESM_UI ${CMAKE_SOURCE_DIR}/files/ui/contentselector.ui
)
2016-08-02 10:52:58 +00:00
IF(BUILD_OPENMW OR BUILD_OPENCS)
2015-12-03 05:54:14 +00:00
if (USE_QT)
2015-12-02 19:40:04 +00:00
add_component_qt_dir (contentselector
model/modelitem model/esmfile
model/naturalsort model/contentmodel
model/loadordererror
view/combobox view/contentselector
)
add_component_qt_dir (config
gamesettings
launchersettings
settingsbase
)
add_component_qt_dir (process
processinvoker
)
if (DESIRED_QT_VERSION MATCHES 4)
include(${QT_USE_FILE})
QT4_WRAP_UI(ESM_UI_HDR ${ESM_UI})
QT4_WRAP_CPP(MOC_SRCS ${COMPONENT_MOC_FILES})
else()
QT5_WRAP_UI(ESM_UI_HDR ${ESM_UI})
QT5_WRAP_CPP(MOC_SRCS ${COMPONENT_MOC_FILES})
endif()
endif()
2016-08-02 10:52:58 +00:00
ENDIF(BUILD_OPENMW OR BUILD_OPENCS)
2013-01-27 21:40:38 +00:00
if (CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
if("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "x86_64" AND NOT APPLE)
add_definitions(-fPIC)
endif()
endif ()
include_directories(${Bullet_INCLUDE_DIRS} ${CMAKE_CURRENT_BINARY_DIR})
2011-11-06 08:30:15 +00:00
add_library(components STATIC ${COMPONENT_FILES} ${MOC_SRCS} ${ESM_UI_HDR})
2012-01-28 00:36:17 +00:00
2017-01-03 11:03:51 +00:00
if(BUILD_OPENMW OR BUILD_OPENCS)
if (OPENGL_ES)
set(GL_LIB ${OPENGLES_gl_LIBRARY})
else()
set(GL_LIB ${OPENGL_gl_LIBRARY})
endif()
endif(BUILD_OPENMW OR BUILD_OPENCS)
2012-01-28 00:36:17 +00:00
2016-05-03 02:09:48 +00:00
target_link_libraries(components
2015-12-03 05:54:14 +00:00
${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}
${OSGTEXT_LIBRARIES}
2015-12-03 05:54:14 +00:00
${OSGGA_LIBRARIES}
${OSGANIMATION_LIBRARIES}
${Bullet_LIBRARIES}
${SDL2_LIBRARIES}
2015-12-03 05:54:14 +00:00
# For MyGUI platform
${GL_LIB}
2016-06-12 20:34:53 +00:00
${MyGUI_LIBRARIES}
2015-12-03 05:54:14 +00:00
)
if (WIN32)
target_link_libraries(components
${Boost_LOCALE_LIBRARY})
endif()
2015-12-03 05:54:14 +00:00
if (USE_QT)
2015-12-02 19:40:04 +00:00
if (DESIRED_QT_VERSION MATCHES 4)
target_link_libraries(components
${QT_QTCORE_LIBRARY}
${QT_QTGUI_LIBRARY})
else()
qt5_use_modules(components Widgets Core)
endif()
endif()
if (GIT_CHECKOUT)
add_dependencies (components git-version)
endif (GIT_CHECKOUT)
if (WIN32)
2015-07-19 14:37:20 +00:00
target_link_libraries(components shlwapi)
if(MINGW)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DNOGDI")
endif(MINGW)
endif()
# Fix for not visible pthreads functions for linker with glibc 2.15
if (UNIX AND NOT APPLE)
target_link_libraries(components ${CMAKE_THREAD_LIBS_INIT})
endif()
2012-01-28 00:36:17 +00:00
# Make the variable accessible for other subdirectories
set(COMPONENT_FILES ${COMPONENT_FILES} PARENT_SCOPE)