mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-01-19 20:24:49 +00:00
link libs
This commit is contained in:
parent
873fbbf1fe
commit
320b91fe34
|
|
@ -5,6 +5,24 @@ if (APPLE)
|
|||
enable_language(OBJC)
|
||||
endif (APPLE)
|
||||
|
||||
# ------------------------------------------------------------------
|
||||
# Find all dependencies (using vcpkg's toolchain integration)
|
||||
# ------------------------------------------------------------------
|
||||
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)
|
||||
set(TORQUE_LINK_THIRDPARTY ${TORQUE_LINK_THIRDPARTY}
|
||||
Ogg::ogg
|
||||
Vorbis::vorbis
|
||||
Vorbis::vorbisfile
|
||||
FLAC::FLAC
|
||||
Opus::opus
|
||||
unofficial::theora::theora unofficial::theora::theoradec unofficial::theora::theoraenc
|
||||
SndFile::sndfile
|
||||
)
|
||||
################# Helper Function Calls ###################
|
||||
forwardDef(TORQUE_OPENGL)
|
||||
forwardDef(TORQUE_D3D11)
|
||||
|
|
@ -414,7 +432,7 @@ if (TORQUE_DYNAMIC_LIBRARY AND NOT TORQUE_TESTING)
|
|||
# Build the main engine library
|
||||
add_library(TorqueEngine SHARED ${TORQUE_SOURCE_FILES})
|
||||
target_compile_definitions(TorqueEngine PUBLIC ${TORQUE_COMPILE_DEFINITIONS})
|
||||
target_link_libraries(TorqueEngine ${TORQUE_LINK_LIBRARIES})
|
||||
target_link_libraries(TorqueEngine ${TORQUE_LINK_LIBRARIES} ${TORQUE_LINK_THIRDPARTY})
|
||||
target_include_directories(TorqueEngine PUBLIC ${CMAKE_CURRENT_SOURCE_DIR} "${CMAKE_BINARY_DIR}/temp" ${TORQUE_INCLUDE_DIRECTORIES})
|
||||
|
||||
set(TORQUE_SOURCE_FILES "main/main.cpp")
|
||||
|
|
@ -509,7 +527,7 @@ foreach (TORQUE_LIBRARY ${TORQUE_LINK_LIBRARIES})
|
|||
endforeach()
|
||||
|
||||
target_compile_definitions(${TORQUE_APP_NAME} PUBLIC ${TORQUE_COMPILE_DEFINITIONS})
|
||||
target_link_libraries(${TORQUE_APP_NAME} ${TORQUE_LINK_LIBRARIES})
|
||||
target_link_libraries(${TORQUE_APP_NAME} ${TORQUE_LINK_LIBRARIES} ${TORQUE_LINK_THIRDPARTY})
|
||||
|
||||
if(APPLE)
|
||||
target_link_libraries(${TORQUE_APP_NAME} ${TORQUE_LINK_FRAMEWORKS})
|
||||
|
|
|
|||
|
|
@ -1,13 +0,0 @@
|
|||
if(TARGET FLAC)
|
||||
set(FLAC_FOUND TRUE)
|
||||
set(FLAC_INCLUDE_DIRS $<TARGET_PROPERTY:FLAC,INTERFACE_INCLUDE_DIRECTORIES>)
|
||||
set(FLAC_LIBRARIES FLAC)
|
||||
|
||||
# Provide an alias for consistency with modern CMake
|
||||
if(NOT TARGET FLAC::FLAC)
|
||||
add_library(FLAC::FLAC ALIAS FLAC)
|
||||
endif()
|
||||
else()
|
||||
set(FLAC_FOUND FALSE)
|
||||
message(FATAL_ERROR "Flac was not added with add_subdirectory before calling find_package(FLAC).")
|
||||
endif()
|
||||
|
|
@ -1,13 +0,0 @@
|
|||
if(TARGET ogg)
|
||||
set(OGG_FOUND TRUE)
|
||||
set(OGG_INCLUDE_DIRS $<TARGET_PROPERTY:ogg,INTERFACE_INCLUDE_DIRECTORIES>)
|
||||
set(OGG_LIBRARIES ogg)
|
||||
|
||||
# Provide an alias for consistency with modern CMake
|
||||
if(NOT TARGET OGG::OGG)
|
||||
add_library(OGG::OGG ALIAS ogg)
|
||||
endif()
|
||||
else()
|
||||
set(OGG_FOUND FALSE)
|
||||
message(FATAL_ERROR "Ogg was not added with add_subdirectory before calling find_package(Ogg).")
|
||||
endif()
|
||||
|
|
@ -1,13 +0,0 @@
|
|||
if(TARGET opus)
|
||||
set(OPUS_FOUND TRUE)
|
||||
set(OPUS_INCLUDE_DIRS $<TARGET_PROPERTY:opus,INTERFACE_INCLUDE_DIRECTORIES>)
|
||||
set(OPUS_LIBRARIES opus)
|
||||
|
||||
# Provide an alias for consistency with modern CMake
|
||||
if(NOT TARGET OPUS::OPUS)
|
||||
add_library(OPUS::OPUS ALIAS opus)
|
||||
endif()
|
||||
else()
|
||||
set(OPUS_FOUND FALSE)
|
||||
message(FATAL_ERROR "Opus was not added with add_subdirectory before calling find_package(Opus).")
|
||||
endif()
|
||||
|
|
@ -1,16 +0,0 @@
|
|||
if(TARGET vorbis)
|
||||
set(VORBIS_FOUND TRUE)
|
||||
set(VORBIS_INCLUDE_DIRS $<TARGET_PROPERTY:vorbis,INTERFACE_INCLUDE_DIRECTORIES>)
|
||||
set(VORBIS_LIBRARIES vorbis)
|
||||
|
||||
# Provide an alias for consistency with modern CMake
|
||||
if(NOT TARGET VORBIS::VORBIS)
|
||||
add_library(VORBIS::VORBIS ALIAS vorbis)
|
||||
endif()
|
||||
if(NOT TARGET Vorbis::vorbisenc)
|
||||
add_library(Vorbis::vorbisenc ALIAS vorbisenc)
|
||||
endif()
|
||||
else()
|
||||
set(VORBIS_FOUND FALSE)
|
||||
message(FATAL_ERROR "Vorbis was not added with add_subdirectory before calling find_package(Vorbis).")
|
||||
endif()
|
||||
Loading…
Reference in a new issue