| 1 |
find_library(SONIC_LIB sonic) |
| 2 |
find_path(SONIC_INC "sonic.h") |
| 3 |
find_library(PCAUDIO_LIB pcaudio) |
| 4 |
find_path(PCAUDIO_INC "pcaudiolib/audio.h") |
| 5 |
find_library(PTHREAD_LIB pthread) |
| 6 |
find_program(MBROLA_BIN mbrola) |
| 7 |
|
| 8 |
include(FetchContent) |
| 9 |
|
| 10 |
if (PTHREAD_LIB) |
| 11 |
set(HAVE_PTHREAD ON) |
| 12 |
endif(PTHREAD_LIB) |
| 13 |
if (MBROLA_BIN) |
| 14 |
set(HAVE_MBROLA ON) |
| 15 |
endif(MBROLA_BIN) |
| 16 |
if (SONIC_LIB AND SONIC_INC) |
| 17 |
set(HAVE_LIBSONIC ON) |
| 18 |
else() |
| 19 |
FetchContent_Declare(sonic-git |
| 20 |
GIT_REPOSITORY https://github.com/waywardgeek/sonic.git |
| 21 |
GIT_TAG fbf75c3d6d846bad3bb3d456cbc5d07d9fd8c104 |
| 22 |
) |
| 23 |
FetchContent_MakeAvailable(sonic-git) |
| 24 |
FetchContent_GetProperties(sonic-git) |
| 25 |
add_library(sonic OBJECT ${sonic-git_SOURCE_DIR}/sonic.c) |
| 26 |
target_include_directories(sonic PUBLIC ${sonic-git_SOURCE_DIR}) |
| 27 |
set(HAVE_LIBSONIC ON) |
| 28 |
set(SONIC_LIB sonic) |
| 29 |
set(SONIC_INC ${sonic-git_SOURCE_DIR}) |
| 30 |
endif() |
| 31 |
if (PCAUDIO_LIB AND PCAUDIO_INC) |
| 32 |
set(HAVE_LIBPCAUDIO ON) |
| 33 |
endif() |