mirror of
https://gitlab.com/dosowisko.net/libsuperderpy.git
synced 2025-02-07 21:56:44 +01:00
FlacToOgg: fix and make more robust
This commit is contained in:
parent
3da81d4388
commit
996c7e4d8e
2 changed files with 17 additions and 7 deletions
|
@ -1,6 +1,16 @@
|
|||
file(GLOB_RECURSE FLAC_FILES RELATIVE ${DATADIR} ${DATADIR}/*.flac)
|
||||
|
||||
foreach(file IN LISTS FLAC_FILES)
|
||||
execute_process(COMMAND oggenc -Q -b 192 --resample 44100 ${file} WORKING_DIRECTORY ${DATADIR})
|
||||
file(REMOVE ${DATADIR}/${file})
|
||||
endforeach(file)
|
||||
find_program(OGGENC NAMES oggenc NO_CMAKE_FIND_ROOT_PATH)
|
||||
if(OGGENC)
|
||||
file(GLOB_RECURSE FLAC_FILES RELATIVE ${DATADIR} ${DATADIR}/*.flac)
|
||||
message(STATUS "FlacToOgg engaging... (using ${OGGENC})")
|
||||
foreach(file IN LISTS FLAC_FILES)
|
||||
message(STATUS ${file})
|
||||
execute_process(COMMAND ${OGGENC} -Q -b 192 --resample 44100 ${file} WORKING_DIRECTORY ${DATADIR} RESULT_VARIABLE OGGENC_RESULT)
|
||||
if(OGGENC_RESULT)
|
||||
message(WARNING "ERROR: ${OGGENC_RESULT}")
|
||||
else()
|
||||
file(REMOVE ${DATADIR}/${file})
|
||||
endif()
|
||||
endforeach(file)
|
||||
else(OGGENC)
|
||||
message(WARNING "FlacToOgg: can't find oggenc!")
|
||||
endif(OGGENC)
|
||||
|
|
|
@ -316,7 +316,7 @@ if (NOT LIBSUPERDERPY_CONFIG_INCLUDED)
|
|||
set(FLACTOOGG_DATADIR "${CMAKE_BINARY_DIR}/android/assets/data")
|
||||
set(FLACTOOGG_DEPEND "")
|
||||
else (EMSCRIPTEN)
|
||||
set(FLACTOOGG_DATADIR "${CMAKE_INSTALL_PREFIX}/${LIBSUPERDERPY_GAMENAME}/data")
|
||||
set(FLACTOOGG_DATADIR "${CMAKE_INSTALL_PREFIX}/share/${LIBSUPERDERPY_GAMENAME}/data")
|
||||
set(FLACTOOGG_DEPEND ${LIBSUPERDERPY_GAMENAME}_install)
|
||||
endif()
|
||||
|
||||
|
|
Loading…
Reference in a new issue