1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-03-14 01:19:59 +00:00

Merge branch 'windows-vcpkg-default-compatible' into 'master'

adding vcpkg support to cmake (windows c++ library manager)

See merge request OpenMW/openmw!2814
This commit is contained in:
derossm 2025-03-11 17:10:49 +00:00
commit a82cd4e17f
3 changed files with 16 additions and 6 deletions

View File

@ -142,8 +142,16 @@ else()
endif()
option(OSG_STATIC "Link static build of OpenSceneGraph into the binaries" ${_osg_static_default})
# variable to easily check if vcpkg is being used
if(CMAKE_TOOLCHAIN_FILE MATCHES ".*[vV][cC][pP][kK][gG].*")
set(USING_VCPKG TRUE)
else()
set(USING_VCPKG FALSE)
endif()
option(OPENMW_USE_SYSTEM_MYGUI "Use system provided mygui library" ON)
if(OPENMW_USE_SYSTEM_MYGUI)
# on windows the "system provided" mygui from vcpkg is static
if(OPENMW_USE_SYSTEM_MYGUI AND NOT USING_VCPKG)
set(_mygui_static_default OFF)
else()
set(_mygui_static_default ON)

View File

@ -6,9 +6,9 @@
include(LibFindMacros)
libfind_pkg_detect(LuaJit luajit
FIND_PATH luajit.h PATH_SUFFIXES luajit luajit-2.1
FIND_LIBRARY luajit-5.1 luajit
)
FIND_PATH luajit.h PATH_SUFFIXES luajit luajit-2.1
# note: vcpkg builds luatjit-5.1 as lua51
FIND_LIBRARY luajit-5.1 luajit lua51
)
libfind_process(LuaJit)

View File

@ -675,7 +675,9 @@ if(OSG_STATIC)
get_whole_archive_options(_opts ${_osg_plugins_static_files})
target_link_options(components_osg_plugins INTERFACE ${_opts})
target_link_libraries(components components_osg_plugins)
endif(OSG_STATIC)
if(OSG_STATIC OR USING_VCPKG)
if(OPENMW_USE_SYSTEM_OSG)
# OSG plugin pkgconfig files are missing these dependencies.
# https://github.com/openscenegraph/OpenSceneGraph/issues/1052
@ -684,7 +686,7 @@ if(OSG_STATIC)
find_package(PNG REQUIRED)
target_link_libraries(components Freetype::Freetype JPEG::JPEG PNG::PNG)
endif()
endif(OSG_STATIC)
endif(OSG_STATIC OR USING_VCPKG)
if(USE_QT)
set_property(TARGET components_qt PROPERTY AUTOMOC ON)