1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-26 18:35:20 +00:00
OpenMW/apps/opencs/CMakeLists.txt

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

305 lines
9.1 KiB
CMake
Raw Normal View History

set (OPENCS_SRC
${CMAKE_SOURCE_DIR}/files/windows/opencs.rc
2014-09-05 20:30:50 +10:00
)
2012-11-21 17:31:18 +01:00
opencs_units (. editor)
2012-11-22 13:30:02 +01:00
opencs_units (model/doc
document operation saving documentmanager loader runner operationholder
)
opencs_units (model/doc
savingstate savingstages blacklist messages
)
opencs_hdrs (model/doc
state
)
2012-12-11 15:35:47 +01:00
opencs_units (model/world
2017-10-02 15:56:22 -04:00
idtable idtableproxymodel regionmap data commanddispatcher idtablebase resourcetable nestedtableproxymodel idtree infotableproxymodel landtexturetableproxymodel
actoradapter idcollection
2012-11-21 17:31:18 +01:00
)
2012-11-22 13:30:02 +01:00
opencs_units (model/world
universalid record commands columnbase columnimp scriptcontext cell refidcollection
refiddata refidadapterimp ref collectionbase refcollection columns infocollection tablemimedata cellcoordinates cellselection resources resourcesmanager scope
pathgrid landtexture land nestedtablewrapper nestedcollection nestedcoladapterimp nestedinfocollection
2016-03-08 10:48:44 +01:00
idcompletionmanager metadata defaultgmsts infoselectwrapper commandmacro
)
2012-11-22 13:30:02 +01:00
opencs_hdrs (model/world
columnimp idcollection collection info subcellcollection
2012-11-21 17:31:18 +01:00
)
2012-11-24 11:01:53 +01:00
opencs_units (model/tools
tools reportmodel mergeoperation
)
2012-11-22 13:30:02 +01:00
opencs_units (model/tools
mandatoryid skillcheck classcheck factioncheck racecheck soundcheck regioncheck
birthsigncheck spellcheck referencecheck referenceablecheck scriptcheck bodypartcheck
2015-08-03 19:08:01 +03:00
startscriptcheck search searchoperation searchstage pathgridcheck soundgencheck magiceffectcheck
mergestages gmstcheck topicinfocheck journalcheck enchantmentcheck
)
opencs_hdrs (model/tools
mergestate
)
2012-11-24 11:01:53 +01:00
opencs_units (view/doc
viewmanager view operations operation subview startup filedialog newgame
filewidget adjusterwidget loader globaldebugprofilemenu runlogsubview sizehint
)
2012-12-11 15:35:47 +01:00
opencs_units (view/doc
subviewfactory
2012-11-21 17:31:18 +01:00
)
opencs_hdrs (view/doc
subviewfactoryimp
2012-11-21 17:31:18 +01:00
)
opencs_units (view/world
table tablesubview scriptsubview util regionmapsubview tablebottombox creator genericcreator globalcreator
cellcreator pathgridcreator referenceablecreator startscriptcreator referencecreator scenesubview
infocreator scriptedit dialoguesubview previewsubview regionmap dragrecordtable nestedtable
dialoguespinbox recordbuttonbar tableeditidaction scripterrortable extendedcommandconfigurator
2021-09-19 19:07:54 +02:00
bodypartcreator landtexturecreator landcreator tableheadermouseeventhandler
)
opencs_units (view/world
subviews enumdelegate vartypedelegate recordstatusdelegate idtypedelegate datadisplaydelegate
scripthighlighter idvalidator dialoguecreator idcompletiondelegate
colordelegate dragdroputils
)
opencs_units (view/widget
scenetoolbar scenetool scenetoolmode pushbutton scenetooltoggle scenetoolrun modebutton
2019-09-11 12:59:15 +03:00
scenetooltoggle2 scenetooltexturebrush scenetoolshapebrush completerpopup coloreditor colorpickerpopup droplineedit
)
2013-11-02 02:48:30 +01:00
opencs_units (view/render
scenewidget worldspacewidget pagedworldspacewidget unpagedworldspacewidget
2016-02-16 16:02:29 +01:00
previewwidget editmode instancemode instanceselectionmode instancemovemode
orbitcameramode pathgridmode selectionmode pathgridselectionmode cameracontroller
cellwater terraintexturemode actor terrainselection terrainshapemode brushdraw commands
2014-02-27 14:46:06 +01:00
)
opencs_units (view/render
2016-03-14 00:04:11 -04:00
lighting lightingday lightingnight lightingbright object cell terrainstorage tagbase
cellarrow cellmarker cellborder pathgrid
2014-02-27 14:46:06 +01:00
)
2013-11-02 02:48:30 +01:00
opencs_hdrs (view/render
mask
)
opencs_units (view/tools
reportsubview reporttable searchsubview searchbox merge
)
opencs_units (view/tools
subviews
)
opencs_units (view/prefs
2017-05-11 19:46:51 +12:00
dialogue pagebase page keybindingpage contextmenulist
)
opencs_units (model/prefs
state setting intsetting doublesetting boolsetting enumsetting coloursetting shortcut
shortcuteventhandler shortcutmanager shortcutsetting modifiersetting stringsetting subcategory
)
opencs_units (model/prefs
2015-12-06 12:06:28 +01:00
category
)
opencs_units (model/filter
unarynode narynode leafnode booleannode parser andnode ornode notnode textnode valuenode
2013-08-09 14:49:05 +02:00
)
2013-08-08 15:55:23 +02:00
opencs_units (view/filter
filterbox recordfilterbox editwidget
2013-08-08 15:55:23 +02:00
)
2012-11-21 17:31:18 +01:00
set (OPENCS_US
)
set (OPENCS_RES ${CMAKE_SOURCE_DIR}/files/opencs/resources.qrc
${CMAKE_SOURCE_DIR}/files/launcher/launcher.qrc
)
set (OPENCS_UI
${CMAKE_CURRENT_SOURCE_DIR}/ui/filedialog.ui
2012-11-21 17:31:18 +01:00
)
source_group (openmw-cs FILES main.cpp ${OPENCS_SRC} ${OPENCS_HDR})
2012-11-21 17:31:18 +01:00
if(WIN32)
set(QT_USE_QTMAIN TRUE)
endif(WIN32)
2023-04-25 22:00:20 +02:00
if (QT_VERSION_MAJOR VERSION_EQUAL 5)
qt5_wrap_ui(OPENCS_UI_HDR ${OPENCS_UI})
else ()
qt6_wrap_ui(OPENCS_UI_HDR ${OPENCS_UI})
endif()
2023-02-05 15:30:28 +04:00
qt_add_resources(OPENCS_RES_SRC ${OPENCS_RES})
2012-11-21 17:31:18 +01:00
# for compiled .ui files
include_directories(${CMAKE_CURRENT_BINARY_DIR})
2012-11-21 17:31:18 +01:00
2013-11-10 20:11:53 +04:00
if(APPLE)
set (OPENCS_MAC_ICON "${CMAKE_SOURCE_DIR}/files/mac/openmw-cs.icns")
set (OPENCS_CFG "${OpenMW_BINARY_DIR}/defaults-cs.bin")
set (OPENCS_DEFAULT_FILTERS_FILE "${OpenMW_BINARY_DIR}/resources/defaultfilters")
set (OPENCS_OPENMW_CFG "${OpenMW_BINARY_DIR}/openmw.cfg")
2013-11-10 20:11:53 +04:00
else()
set (OPENCS_MAC_ICON "")
set (OPENCS_CFG "")
set (OPENCS_DEFAULT_FILTERS_FILE "")
set (OPENCS_OPENMW_CFG "")
2013-11-10 20:11:53 +04:00
endif(APPLE)
add_library(openmw-cs-lib
2012-11-21 17:31:18 +01:00
${OPENCS_SRC}
${OPENCS_UI_HDR}
${OPENCS_MOC_SRC}
${OPENCS_RES_SRC}
)
set_target_properties(openmw-cs-lib PROPERTIES OUTPUT_NAME openmw-cs)
2023-03-10 01:19:15 +01:00
if(BUILD_OPENCS)
openmw_add_executable(openmw-cs
MACOSX_BUNDLE
${OPENCS_MAC_ICON}
${OPENCS_CFG}
${OPENCS_DEFAULT_FILTERS_FILE}
${OPENCS_OPENMW_CFG}
main.cpp
)
2012-11-21 17:31:18 +01:00
2023-03-10 01:19:15 +01:00
target_link_libraries(openmw-cs openmw-cs-lib)
2023-03-10 01:19:15 +01:00
if (BUILD_WITH_CODE_COVERAGE)
target_compile_options(openmw-cs-lib PRIVATE --coverage)
target_link_libraries(openmw-cs-lib gcov)
endif()
endif()
if(APPLE AND BUILD_OPENCS)
set(OPENCS_BUNDLE_NAME "OpenMW-CS")
set(OPENCS_BUNDLE_RESOURCES_DIR "${OpenMW_BINARY_DIR}/${OPENCS_BUNDLE_NAME}.app/Contents/Resources")
2021-12-08 14:33:49 +01:00
set(OPENMW_RESOURCES_ROOT ${OPENCS_BUNDLE_RESOURCES_DIR})
add_subdirectory(../../files/ ${CMAKE_CURRENT_BINARY_DIR}/files)
2015-02-03 13:57:40 +01:00
set_target_properties(openmw-cs PROPERTIES
2013-11-10 20:11:53 +04:00
RUNTIME_OUTPUT_DIRECTORY "${OpenMW_BINARY_DIR}"
OUTPUT_NAME ${OPENCS_BUNDLE_NAME}
2015-02-03 13:18:03 +01:00
MACOSX_BUNDLE_ICON_FILE "openmw-cs.icns"
2017-09-02 18:07:12 -05:00
MACOSX_BUNDLE_BUNDLE_NAME "OpenMW-CS"
2013-11-10 20:11:53 +04:00
MACOSX_BUNDLE_GUI_IDENTIFIER "org.openmw.opencs"
MACOSX_BUNDLE_SHORT_VERSION_STRING ${OPENMW_VERSION}
MACOSX_BUNDLE_BUNDLE_VERSION ${OPENMW_VERSION}
MACOSX_BUNDLE_INFO_PLIST "${CMAKE_SOURCE_DIR}/files/mac/openmw-cs-Info.plist.in"
2013-11-10 20:11:53 +04:00
)
set_source_files_properties(${OPENCS_MAC_ICON} PROPERTIES
MACOSX_PACKAGE_LOCATION Resources)
set_source_files_properties(${OPENCS_CFG} PROPERTIES
MACOSX_PACKAGE_LOCATION Resources)
set_source_files_properties(${OPENCS_DEFAULT_FILTERS_FILE} PROPERTIES
MACOSX_PACKAGE_LOCATION Resources/resources)
set_source_files_properties(${OPENCS_OPENMW_CFG} PROPERTIES
MACOSX_PACKAGE_LOCATION Resources)
add_custom_command(TARGET openmw-cs
POST_BUILD
COMMAND cp "${OpenMW_BINARY_DIR}/resources/version" "${OPENCS_BUNDLE_RESOURCES_DIR}/resources")
2023-03-10 01:19:15 +01:00
endif()
2013-11-10 19:09:05 +04:00
target_link_libraries(openmw-cs-lib
# 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
${OSGVIEWER_LIBRARIES}
${OSGFX_LIBRARIES}
${OSGGA_LIBRARIES}
${OSGUTIL_LIBRARIES}
${OSGTEXT_LIBRARIES}
${OSG_LIBRARIES}
${EXTERN_OSGQT_LIBRARY}
${Boost_PROGRAM_OPTIONS_LIBRARY}
components_qt
2013-02-17 07:46:50 -06:00
)
if (QT_VERSION_MAJOR VERSION_EQUAL 6)
target_link_libraries(openmw-cs-lib Qt::Widgets Qt::Core Qt::Network Qt::OpenGL Qt::OpenGLWidgets)
else()
target_link_libraries(openmw-cs-lib Qt::Widgets Qt::Core Qt::Network Qt::OpenGL)
endif()
if (WIN32)
target_link_libraries(openmw-cs-lib ${Boost_LOCALE_LIBRARY})
2023-03-10 01:19:15 +01:00
endif()
if (WIN32 AND BUILD_OPENCS)
INSTALL(TARGETS openmw-cs RUNTIME DESTINATION ".")
get_generator_is_multi_config(multi_config)
if (multi_config)
SET(INSTALL_SOURCE "${OpenMW_BINARY_DIR}/$<CONFIG>")
else ()
SET(INSTALL_SOURCE "${OpenMW_BINARY_DIR}")
endif ()
INSTALL(FILES "${INSTALL_SOURCE}/defaults-cs.bin" DESTINATION ".")
endif()
if (MSVC)
# Debug version needs increased number of sections beyond 2^16
if (CMAKE_CL_64)
set (CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /bigobj")
endif (CMAKE_CL_64)
endif (MSVC)
2023-03-10 01:19:15 +01:00
if(APPLE AND BUILD_OPENCS)
INSTALL(TARGETS openmw-cs BUNDLE DESTINATION "." COMPONENT Bundle)
2013-11-10 22:24:31 +04:00
endif()
if(USE_QT)
set_property(TARGET openmw-cs-lib PROPERTY AUTOMOC ON)
endif(USE_QT)
if (BUILD_WITH_CODE_COVERAGE)
target_compile_options(openmw-cs-lib PRIVATE --coverage)
target_link_libraries(openmw-cs-lib gcov)
endif()
2023-07-20 00:43:56 +01:00
if (MSVC)
target_precompile_headers(openmw-cs-lib PRIVATE
<boost/program_options/options_description.hpp>
<algorithm>
<fstream>
<functional>
<ostream>
<string>
<string_view>
<vector>
)
endif()