diff options
author | Jaakko Keränen <jaakko.keranen@iki.fi> | 2020-10-14 22:19:21 +0300 |
---|---|---|
committer | Jaakko Keränen <jaakko.keranen@iki.fi> | 2020-10-14 22:19:21 +0300 |
commit | b073e4c6aad0a4c35ea89c4592d5b48a39bb61f5 (patch) | |
tree | 4c35506cd40ba0af0ef3c1d526435b8abd1b9f70 /CMakeLists.txt | |
parent | 625e3046cc636db5b0325b96b4c22610252a5ab4 (diff) |
Use libmpg123 to decode MPEG audio
mpg123 is configured as an optional dependency. Works for full files currently.
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 46ddd44a..4c65bab6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt | |||
@@ -26,6 +26,7 @@ project (Lagrange | |||
26 | set (COPYRIGHT_YEAR 2020) | 26 | set (COPYRIGHT_YEAR 2020) |
27 | 27 | ||
28 | # Build configuration. | 28 | # Build configuration. |
29 | option (ENABLE_MPG123 "Use mpg123 for decoding MPEG audio" ON) | ||
29 | option (ENABLE_X11_SWRENDER "Use software rendering under X11" OFF) | 30 | option (ENABLE_X11_SWRENDER "Use software rendering under X11" OFF) |
30 | option (ENABLE_KERNING "Enable kerning in font renderer (slower)" ON) | 31 | option (ENABLE_KERNING "Enable kerning in font renderer (slower)" ON) |
31 | option (ENABLE_RESOURCE_EMBED "Embed resources inside the executable" OFF) | 32 | option (ENABLE_RESOURCE_EMBED "Embed resources inside the executable" OFF) |
@@ -47,6 +48,7 @@ else () | |||
47 | endif () | 48 | endif () |
48 | find_package (PkgConfig REQUIRED) | 49 | find_package (PkgConfig REQUIRED) |
49 | pkg_check_modules (SDL2 REQUIRED sdl2) | 50 | pkg_check_modules (SDL2 REQUIRED sdl2) |
51 | pkg_check_modules (MPG123 IMPORTED_TARGET libmpg123) | ||
50 | 52 | ||
51 | # Embedded resources are written to a generated source file. | 53 | # Embedded resources are written to a generated source file. |
52 | message (STATUS "Preparing embedded resources...") | 54 | message (STATUS "Preparing embedded resources...") |
@@ -201,6 +203,10 @@ endif () | |||
201 | if (ENABLE_WINDOWPOS_FIX) | 203 | if (ENABLE_WINDOWPOS_FIX) |
202 | target_compile_definitions (app PUBLIC LAGRANGE_ENABLE_WINDOWPOS_FIX=1) | 204 | target_compile_definitions (app PUBLIC LAGRANGE_ENABLE_WINDOWPOS_FIX=1) |
203 | endif () | 205 | endif () |
206 | if (ENABLE_MPG123 AND MPG123_FOUND) | ||
207 | target_compile_definitions (app PUBLIC LAGRANGE_ENABLE_MPG123=1) | ||
208 | target_link_libraries (app PUBLIC PkgConfig::MPG123) | ||
209 | endif () | ||
204 | target_link_libraries (app PUBLIC the_Foundation::the_Foundation) | 210 | target_link_libraries (app PUBLIC the_Foundation::the_Foundation) |
205 | target_link_libraries (app PUBLIC ${SDL2_LDFLAGS}) | 211 | target_link_libraries (app PUBLIC ${SDL2_LDFLAGS}) |
206 | if (APPLE) | 212 | if (APPLE) |