From 4d93da06a3dd623d9c75841d6c91ef43ff7fa9f3 Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Wed, 7 Aug 2024 20:02:42 +0800 Subject: Install FMOD automatically on macOS It's assumed that fmodstudioapi20223mac-installer.dmg has been downloaded to ~/Downloads/. --- README.md | 5 ----- indra/cmake/FMODSTUDIO.cmake | 31 +++++++++++++++++++++++++++---- 2 files changed, 27 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index cd8b495e85..ad9215aca7 100644 --- a/README.md +++ b/README.md @@ -40,11 +40,7 @@ $ cd ~/Downloads $ curl -OL https://github.com/secondlife/3p-curl/releases/download/v7.54.1-513145c/curl-7.54.1-513145c-darwin64-513145c.tar.zst -OL https://megapahit.net/downloads/dullahan-1.14.0.202312131437_118.7.1_g99817d2_chromium-118.0.5993.119-darwinuniversal-233471337.tar.bz2 -OL https://github.com/secondlife/3p-emoji-shortcodes/releases/download/v6.1.0.5413f58/emoji_shortcodes-6.1.0.5413f58-darwin64-5413f58.tar.zst -OL https://github.com/secondlife/3p-glh_linear/releases/download/v1.0.1-dev4-984c397/glh_linear-1.0.1-dev4-common-984c397.tar.zst -OL https://github.com/secondlife/llca/releases/download/v202402012004.0-0f5d9c3/llca-202402012004.0-common-0f5d9c3.tar.zst -L https://github.com/zeux/meshoptimizer/archive/refs/tags/v0.21.tar.gz -o meshoptimizer-0.21.tar.gz -OL https://github.com/secondlife/3p-mikktspace/releases/download/v2-e967e1b/mikktspace-1-darwin64-8756084692.tar.zst -OL https://automated-builds-secondlife-com.s3.amazonaws.com/ct2/115452/994130/nanosvg-2022.09.27-darwin64-580364.tar.bz2 -OL https://github.com/secondlife/3p-libndofdev/releases/download/v0.1.8e9edc7/libndofdev-0.1.8e9edc7-darwin64-8e9edc7.tar.zst -L https://github.com/uclouvain/openjpeg/archive/refs/tags/v2.5.2.tar.gz -o openjpeg-2.5.2.tar.gz -OL https://github.com/secondlife/3p-openssl/releases/download/v1.1.1q.de53f55/openssl-1.1.1q.de53f55-darwin64-de53f55.tar.zst -OL https://github.com/secondlife/3p-tinyexr/releases/download/v1.0.8-ba4bc64/tinyexr-v1.0.8-common-9373975608.tar.zst -OL https://github.com/secondlife/3p-tinygltf/releases/download/v2.5.0-1ae57fd/tinygltf-v2.5.0-common-1ae57fd.tar.zst -OL https://github.com/secondlife/3p-viewer-fonts/releases/download/v1.0.0-r1/viewer_fonts-1.0.0.8512067490-common-8512067490.tar.zst -OL https://get.videolan.org/vlc/3.0.21/macosx/vlc-3.0.21-universal.dmg -OL https://sourceforge.net/projects/xmlrpc-epi/files/xmlrpc-epi-base/0.54.2/xmlrpc-epi-0.54.2.tar.bz2 $ cd - $ cd .. -$ open ~/Downloads/fmodstudioapi20222mac-installer.dmg $ open ~/Downloads/vlc-3.0.21-universal.dmg -$ mkdir -p viewer/build/universal-apple-darwin`uname -r`/packages/include/fmodstudio -$ cp /Volumes/FMOD\ Programmers\ API\ Mac/FMOD\ Programmers\ API/api/core/inc/fmod*.h* viewer/build/universal-apple-darwin`uname -r`/packages/include/fmodstudio/ -$ cp /Volumes/FMOD\ Programmers\ API\ Mac/FMOD\ Programmers\ API/api/core/lib/libfmod.dylib viewer/build/universal-apple-darwin`uname -r`/packages/lib/release/ $ tar xf ~/Downloads/meshoptimizer-0.21.tar.gz $ tar xf ~/Downloads/openjpeg-2.5.2.tar.gz $ tar xf ~/Downloads/xmlrpc-epi-0.54.2.tar.bz2 @@ -128,7 +124,6 @@ $ sudo curl -OL https://raw.githubusercontent.com/DLTcollab/sse2neon/master/sse2 $ cd - $ export LL_BUILD="-O3 -gdwarf-2 -stdlib=libc++ -iwithsysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk -std=c++17 -fPIC -DLL_RELEASE=1 -DLL_RELEASE_FOR_DOWNLOAD=1 -DNDEBUG -DPIC -DLL_DARWIN=1" $ cmake -DCMAKE_BUILD_TYPE:STRING=Release -DCMAKE_INSTALL_PREFIX:PATH=newview/Megapahit.app/Contents/Resources -DCMAKE_OSX_ARCHITECTURES:STRING="arm64;x86_64" -DADDRESS_SIZE:INTERNAL=64 -DUSESYSTEMLIBS:BOOL=ON -DUSE_OPENAL:BOOL=OFF -DUSE_FMODSTUDIO:BOOL=ON -DLL_TESTS:BOOL=OFF -DNDOF:BOOL=ON -DVIEWER_CHANNEL:STRING=Megapahit -DVIEWER_BINARY_NAME:STRING=megapahit -DBUILD_SHARED_LIBS:BOOL=OFF -DINSTALL:BOOL=ON -DPACKAGE:BOOL=OFF ../../indra -$ cmake ../../indra $ make -j`sysctl -n hw.ncpu` $ make install $ open newview/Megapahit.app diff --git a/indra/cmake/FMODSTUDIO.cmake b/indra/cmake/FMODSTUDIO.cmake index 38437b7bfb..02e7fbd9eb 100644 --- a/indra/cmake/FMODSTUDIO.cmake +++ b/indra/cmake/FMODSTUDIO.cmake @@ -30,9 +30,34 @@ 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 (NOT USESYSTEMLIBS) + if (USESYSTEMLIBS) + if (DARWIN) + execute_process( + COMMAND hdiutil attach -noverify $ENV{HOME}/Downloads/fmodstudioapi20223mac-installer.dmg + COMMAND mkdir -p ${AUTOBUILD_INSTALL_DIR}/include/fmodstudio + ) + execute_process( + COMMAND cp + /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 + ${AUTOBUILD_INSTALL_DIR}/include/fmodstudio/ + COMMAND cp /Volumes/FMOD\ Programmers\ API\ Mac/FMOD\ Programmers\ API/api/core/lib/libfmod.dylib ${AUTOBUILD_INSTALL_DIR}/lib/release/ + ) + execute_process( + COMMAND hdiutil detach /Volumes/FMOD\ Programmers\ API\ Mac + WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}" + RESULT_VARIABLE ${_binary}_installed + ) + endif (DARWIN) + else (USESYSTEMLIBS) use_prebuilt_binary(fmodstudio) - endif () + endif (USESYSTEMLIBS) if (WINDOWS) target_link_libraries( ll::fmodstudio INTERFACE fmod_vc) elseif (DARWIN) @@ -42,9 +67,7 @@ if (USE_FMODSTUDIO) target_link_libraries( ll::fmodstudio INTERFACE fmod) endif (WINDOWS) - if (NOT USESYSTEMLIBS) target_include_directories( ll::fmodstudio SYSTEM INTERFACE ${LIBS_PREBUILT_DIR}/include/fmodstudio) - endif () endif (FMODSTUDIO_LIBRARY AND FMODSTUDIO_INCLUDE_DIR) else() set( USE_FMODSTUDIO "OFF") -- cgit v1.2.3