1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-01-16 15:29:55 +00:00
openmw/components/CMakeLists.txt

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

725 lines
19 KiB
Text
Raw Normal View History

2023-01-02 17:35:05 +00:00
project (Components)
if(APPLE)
set(BUNDLE_RESOURCES_DIR "${APP_BUNDLE_DIR}/Contents/Resources")
set(OPENMW_RESOURCES_ROOT ${BUNDLE_RESOURCES_DIR})
endif(APPLE)
# Version file
2023-08-31 18:55:28 +00:00
set (VERSION_RESOURCE_FILE_IN "${OpenMW_SOURCE_DIR}/files/version.in")
set (VERSION_RESOURCE_FILE_RELATIVE "resources/version")
set (VERSION_CPP_FILE "components/version/version.cpp")
2023-01-02 17:35:05 +00:00
if (GIT_CHECKOUT)
get_generator_is_multi_config(multi_config)
2024-02-25 19:05:38 +00:00
add_custom_target (get-version
BYPRODUCTS "${OpenMW_BINARY_DIR}/${VERSION_CPP_FILE}"
2023-08-31 18:55:28 +00:00
DEPENDS "${OpenMW_SOURCE_DIR}/${VERSION_CPP_FILE}.in"
2023-01-02 17:35:05 +00:00
COMMAND ${CMAKE_COMMAND}
-DGIT_EXECUTABLE=${GIT_EXECUTABLE}
2023-08-31 18:55:28 +00:00
-DOpenMW_SOURCE_DIR=${OpenMW_SOURCE_DIR}
-DOpenMW_BINARY_DIR=${OpenMW_BINARY_DIR}
-DVERSION_RESOURCE_FILE_IN=${VERSION_RESOURCE_FILE_IN}
-DVERSION_RESOURCE_FILE_RELATIVE=${VERSION_RESOURCE_FILE_RELATIVE}
-DVERSION_CPP_FILE_IN=${OpenMW_SOURCE_DIR}/${VERSION_CPP_FILE}.in
-DVERSION_CPP_FILE_OUT=${OpenMW_BINARY_DIR}/${VERSION_CPP_FILE}.out
2023-01-02 17:35:05 +00:00
-DOPENMW_VERSION_MAJOR=${OPENMW_VERSION_MAJOR}
-DOPENMW_VERSION_MINOR=${OPENMW_VERSION_MINOR}
-DOPENMW_VERSION_RELEASE=${OPENMW_VERSION_RELEASE}
-DOPENMW_LUA_API_REVISION=${OPENMW_LUA_API_REVISION}
-DOPENMW_POSTPROCESSING_API_REVISION=${OPENMW_POSTPROCESSING_API_REVISION}
2023-01-02 17:35:05 +00:00
-DOPENMW_VERSION=${OPENMW_VERSION}
-DOPENMW_DOC_BASEURL=${OPENMW_DOC_BASEURL}
2023-01-02 17:35:05 +00:00
-DMACROSFILE=${CMAKE_SOURCE_DIR}/cmake/OpenMWMacros.cmake
"-DCMAKE_CONFIGURATION_TYPES=${CMAKE_CONFIGURATION_TYPES}"
-Dgenerator_is_multi_config_var=${multi_config}
-P ${CMAKE_CURRENT_SOURCE_DIR}/../cmake/GitVersion.cmake
COMMAND ${CMAKE_COMMAND}
-E copy_if_different ${OpenMW_BINARY_DIR}/${VERSION_CPP_FILE}.out ${OpenMW_BINARY_DIR}/${VERSION_CPP_FILE}
VERBATIM)
2023-01-02 17:35:05 +00:00
else (GIT_CHECKOUT)
2023-08-31 18:55:28 +00:00
configure_resource_file(${VERSION_RESOURCE_FILE_IN} ${OpenMW_BINARY_DIR} ${VERSION_RESOURCE_FILE_RELATIVE})
configure_file("${OpenMW_SOURCE_DIR}/${VERSION_CPP_FILE}.in" "${OpenMW_BINARY_DIR}/${VERSION_CPP_FILE}")
2023-01-02 17:35:05 +00:00
endif (GIT_CHECKOUT)
2023-08-31 18:55:28 +00:00
list (APPEND COMPONENT_FILES "${OpenMW_BINARY_DIR}/${VERSION_CPP_FILE}")
# OSG plugin checker
# Helpfully, OSG doesn't export this to its CMake config as it doesn't have one
list(TRANSFORM USED_OSG_PLUGINS REPLACE "^osgdb_" "" OUTPUT_VARIABLE USED_OSG_PLUGIN_NAMES)
list(TRANSFORM USED_OSG_PLUGIN_NAMES PREPEND "\"" OUTPUT_VARIABLE USED_OSG_PLUGIN_NAMES_FORMATTED)
list(TRANSFORM USED_OSG_PLUGIN_NAMES_FORMATTED APPEND "\"")
list(JOIN USED_OSG_PLUGIN_NAMES_FORMATTED ", " USED_OSG_PLUGIN_NAMES_FORMATTED)
set(OSG_PLUGIN_CHECKER_CPP_FILE "components/misc/osgpluginchecker.cpp")
configure_file("${OpenMW_SOURCE_DIR}/${OSG_PLUGIN_CHECKER_CPP_FILE}.in" "${OpenMW_BINARY_DIR}/${OSG_PLUGIN_CHECKER_CPP_FILE}")
list(APPEND COMPONENT_FILES "${OpenMW_BINARY_DIR}/${OSG_PLUGIN_CHECKER_CPP_FILE}")
2011-11-06 08:30:15 +00:00
# source files
2023-01-02 17:35:05 +00:00
add_component_dir (lua
2023-08-09 21:28:19 +00:00
luastate scriptscontainer asyncpackage utilpackage serialization configuration l10n storage utf8
2024-10-15 21:18:13 +00:00
shapes/box inputactions yamlloader scripttracker
2023-01-02 17:35:05 +00:00
)
2022-04-10 07:57:02 +00:00
2023-01-02 17:35:05 +00:00
add_component_dir (l10n
2022-10-02 20:38:37 +00:00
messagebundles manager
2023-01-02 17:35:05 +00:00
)
2023-01-02 17:35:05 +00:00
add_component_dir (settings
categories
categories/camera
categories/cells
categories/fog
categories/game
categories/general
categories/groundcover
categories/gui
categories/hud
categories/input
categories/lua
categories/map
categories/models
categories/navigator
categories/physics
categories/postprocessing
categories/saves
categories/shaders
categories/shadows
categories/sound
categories/stereo
categories/stereoview
categories/terrain
categories/video
categories/water
categories/windows
gyroscopeaxis
hrtfmode
navmeshrendermode
parser
sanitizer
sanitizerimpl
settings
settingvalue
shadermanager
values
windowmode
2023-01-02 17:35:05 +00:00
)
2012-03-30 16:38:33 +00:00
2024-04-17 19:53:55 +00:00
add_component_dir (bgsm
stream file
2024-04-17 19:53:55 +00:00
)
2023-01-02 17:35:05 +00:00
add_component_dir (bsa
bsa_file compressedbsafile ba2gnrlfile ba2dx10file ba2file memorystream
2023-01-02 17:35:05 +00:00
)
2011-11-06 08:30:15 +00:00
add_component_dir (bullethelpers
collisionobject
heightfield
operators
processtrianglecallback
transformboundingbox
)
2023-01-02 17:35:05 +00:00
add_component_dir (vfs
manager archive bsaarchive filesystemarchive pathutil registerarchives
2023-01-02 17:35:05 +00:00
)
2023-01-02 17:35:05 +00:00
add_component_dir (resource
scenemanager keyframemanager imagemanager animblendrulesmanager bulletshapemanager bulletshape niffilemanager objectcache multiobjectcache resourcesystem
2024-04-18 01:00:20 +00:00
resourcemanager stats animation foreachbulletobject errormarker cachestats bgsmfilemanager
2023-01-02 17:35:05 +00:00
)
2015-03-26 17:02:51 +00:00
2023-01-02 17:35:05 +00:00
add_component_dir (shader
shadermanager shadervisitor removedalphafunc
2023-01-02 17:35:05 +00:00
)
2023-01-02 17:35:05 +00:00
add_component_dir (sceneutil
clone attach visitor util statesetupdater controller skeleton riggeometry morphgeometry lightcontroller
lightmanager lightutil positionattitudetransform workqueue pathgridutil waterutil writescene serialize optimizer
detourdebugdraw navmesh agentpath animblendrules shadow mwshadowtechnique recastmesh shadowsbin osgacontroller rtt
screencapture depth color riggeometryosgaextension extradata unrefqueue lightcommon lightingmethod clearcolor
cullsafeboundsvisitor keyframe nodecallback textkeymap glextensions
2023-01-02 17:35:05 +00:00
)
2015-03-26 17:02:51 +00:00
2023-01-02 17:35:05 +00:00
add_component_dir (nif
base controller data effect extra niffile nifkey nifstream niftypes node parent particle physics property record recordptr texture
2023-01-02 17:35:05 +00:00
)
2011-11-06 08:30:15 +00:00
2023-01-02 17:35:05 +00:00
add_component_dir (nifosg
2023-12-08 19:53:00 +00:00
nifloader controller particle matrixtransform fog
2023-01-02 17:35:05 +00:00
)
2023-01-02 17:35:05 +00:00
add_component_dir (nifbullet
bulletnifloader
2023-01-02 17:35:05 +00:00
)
2011-11-06 08:30:15 +00:00
2023-01-02 17:35:05 +00:00
add_component_dir (to_utf8
tables_gen
2011-11-06 08:30:15 +00:00
to_utf8
2023-01-02 17:35:05 +00:00
)
2011-11-06 08:30:15 +00:00
add_component_dir(esm attr common defs esmcommon records util luascripts format refid esmbridge esmterrain
2023-04-07 00:14:32 +00:00
formid
fourcc
stringrefid
generatedrefid
indexrefid
serializerefid
esm3exteriorcellrefid
2024-05-02 01:09:13 +00:00
quaternion
vector3
exteriorcelllocation
)
add_component_dir(fx pass technique lexer lexer_types parse_constants widgets stateupdater)
2022-05-14 01:58:00 +00:00
add_component_dir(std140 ubo)
2023-01-02 17:35:05 +00:00
add_component_dir (esm3
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 aipackage effectlist spelllist variant variantimp loadtes3 cellref filter
savedgame journalentry queststate locals globalscript player objectstate cellid cellstate globalmap
inventorystate containerstate npcstate creaturestate dialoguestate statstate npcstats creaturestats
weatherstate quickkeys fogstate spellstate activespells creaturelevliststate doorstate projectilestate debugprofile
aisequence magiceffects custommarkerstate stolenitems transport animationstate controlsstate mappings readerscache
2024-04-11 20:29:33 +00:00
infoorder timestamp formatversion landrecorddata selectiongroup dialoguecondition
2024-05-02 01:09:13 +00:00
refnum
2023-01-02 17:35:05 +00:00
)
2011-11-06 08:30:15 +00:00
2023-08-06 10:53:29 +00:00
add_component_dir (esmterrain
gridsampling
storage
2023-01-02 17:35:05 +00:00
)
2011-11-06 08:30:15 +00:00
2023-01-02 17:35:05 +00:00
add_component_dir (esm4
2022-02-19 01:49:22 +00:00
actor
cellgrid
2022-02-19 01:49:22 +00:00
common
dialogue
effect
grid
grouptype
2022-02-19 01:49:22 +00:00
inventory
lighting
loadachr
loadacti
loadalch
loadaloc
loadammo
loadanio
loadappa
loadarma
loadarmo
loadaspc
loadbook
loadbptd
loadcell
loadclas
loadclfm
loadclot
loadcont
loadcrea
loaddial
loaddobj
loaddoor
loadeyes
loadflor
loadflst
loadfurn
loadglob
2023-04-04 07:58:49 +00:00
loadgmst
2022-02-19 01:49:22 +00:00
loadgras
loadgrup
loadhair
loadhdpt
loadidle
loadidlm
loadimod
loadinfo
loadingr
loadkeym
loadland
loadlgtm
loadligh
loadltex
loadlvlc
loadlvli
loadlvln
loadmato
loadmisc
loadmset
loadmstt
loadmusc
loadnavi
loadnavm
loadnote
loadnpc
loadotft
loadpack
loadpgrd
loadpgre
loadpwat
loadqust
loadrace
loadrefr
loadregn
loadroad
loadsbsp
loadscol
loadscpt
loadscrl
loadsgst
loadslgm
loadsndr
loadsoun
loadstat
loadtact
loadterm
loadtes4
loadtree
loadtxst
loadweap
loadwrld
magiceffectid
2022-02-19 01:49:22 +00:00
reader
readerutils
2022-02-19 01:49:22 +00:00
reference
script
typetraits
vertex
2022-01-30 10:07:39 +00:00
)
2023-01-02 17:35:05 +00:00
add_component_dir (misc
barrier budgetmeasurement color compression constants convert coordinateconverter display endianness float16 frameratelimiter
guarded math mathutil messageformatparser notnullptr objectpool osgpluginchecker osguservalues progressreporter resourcehelpers
rng strongtypedef thread timeconvert timer tuplehelpers tuplemeta utf8stream weakcache windows
)
add_component_dir (misc/strings
algorithm conversion format lower
2023-01-02 17:35:05 +00:00
)
2023-01-02 17:35:05 +00:00
add_component_dir (stereo
frustum multiview stereomanager types
2023-01-02 17:35:05 +00:00
)
2023-01-02 17:35:05 +00:00
add_component_dir (debug
debugging debuglog gldebug debugdraw writeflags
2023-01-02 17:35:05 +00:00
)
2011-11-06 08:30:15 +00:00
add_definitions(-DMYGUI_DONT_USE_OBSOLETE=ON)
IF(NOT WIN32 AND NOT APPLE)
add_definitions(-DGLOBAL_DATA_PATH="${GLOBAL_DATA_PATH}")
add_definitions(-DGLOBAL_CONFIG_PATH="${GLOBAL_CONFIG_PATH}")
ENDIF()
2023-01-02 17:35:05 +00:00
add_component_dir (files
2021-10-17 22:40:34 +00:00
linuxpath androidpath windowspath macospath fixedpath multidircollection collections configurationmanager
constrainedfilestream memorystream hash configfileparser openfile constrainedfilestreambuf conversion
istreamptr streamwithbuffer
2023-01-02 17:35:05 +00:00
)
2011-11-06 08:30:15 +00:00
2023-01-02 17:35:05 +00:00
add_component_dir (compiler
2011-11-06 08:30:15 +00:00
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
2023-01-02 17:35:05 +00:00
)
2011-11-06 08:30:15 +00:00
2023-01-02 17:35:05 +00:00
add_component_dir (interpreter
2011-11-06 08:30:15 +00:00
context controlopcodes genericopcodes installopcodes interpreter localopcodes mathopcodes
miscopcodes opcodes program runtime types defines
2023-01-02 17:35:05 +00:00
)
2011-11-06 08:30:15 +00:00
2023-01-02 17:35:05 +00:00
add_component_dir (translation
translation
2023-01-02 17:35:05 +00:00
)
2023-01-02 17:35:05 +00:00
add_component_dir (terrain
storage world buffercache defs terraingrid material terraindrawable texturemanager chunkmanager compositemaprenderer
quadtreeworld quadtreenode viewdata cellborder view heightcull
2023-01-02 17:35:05 +00:00
)
2023-01-02 17:35:05 +00:00
add_component_dir (loadinglistener
loadinglistener asynclistener
2023-01-02 17:35:05 +00:00
)
2012-12-23 19:23:24 +00:00
2023-01-02 17:35:05 +00:00
add_component_dir (myguiplatform
myguirendermanager myguidatamanager myguiplatform myguitexture myguiloglistener additivelayer scalinglayer
2023-01-02 17:35:05 +00:00
)
2015-04-30 23:15:25 +00:00
2023-01-02 17:35:05 +00:00
add_component_dir (widgets
2018-06-18 09:43:39 +00:00
box fontwrapper imagebutton tags list numericeditbox sharedstatebutton windowcaption widgets
2023-01-02 17:35:05 +00:00
)
2023-01-02 17:35:05 +00:00
add_component_dir (fontloader
fontloader
2023-01-02 17:35:05 +00:00
)
2023-01-02 17:35:05 +00:00
add_component_dir (sdlutil
events
gl4es_init
imagetosurface
sdlcursormanager
sdlgraphicswindow
sdlinputwrapper
sdlmappings
sdlvideowrapper
vsyncmode
2023-01-02 17:35:05 +00:00
)
2023-01-02 17:35:05 +00:00
add_component_dir (version
version
2023-01-02 17:35:05 +00:00
)
2023-01-02 17:35:05 +00:00
add_component_dir (fallback
2016-01-06 11:46:06 +00:00
fallback validate
2023-01-02 17:35:05 +00:00
)
2016-01-06 11:46:06 +00:00
2023-01-02 17:35:05 +00:00
add_component_dir (lua_ui
2022-01-29 22:43:08 +00:00
registerscriptsettings scriptsettings
properties widget element util layers content alignment resources
adapter text textedit window image container flex
2023-01-02 17:35:05 +00:00
)
2023-01-31 18:50:33 +00:00
copy_resource_file("lua_ui/content.lua" "${OPENMW_RESOURCES_ROOT}" "resources/lua_libs/content.lua")
2023-01-02 17:35:05 +00:00
if(WIN32)
2023-01-02 17:35:05 +00:00
add_component_dir (crashcatcher
windows_crashcatcher
windows_crashmonitor
windows_crashshm
windowscrashdumppathhelpers
)
elseif(NOT ANDROID)
2023-01-02 17:35:05 +00:00
add_component_dir (crashcatcher
crashcatcher
)
endif()
2018-03-13 22:49:08 +00:00
add_component_dir(detournavigator
agentbounds
areatype
asyncnavmeshupdater
bounds
changetype
collisionshapetype
commulativeaabb
dbrefgeometryobject
2018-03-13 22:49:08 +00:00
debug
exceptions
findrandompointaroundcircle
2018-03-13 22:49:08 +00:00
findsmoothpath
flags
generatenavmeshtile
gettilespositions
guardednavmeshcacheitem
heightfieldshape
makenavmesh
navigator
2019-02-16 12:27:02 +00:00
navigatorimpl
navigatorstub
navigatorutils
navmeshcacheitem
navmeshdata
navmeshdb
navmeshdbutils
navmeshmanager
navmeshtilescache
navmeshtileview
objectid
objecttransform
offmeshconnection
offmeshconnectionsmanager
preparednavmeshdata
preparednavmeshdatatuple
raycast
recast
recastallocutils
recastcontext
recastglobalallocator
recastmesh
recastmeshbuilder
recastmeshobject
recastmeshprovider
recastmeshtiles
recastparams
recasttempallocator
ref
serialization
settings
settingsutils
sharednavmeshcacheitem
stats
status
tilebounds
tilecachedrecastmeshmanager
tileposition
tilespositionsrange
updateguard
version
waitconditiontype
2023-01-02 17:35:05 +00:00
)
2018-03-13 22:49:08 +00:00
add_component_dir(loadinglistener
reporter
2023-01-02 17:35:05 +00:00
)
add_component_dir(serialization
binaryreader
binarywriter
osgyaml
sizeaccumulator
)
2021-10-16 11:03:15 +00:00
add_component_dir(sqlite3
db
request
2021-10-16 11:03:15 +00:00
statement
transaction
)
add_component_dir(esmloader
lessbyid
load
esmdata
)
add_component_dir(navmeshtool
protocol
2023-01-02 17:35:05 +00:00
)
add_component_dir(platform
platform
file
2023-01-02 17:35:05 +00:00
)
2023-01-02 17:35:05 +00:00
if (WIN32)
add_component_dir(platform
file.win32
2023-01-02 17:35:05 +00:00
)
elseif (UNIX)
add_component_dir(platform
file.posix
2023-01-02 17:35:05 +00:00
)
else ()
add_component_dir(platform
file.stdio
2023-01-02 17:35:05 +00:00
)
endif()
add_component_dir(testing
expecterror
util
)
set (ESM_UI ${CMAKE_CURRENT_SOURCE_DIR}/contentselector/contentselector.ui
2023-01-02 17:35:05 +00:00
)
2023-01-02 17:35:05 +00:00
if (USE_QT)
add_component_qt_dir (contentselector
2015-12-02 19:40:04 +00:00
model/modelitem model/esmfile
2024-04-22 16:41:58 +00:00
model/contentmodel
2015-12-02 19:40:04 +00:00
model/loadordererror
view/combobox view/contentselector
2023-01-02 17:35:05 +00:00
)
2023-01-02 17:35:05 +00:00
add_component_qt_dir (config
2015-12-02 19:40:04 +00:00
gamesettings
launchersettings
2023-01-02 17:35:05 +00:00
)
2015-12-02 19:40:04 +00:00
add_component_qt_dir (l10n
qttranslations
)
2023-01-02 17:35:05 +00:00
add_component_qt_dir (process
2015-12-02 19:40:04 +00:00
processinvoker
2023-01-02 17:35:05 +00:00
)
2015-12-02 19:40:04 +00:00
2023-01-02 17:35:05 +00:00
add_component_qt_dir (misc
2024-04-25 07:57:43 +00:00
helpviewer utf8qtextstream hash scalableicon
2023-01-02 17:35:05 +00:00
)
2023-01-02 17:35:05 +00:00
add_component_qt_dir (files
qtconversion
qtconfigpath
2023-01-02 17:35:05 +00:00
)
add_component_qt_dir (platform
application
)
add_component_qt_dir (vfs
qtconversion
)
2023-02-05 11:30:28 +00:00
QT_WRAP_UI(ESM_UI_HDR ${ESM_UI})
endif()
2013-01-27 21:40:38 +00:00
include_directories(${BULLET_INCLUDE_DIRS} ${CMAKE_CURRENT_BINARY_DIR})
2011-11-06 08:30:15 +00:00
2021-10-16 11:03:15 +00:00
find_package(SQLite3 REQUIRED)
add_library(components STATIC ${COMPONENT_FILES})
2012-01-28 00:36:17 +00:00
if (ANDROID)
set_property(TARGET components PROPERTY POSITION_INDEPENDENT_CODE ON)
endif()
2016-05-03 02:09:48 +00:00
target_link_libraries(components
${COLLADA_DOM_LIBRARIES}
# CMake's built-in OSG finder does not use pkgconfig, so we have to
# manually ensure the order is correct for inter-library dependencies.
# This only makes a difference with `-DOPENMW_USE_SYSTEM_OSG=ON -DOSG_STATIC=ON`.
# https://gitlab.kitware.com/cmake/cmake/-/issues/21701
2015-12-03 05:54:14 +00:00
${OSGPARTICLE_LIBRARIES}
${OSGVIEWER_LIBRARIES}
${OSGSHADOW_LIBRARIES}
2015-12-03 05:54:14 +00:00
${OSGANIMATION_LIBRARIES}
${OSGGA_LIBRARIES}
${OSGTEXT_LIBRARIES}
${OSGDB_LIBRARIES}
${OSGUTIL_LIBRARIES}
${OSGSIM_LIBRARIES}
${OSG_LIBRARIES}
${OPENTHREADS_LIBRARIES}
Boost::system
Boost::program_options
Boost::iostreams
SDL2::SDL2
${OPENGL_gl_LIBRARY}
2016-06-12 20:34:53 +00:00
${MyGUI_LIBRARIES}
${LUA_LIBRARIES}
2020-10-19 19:36:02 +00:00
LZ4::LZ4
2018-10-31 21:20:10 +00:00
RecastNavigation::DebugUtils
RecastNavigation::Detour
RecastNavigation::Recast
2021-05-17 22:00:23 +00:00
Base64
2021-10-16 11:03:15 +00:00
SQLite::SQLite3
2021-11-15 16:40:22 +00:00
smhasher
2022-04-10 07:57:02 +00:00
${ICU_LIBRARIES}
ZLIB::ZLIB
2023-01-02 17:35:05 +00:00
)
2015-12-03 05:54:14 +00:00
2023-08-18 11:53:25 +00:00
if(yaml-cpp_VERSION VERSION_GREATER_EQUAL 0.8.0)
target_link_libraries(components yaml-cpp::yaml-cpp)
else()
target_link_libraries(components yaml-cpp)
endif()
target_link_libraries(components ${BULLET_LIBRARIES})
2023-01-02 17:35:05 +00:00
if (USE_QT)
add_library(components_qt STATIC ${COMPONENT_QT_FILES} ${ESM_UI_HDR})
2023-02-05 11:30:28 +00:00
target_link_libraries(components_qt components Qt::Widgets Qt::Core)
2023-12-24 14:44:50 +00:00
if (BUILD_LAUNCHER OR BUILD_WIZARD)
add_dependencies(components_qt qm-files)
endif()
if (BUILD_WITH_CODE_COVERAGE)
target_compile_options(components_qt PRIVATE --coverage)
target_link_libraries(components_qt gcov)
endif()
endif()
2023-01-02 17:35:05 +00:00
if (OSG_STATIC AND CMAKE_SYSTEM_NAME MATCHES "Linux")
find_package(X11 REQUIRED COMPONENTS Xinerama Xrandr)
target_link_libraries(components ${CMAKE_DL_LIBS} X11::X11 X11::Xinerama X11::Xrandr)
find_package(Fontconfig MODULE)
if(Fontconfig_FOUND)
target_link_libraries(components Fontconfig::Fontconfig)
endif()
endif()
2023-01-02 17:35:05 +00:00
if (WIN32)
2015-07-19 14:37:20 +00:00
target_link_libraries(components shlwapi)
endif()
# Fix for not visible pthreads functions for linker with glibc 2.15
2023-01-02 17:35:05 +00:00
if (UNIX AND NOT APPLE)
2023-03-10 14:01:18 +00:00
target_link_libraries(components ${CMAKE_THREAD_LIBS_INIT})
endif()
2023-01-02 17:35:05 +00:00
if (BUILD_WITH_CODE_COVERAGE)
target_compile_options(components PRIVATE --coverage)
target_link_libraries(components gcov)
endif()
2023-01-02 17:35:05 +00:00
2012-01-28 00:36:17 +00:00
# Make the variable accessible for other subdirectories
set(COMPONENT_FILES ${COMPONENT_FILES} PARENT_SCOPE)
target_compile_definitions(components PUBLIC BT_USE_DOUBLE_PRECISION)
target_compile_definitions(components PRIVATE OPENMW_DOC_BASEURL="${OPENMW_DOC_BASEURL}")
if(OSG_STATIC)
unset(_osg_plugins_static_files)
add_library(components_osg_plugins INTERFACE)
foreach(_plugin ${USED_OSG_PLUGINS})
string(TOUPPER ${_plugin} _plugin_uc)
if(OPENMW_USE_SYSTEM_OSG)
list(APPEND _osg_plugins_static_files ${${_plugin_uc}_LIBRARY})
else()
list(APPEND _osg_plugins_static_files $<TARGET_FILE:${${_plugin_uc}_LIBRARY}>)
target_link_libraries(components_osg_plugins INTERFACE $<TARGET_PROPERTY:${${_plugin_uc}_LIBRARY},LINK_LIBRARIES>)
add_dependencies(components_osg_plugins ${${_plugin_uc}_LIBRARY})
endif()
endforeach()
# We use --whole-archive because OSG plugins use registration.
get_whole_archive_options(_opts ${_osg_plugins_static_files})
target_link_options(components_osg_plugins INTERFACE ${_opts})
target_link_libraries(components components_osg_plugins)
if(OPENMW_USE_SYSTEM_OSG)
# OSG plugin pkgconfig files are missing these dependencies.
# https://github.com/openscenegraph/OpenSceneGraph/issues/1052
find_package(Freetype REQUIRED)
find_package(JPEG REQUIRED)
find_package(PNG REQUIRED)
target_link_libraries(components Freetype::Freetype JPEG::JPEG PNG::PNG)
endif()
endif(OSG_STATIC)
if(USE_QT)
set_property(TARGET components_qt PROPERTY AUTOMOC ON)
endif(USE_QT)
if (MSVC AND PRECOMPILE_HEADERS_WITH_MSVC)
target_precompile_headers(components PUBLIC
<sol/sol.hpp>
<osg/State>
<osg/StateSet>
<osg/Node>
<osg/Drawable>
<osg/Camera>
<MyGUI_Widget.h>
<algorithm>
<filesystem>
<fstream>
<functional>
<memory>
<ostream>
<string>
<vector>
)
target_precompile_headers(components PRIVATE
<osgViewer/Viewer>
<boost/program_options/options_description.hpp>
)
endif()