1
0
mirror of https://github.com/rwengine/openrw.git synced 2024-11-07 11:22:45 +01:00
openrw/cmake/modules/WrapTargets.cmake

53 lines
1.7 KiB
CMake
Raw Normal View History

function(rwdep_wrap_find_packages)
2018-06-24 00:43:06 +02:00
if(BULLET_FOUND AND NOT TARGET bullet::bullet)
add_library(bullet INTERFACE)
target_link_libraries(bullet
INTERFACE
${BULLET_LIBRARIES}
)
target_include_directories(bullet SYSTEM
INTERFACE
"${BULLET_INCLUDE_DIR}"
)
add_library(bullet::bullet ALIAS bullet)
endif()
if(OPENAL_FOUND AND NOT TARGET OpenAL::OpenAL)
add_library(OpenAL INTERFACE)
target_link_libraries(OpenAL
INTERFACE
"${OPENAL_LIBRARY}"
)
target_include_directories(OpenAL SYSTEM
INTERFACE
"${OPENAL_INCLUDE_DIR}"
)
add_library(OpenAL::OpenAL ALIAS OpenAL)
2018-08-09 23:08:07 +02:00
endif()
endfunction()
function(rwdep_wrap_conan_target TARGET CONAN_NAME)
2018-07-06 02:25:48 +02:00
string(RANDOM RND)
set(TGT "CONAN_${CONAN_NAME}_${RND}")
add_library("${TGT}" INTERFACE)
target_link_libraries("${TGT}" INTERFACE "CONAN_PKG::${CONAN_NAME}")
add_library("${TARGET}" ALIAS "${TGT}")
endfunction()
function(rwdep_wrap_conan_targets)
2018-06-24 00:43:06 +02:00
rwdep_wrap_conan_target(OpenAL::OpenAL openal)
rwdep_wrap_conan_target(bullet::bullet bullet)
rwdep_wrap_conan_target(glm::glm glm)
rwdep_wrap_conan_target(ffmpeg::ffmpeg ffmpeg)
rwdep_wrap_conan_target(SDL2::SDL2 sdl2)
2018-08-09 23:08:07 +02:00
if(BUILD_TOOLS)
2018-06-24 00:43:06 +02:00
rwdep_wrap_conan_target(Freetype::Freetype freetype)
2018-08-09 23:08:07 +02:00
endif()
2018-07-06 02:25:48 +02:00
rwdep_wrap_conan_target(Boost::boost boost)
rwdep_wrap_conan_target(Boost::filesystem boost)
rwdep_wrap_conan_target(Boost::program_options boost)
rwdep_wrap_conan_target(Boost::system boost)
rwdep_wrap_conan_target(Boost::unit_test_framework boost)
endfunction()