Skip to content

Commit 1922943

Browse files
alebcayjcelerier
authored andcommitted
cmake: allow using system-installed readerwriterqueue
1 parent 228dd16 commit 1922943

1 file changed

Lines changed: 10 additions & 6 deletions

File tree

cmake/libremidi.deps.cmake

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,15 @@ if(NOT LIBREMIDI_NO_PIPEWIRE)
4040
set(LIBREMIDI_NEEDS_READERWRITERQUEUE 1)
4141
endif()
4242
if(LIBREMIDI_NEEDS_READERWRITERQUEUE AND NOT TARGET readerwriterqueue)
43-
FetchContent_Declare(
44-
readerwriterqueue
45-
GIT_REPOSITORY https://github.com/cameron314/readerwriterqueue
46-
GIT_TAG master
47-
)
43+
find_package(readerwriterqueue)
44+
45+
if(NOT readerwriterqueue_FOUND)
46+
FetchContent_Declare(
47+
readerwriterqueue
48+
GIT_REPOSITORY https://github.com/cameron314/readerwriterqueue
49+
GIT_TAG master
50+
)
4851

49-
FetchContent_MakeAvailable(readerwriterqueue)
52+
FetchContent_MakeAvailable(readerwriterqueue)
53+
endif()
5054
endif()

0 commit comments

Comments
 (0)