1
0
Fork 0

Find OpenAL and rlottie with cmake module and fallback to pkg-config

This commit is contained in:
Ilya Fedin 2020-06-06 16:43:30 +04:00 committed by John Preston
parent 63f0ef5c63
commit 4d8c284636
2 changed files with 17 additions and 6 deletions

View file

@ -8,9 +8,15 @@ add_library(external_openal INTERFACE IMPORTED GLOBAL)
add_library(desktop-app::external_openal ALIAS external_openal) add_library(desktop-app::external_openal ALIAS external_openal)
if (DESKTOP_APP_USE_PACKAGED) if (DESKTOP_APP_USE_PACKAGED)
find_package(OpenAL REQUIRED) find_package(OpenAL)
target_include_directories(external_openal INTERFACE ${OPENAL_INCLUDE_DIR}) if (OPENAL_FOUND)
target_link_libraries(external_openal INTERFACE ${OPENAL_LIBRARY}) target_include_directories(external_openal INTERFACE ${OPENAL_INCLUDE_DIR})
target_link_libraries(external_openal INTERFACE ${OPENAL_LIBRARY})
else()
find_package(PkgConfig REQUIRED)
pkg_check_modules(OPENAL REQUIRED IMPORTED_TARGET openal)
target_link_libraries(external_openal INTERFACE PkgConfig::OPENAL)
endif()
elseif (WIN32) elseif (WIN32)
target_include_directories(external_openal SYSTEM target_include_directories(external_openal SYSTEM
INTERFACE INTERFACE

View file

@ -8,9 +8,14 @@ if (DESKTOP_APP_USE_PACKAGED_RLOTTIE AND NOT DESKTOP_APP_USE_PACKAGED_LAZY)
add_library(external_rlottie INTERFACE IMPORTED GLOBAL) add_library(external_rlottie INTERFACE IMPORTED GLOBAL)
add_library(desktop-app::external_rlottie ALIAS external_rlottie) add_library(desktop-app::external_rlottie ALIAS external_rlottie)
find_package(PkgConfig REQUIRED) find_package(rlottie)
pkg_check_modules(RLOTTIE REQUIRED IMPORTED_TARGET rlottie) if (rlottie_FOUND)
target_link_libraries(external_rlottie INTERFACE PkgConfig::RLOTTIE) target_link_libraries(external_rlottie INTERFACE rlottie::rlottie)
else()
find_package(PkgConfig REQUIRED)
pkg_check_modules(RLOTTIE REQUIRED IMPORTED_TARGET rlottie)
target_link_libraries(external_rlottie INTERFACE PkgConfig::RLOTTIE)
endif()
else() else()
add_library(external_rlottie OBJECT) add_library(external_rlottie OBJECT)
add_library(desktop-app::external_rlottie ALIAS external_rlottie) add_library(desktop-app::external_rlottie ALIAS external_rlottie)