Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

fix build using system libs #2832

Merged
merged 1 commit into from
Dec 13, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion cmake/dependencies-helpers/OpenAL.cmake
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
# Refind OpenAL to add the OpenAL::OpenAL target

if (${_PREFIX}USE_OPENAL STREQUAL "SYSTEM")
find_package(OpenAL QUIET)
if (NOT TARGET OpenAL::OpenAL)
find_package(OpenAL QUIET CONFIG)
add_library(OpenAL::OpenAL INTERFACE IMPORTED)
set_target_properties(OpenAL::OpenAL PROPERTIES
INTERFACE_LINK_LIBRARIES "${OPENAL_LIBRARY}"
INTERFACE_INCLUDE_DIRECTORIES "${OPENAL_INCLUDE_DIR}"
)
endif ()
endif ()
5 changes: 2 additions & 3 deletions cmake/dependencies-helpers/RapidJSON.cmake
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
# Add the RapidJSON target

if (${_PREFIX}USE_RAPIDJSON STREQUAL "SYSTEM")
if (NOT TARGET RapidJSON::RapidJSON AND TARGET rapidjson)
if (NOT TARGET RapidJSON::RapidJSON)
message(STATUS "Adding RapidJSON::RapidJSON target")
set_target_properties(rapidjson PROPERTIES IMPORTED_GLOBAL TRUE)
add_library(RapidJSON::RapidJSON ALIAS rapidjson)
add_library(RapidJSON::RapidJSON INTERFACE IMPORTED)
endif ()
endif ()