vcpkg complete replacement

Replaces all our 3rd party dependencies with vcpkg installed dependencies.

Some will be downloaded eg assimp/libpng
This commit is contained in:
marauder2k7 2026-03-12 20:59:21 +00:00
parent 12dddd07b5
commit d0a00da9a0
6200 changed files with 1307 additions and 2646504 deletions

View file

@ -8,13 +8,29 @@ endif (APPLE)
# ------------------------------------------------------------------
# Find all dependencies (using vcpkg's toolchain integration)
# ------------------------------------------------------------------
find_package(ZLIB REQUIRED)
find_package(PNG REQUIRED)
find_package(SDL2 CONFIG REQUIRED)
find_package(unofficial-pcre CONFIG REQUIRED)
find_package(Ogg CONFIG REQUIRED)
find_package(Vorbis CONFIG REQUIRED)
find_package(FLAC CONFIG REQUIRED)
find_package(Opus CONFIG REQUIRED)
find_package(unofficial-theora CONFIG REQUIRED)
find_package(SndFile CONFIG REQUIRED)
find_package(TinyXML2 CONFIG REQUIRED)
find_package(assimp CONFIG REQUIRED)
find_package(OpenAL CONFIG REQUIRED)
# ------------------------------------------------------------------
# Collect imported targets into a single variable
# ------------------------------------------------------------------
set(TORQUE_LINK_THIRDPARTY ${TORQUE_LINK_THIRDPARTY}
ZLIB::ZLIB
PNG::PNG
$<TARGET_NAME_IF_EXISTS:SDL2::SDL2main>
$<IF:$<TARGET_EXISTS:SDL2::SDL2>,SDL2::SDL2,SDL2::SDL2-static>
unofficial::pcre::pcre unofficial::pcre::pcre16 unofficial::pcre::pcre32 unofficial::pcre::pcrecpp
Ogg::ogg
Vorbis::vorbis
Vorbis::vorbisfile
@ -22,7 +38,17 @@ set(TORQUE_LINK_THIRDPARTY ${TORQUE_LINK_THIRDPARTY}
Opus::opus
unofficial::theora::theora unofficial::theora::theoradec unofficial::theora::theoraenc
SndFile::sndfile
tinyxml2::tinyxml2
assimp::assimp
OpenAL::OpenAL
)
if (MSVC)
add_compile_options(/wd4648 /wd4191)
else()
add_compile_options(-Wno-invalid-offsetof -Wno-return-type-c-linkage)
endif()
################# Helper Function Calls ###################
forwardDef(TORQUE_OPENGL)
forwardDef(TORQUE_D3D11)
@ -86,17 +112,10 @@ torqueAddSourceDirectories( "T3D" "T3D/AI" "T3D/assets" "T3D/decal" "T3D/example
# Handle TS
torqueAddSourceDirectories("ts" "ts/collada" "ts/assimp" "ts/loader" "ts/arch")
# Handle SFX - OpenAL is handled as a module later on
# Handle SFX - OpenAL as default
torqueAddSourceDirectories("sfx" "sfx/media" "sfx/null")
if(TORQUE_SFX_OPENAL AND NOT TORQUE_DEDICATED)
torqueAddSourceDirectories("sfx/openal")
if(WIN32)
torqueAddSourceDirectories("sfx/openal/win32")
elseif(UNIX AND NOT APPLE)
torqueAddSourceDirectories("sfx/openal/linux")
elseif(APPLE)
torqueAddSourceDirectories("sfx/openal/mac")
endif()
endif()
# Handle GFX
torqueAddSourceDirectories("gfx" "gfx/Null" "gfx/test" "gfx/bitmap" "gfx/bitmap/loaders" "gfx/bitmap/loaders/ies"
@ -161,7 +180,7 @@ if(TORQUE_D3D11)
endif(TORQUE_D3D11)
# Handle shadergen
torqueAddSourceDirectories("shaderGen")
torqueAddSourceDirectories("shaderGen" "shaderGen/NODE")
if (WIN32 AND TORQUE_D3D11)
torqueAddSourceDirectories("shaderGen/HLSL")
@ -573,8 +592,6 @@ target_link_libraries(${TORQUE_APP_NAME} ${TORQUE_LINK_LIBRARIES} ${TORQUE_LINK_
if(APPLE)
target_link_libraries(${TORQUE_APP_NAME} ${TORQUE_LINK_FRAMEWORKS})
endif(APPLE)
if(WIN32)
@ -601,47 +618,3 @@ endif(TORQUE_TESTING)
append_defs()
# Process library binaries - these are coming from modules that are providing links to external, precompiled code that should be included
# with the executable. This is done because on Windows, the .lib is separate from the .dll so we can't automatically scan for shared
# objects in our link libraries in that case.
foreach (LIBRARY_BINARY ${TORQUE_ADDITIONAL_LIBRARY_BINARIES})
if (APPLE)
# For OSX, we want these binaries to be copied to the Frameworks directory
add_custom_command(TARGET ${TORQUE_APP_NAME} POST_BUILD
COMMAND ${CMAKE_COMMAND} -E make_directory "${TORQUE_APP_GAME_DIRECTORY}/${TORQUE_APP_NAME}.app/Contents/Frameworks"
COMMAND ${CMAKE_COMMAND} -E copy ${LIBRARY_BINARY} "${TORQUE_APP_GAME_DIRECTORY}/${TORQUE_APP_NAME}.app/Contents/Frameworks/$(CONFIGURATION)")
else()
# All other platforms expect the file next to the executable
add_custom_command(TARGET ${TORQUE_APP_NAME} POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy ${LIBRARY_BINARY} "${TORQUE_APP_GAME_DIRECTORY}")
endif (APPLE)
endforeach()
# Process link libraries for dynamic links - we do this on OSX/Linux to ensure the binaries end up in the correct App directory
# as in the root CMake we force everything to be in game. This is necessary because on these platforms these are considered "libraries"
# and not runtime binaries like we configure in the root CMake. We don't globally set library outputs to avoid outputting eg. a files to
# our game directory.
if (UNIX)
get_target_property(GAME_LINK_LIBRARIES ${TORQUE_APP_NAME} LINK_LIBRARIES)
foreach (GAME_LINK_LIBRARY ${GAME_LINK_LIBRARIES})
# For eg. OSX some links are not valid targets - for example frameworks provided by OS
if (TARGET ${GAME_LINK_LIBRARY})
get_target_property(LINK_LIBRARY_TYPE ${GAME_LINK_LIBRARY} TYPE)
# Only pay attention to shared libraries and make them output to the app resources
if ("${LINK_LIBRARY_TYPE}" STREQUAL "SHARED_LIBRARY")
if (APPLE)
set_target_properties(${GAME_LINK_LIBRARY} PROPERTIES
XCODE_ATTRIBUTE_SKIP_INSTALL YES
)
add_custom_command(TARGET ${TORQUE_APP_NAME} POST_BUILD
COMMAND ${CMAKE_COMMAND} -E make_directory "${TORQUE_APP_GAME_DIRECTORY}/${TORQUE_APP_NAME}.app/Contents/Frameworks"
COMMAND ${CMAKE_COMMAND} -E copy "$<TARGET_FILE:${GAME_LINK_LIBRARY}>" "${TORQUE_APP_GAME_DIRECTORY}/${TORQUE_APP_NAME}.app/Contents/Frameworks/$<TARGET_FILE_NAME:${GAME_LINK_LIBRARY}>"
COMMAND ${CMAKE_COMMAND} -E create_symlink "$<TARGET_FILE:${GAME_LINK_LIBRARY}>" "${TORQUE_APP_GAME_DIRECTORY}/${TORQUE_APP_NAME}.app/Contents/Frameworks/$<TARGET_LINKER_FILE_NAME:${GAME_LINK_LIBRARY}>"
COMMAND ${CMAKE_COMMAND} -E create_symlink "$<TARGET_FILE:${GAME_LINK_LIBRARY}>" "${TORQUE_APP_GAME_DIRECTORY}/${TORQUE_APP_NAME}.app/Contents/Frameworks/lib$<TARGET_LINKER_FILE_BASE_NAME:${GAME_LINK_LIBRARY}>.1.dylib"
)
else()
set_target_properties(${GAME_LINK_LIBRARY} PROPERTIES LIBRARY_OUTPUT_DIRECTORY "${TORQUE_APP_GAME_DIRECTORY}")
endif(APPLE)
endif()
endif()
endforeach()
endif (UNIX)