diff options
author | Erik Kundiman <erik@megapahit.org> | 2024-08-13 11:29:14 +0800 |
---|---|---|
committer | Erik Kundiman <erik@megapahit.org> | 2024-08-13 12:18:37 +0800 |
commit | 3d2c32c80562106169b78305315e2bd5945fdf09 (patch) | |
tree | 71dbac8c55b78f0daa361109f3c064d9d92a000d /indra/cmake/FMODSTUDIO.cmake | |
parent | 07420ece4ae38c446ad58c3c3959cce5e00a6cf1 (diff) |
CMake file & try_compile replacing execute_process
file(DOWNLOAD) replacing execute_process(COMMAND curl),
file(ARCHIVE_EXTRACT) replacing execute_process(COMMAND tar xf),
file(MAKE_DIRECTORY) replacing execute_process(COMMAND mkdir -p),
file(COPY) replacing execute_process(COMMAND cp),
file(RENAME) replacing execute_process(COMMAND mv),
try_compile replacing execute_process(COMMAND cmake/make),
LIBS_PREBUILT_DIR replacing AUTOBUILD_INSTALL_DIR,
0 replacing ${${_binary}_installed} where appropriate,
no FMOD reinstallation when it's already installed,
and archives & unarchived source/build directories are in CMake
root binary directory, instead of /tmp.
SHOW_PROGRESS is on for downloading Dullahan from the Megapahit
website cause it can be slow.
Diffstat (limited to 'indra/cmake/FMODSTUDIO.cmake')
-rw-r--r-- | indra/cmake/FMODSTUDIO.cmake | 90 |
1 files changed, 45 insertions, 45 deletions
diff --git a/indra/cmake/FMODSTUDIO.cmake b/indra/cmake/FMODSTUDIO.cmake index 92bef238d7..e449adaf67 100644 --- a/indra/cmake/FMODSTUDIO.cmake +++ b/indra/cmake/FMODSTUDIO.cmake @@ -30,30 +30,33 @@ if (USE_FMODSTUDIO) # Note: if you're not using INSTALL_PROPRIETARY, the package URL should be local (file:/// URL) # as accessing the private LL location will fail if you don't have the credential include(Prebuilt) - if (USESYSTEMLIBS) + if (USESYSTEMLIBS AND (${PREBUILD_TRACKING_DIR}/sentinel_installed IS_NEWER_THAN ${PREBUILD_TRACKING_DIR}/fmodstudio_installed OR NOT ${fmodstudio_installed} EQUAL 0)) + file(MAKE_DIRECTORY + ${LIBS_PREBUILT_DIR}/include/fmodstudio + ${LIBS_PREBUILT_DIR}/lib/release + ) if (DARWIN) execute_process( - COMMAND hdiutil attach -noverify $ENV{HOME}/Downloads/fmodstudioapi20223mac-installer.dmg - COMMAND mkdir -p - include/fmodstudio - lib/release - WORKING_DIRECTORY ${AUTOBUILD_INSTALL_DIR} + COMMAND hdiutil attach -noverify fmodstudioapi20223mac-installer.dmg + WORKING_DIRECTORY $ENV{HOME}/Downloads + ) + file( + COPY + /Volumes/FMOD\ Programmers\ API\ Mac/FMOD\ Programmers\ API/api/core/inc/fmod.h + /Volumes/FMOD\ Programmers\ API\ Mac/FMOD\ Programmers\ API/api/core/inc/fmod.hpp + /Volumes/FMOD\ Programmers\ API\ Mac/FMOD\ Programmers\ API/api/core/inc/fmod_codec.h + /Volumes/FMOD\ Programmers\ API\ Mac/FMOD\ Programmers\ API/api/core/inc/fmod_common.h + /Volumes/FMOD\ Programmers\ API\ Mac/FMOD\ Programmers\ API/api/core/inc/fmod_dsp.h + /Volumes/FMOD\ Programmers\ API\ Mac/FMOD\ Programmers\ API/api/core/inc/fmod_dsp_effects.h + /Volumes/FMOD\ Programmers\ API\ Mac/FMOD\ Programmers\ API/api/core/inc/fmod_errors.h + /Volumes/FMOD\ Programmers\ API\ Mac/FMOD\ Programmers\ API/api/core/inc/fmod_output.h + DESTINATION ${LIBS_PREBUILT_DIR}/include/fmodstudio ) execute_process( - COMMAND cp - inc/fmod.h - inc/fmod.hpp - inc/fmod_codec.h - inc/fmod_common.h - inc/fmod_dsp.h - inc/fmod_dsp_effects.h - inc/fmod_errors.h - inc/fmod_output.h - ${AUTOBUILD_INSTALL_DIR}/include/fmodstudio/ COMMAND lipo lib/libfmod.dylib -thin ${CMAKE_OSX_ARCHITECTURES} - -output ${AUTOBUILD_INSTALL_DIR}/lib/release/libfmod.dylib + -output ${LIBS_PREBUILT_DIR}/lib/release/libfmod.dylib WORKING_DIRECTORY /Volumes/FMOD\ Programmers\ API\ Mac/FMOD\ Programmers\ API/api/core ) execute_process( @@ -61,40 +64,37 @@ if (USE_FMODSTUDIO) WORKING_DIRECTORY /Volumes RESULT_VARIABLE fmodstudio_installed ) + file(WRITE ${PREBUILD_TRACKING_DIR}/fmodstudio_installed "${fmodstudio_installed}") else (DARWIN) - execute_process( - COMMAND mkdir -p ${AUTOBUILD_INSTALL_DIR}/include/fmodstudio - COMMAND tar -xf $ENV{HOME}/Downloads/fmodstudioapi20223linux.tar.gz - WORKING_DIRECTORY /tmp + file(ARCHIVE_EXTRACT + INPUT $ENV{HOME}/Downloads/fmodstudioapi20223linux.tar.gz + DESTINATION ${CMAKE_BINARY_DIR} ) - execute_process( - COMMAND cp - inc/fmod.h - inc/fmod.hpp - inc/fmod_codec.h - inc/fmod_common.h - inc/fmod_dsp.h - inc/fmod_dsp_effects.h - inc/fmod_errors.h - inc/fmod_output.h - ${AUTOBUILD_INSTALL_DIR}/include/fmodstudio/ - COMMAND cp -P - lib/${CMAKE_SYSTEM_PROCESSOR}/libfmod.so - lib/${CMAKE_SYSTEM_PROCESSOR}/libfmod.so.13 - lib/${CMAKE_SYSTEM_PROCESSOR}/libfmod.so.13.23 - ${AUTOBUILD_INSTALL_DIR}/lib/release/ - WORKING_DIRECTORY /tmp/fmodstudioapi20223linux/api/core + file( + COPY + ${CMAKE_BINARY_DIR}/fmodstudioapi20223linux/api/core/inc/fmod.h + ${CMAKE_BINARY_DIR}/fmodstudioapi20223linux/api/core/inc/fmod.hpp + ${CMAKE_BINARY_DIR}/fmodstudioapi20223linux/api/core/inc/fmod_codec.h + ${CMAKE_BINARY_DIR}/fmodstudioapi20223linux/api/core/inc/fmod_common.h + ${CMAKE_BINARY_DIR}/fmodstudioapi20223linux/api/core/inc/fmod_dsp.h + ${CMAKE_BINARY_DIR}/fmodstudioapi20223linux/api/core/inc/fmod_dsp_effects.h + ${CMAKE_BINARY_DIR}/fmodstudioapi20223linux/api/core/inc/fmod_errors.h + ${CMAKE_BINARY_DIR}/fmodstudioapi20223linux/api/core/inc/fmod_output.h + DESTINATION ${LIBS_PREBUILT_DIR}/include/fmodstudio ) - execute_process( - COMMAND rm -rf fmodstudioapi20223linux - WORKING_DIRECTORY /tmp - RESULT_VARIABLE fmodstudio_installed + file( + COPY + ${CMAKE_BINARY_DIR}/fmodstudioapi20223linux/api/core/lib/${CMAKE_SYSTEM_PROCESSOR}/libfmod.so + ${CMAKE_BINARY_DIR}/fmodstudioapi20223linux/api/core/lib/${CMAKE_SYSTEM_PROCESSOR}/libfmod.so.13 + ${CMAKE_BINARY_DIR}/fmodstudioapi20223linux/api/core/lib/${CMAKE_SYSTEM_PROCESSOR}/libfmod.so.13.23 + DESTINATION ${LIBS_PREBUILT_DIR}/lib/release + FOLLOW_SYMLINK_CHAIN ) + file(WRITE ${PREBUILD_TRACKING_DIR}/fmodstudio_installed "0") endif (DARWIN) - file(WRITE ${PREBUILD_TRACKING_DIR}/fmodstudio_installed "${fmodstudio_installed}") - else (USESYSTEMLIBS) + else (USESYSTEMLIBS AND (${PREBUILD_TRACKING_DIR}/sentinel_installed IS_NEWER_THAN ${PREBUILD_TRACKING_DIR}/fmodstudio_installed OR NOT ${fmodstudio_installed} EQUAL 0)) use_prebuilt_binary(fmodstudio) - endif (USESYSTEMLIBS) + endif (USESYSTEMLIBS AND (${PREBUILD_TRACKING_DIR}/sentinel_installed IS_NEWER_THAN ${PREBUILD_TRACKING_DIR}/fmodstudio_installed OR NOT ${fmodstudio_installed} EQUAL 0)) if (WINDOWS) target_link_libraries( ll::fmodstudio INTERFACE fmod_vc) elseif (DARWIN) |