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/. --- indra/cmake/FMODSTUDIO.cmake | 31 +++++++++++++++++++++++++++---- 1 file changed, 27 insertions(+), 4 deletions(-) (limited to 'indra/cmake') 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 From 3a995b4fb5d34b967212a61b065ad6e14422179a Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Wed, 7 Aug 2024 21:47:38 +0800 Subject: Open VLC dmg automatically It's assumed any relevant VLC dmg has been downloaded to ~/Downloads/. --- indra/cmake/LibVLCPlugin.cmake | 27 +++++++++++++++++++-------- 1 file changed, 19 insertions(+), 8 deletions(-) (limited to 'indra/cmake') diff --git a/indra/cmake/LibVLCPlugin.cmake b/indra/cmake/LibVLCPlugin.cmake index 9f0419c5e6..e2ecb8b248 100644 --- a/indra/cmake/LibVLCPlugin.cmake +++ b/indra/cmake/LibVLCPlugin.cmake @@ -5,26 +5,37 @@ include(Prebuilt) include_guard() add_library( ll::libvlc INTERFACE IMPORTED ) -if (USE_AUTOBUILD_3P OR USE_CONAN) -use_prebuilt_binary(vlc-bin) -set(LIBVLCPLUGIN ON CACHE BOOL - "LIBVLCPLUGIN support for the llplugin/llmedia test apps.") -else () +if (USESYSTEMLIBS) + if (DARWIN) + if (CMAKE_OSX_ARCHITECTURES MATCHES arm64) + execute_process(COMMAND hdiutil attach -noverify $ENV{HOME}/Downloads/vlc-3.0.21-arm64.dmg) + elseif (CMAKE_OSX_ARCHITECTURES MATCHES x86_64) + execute_process(COMMAND hdiutil attach -noverify $ENV{HOME}/Downloads/vlc-3.0.21-intel64.dmg) + else () + execute_process(COMMAND hdiutil attach -noverify $ENV{HOME}/Downloads/vlc-3.0.21-universal.dmg) + endif () target_include_directories( ll::libvlc SYSTEM INTERFACE /Volumes/VLC\ media\ player/VLC.app/Contents/MacOS/include) target_link_directories( ll::libvlc INTERFACE /Volumes/VLC\ media\ player/VLC.app/Contents/MacOS/lib) target_link_libraries( ll::libvlc INTERFACE vlc vlccore ) - else () + else (DARWIN) include(FindPkgConfig) pkg_check_modules(Libvlc REQUIRED libvlc vlc-plugin) target_include_directories( ll::libvlc SYSTEM INTERFACE ${Libvlc_INCLUDE_DIRS} ) target_link_directories( ll::libvlc INTERFACE ${Libvlc_LIBRARY_DIRS} ) target_link_libraries( ll::libvlc INTERFACE ${Libvlc_LIBRARIES} ) - endif () + endif (DARWIN) set(LIBVLCPLUGIN ON CACHE BOOL "LIBVLCPLUGIN support for the llplugin/llmedia test apps.") return() -endif () + +else (USESYSTEMLIBS) + +use_prebuilt_binary(vlc-bin) +set(LIBVLCPLUGIN ON CACHE BOOL + "LIBVLCPLUGIN support for the llplugin/llmedia test apps.") + +endif (USESYSTEMLIBS) if (WINDOWS) target_link_libraries( ll::libvlc INTERFACE -- cgit v1.2.3 From 14a87739a21bbf37b98ac6a9a0918c33f6000f1a Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Thu, 8 Aug 2024 09:04:14 +0800 Subject: Install FMOD 2.03.02 automatically on GNU/Linux --- indra/cmake/FMODSTUDIO.cmake | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'indra/cmake') diff --git a/indra/cmake/FMODSTUDIO.cmake b/indra/cmake/FMODSTUDIO.cmake index 02e7fbd9eb..bedf64ddac 100644 --- a/indra/cmake/FMODSTUDIO.cmake +++ b/indra/cmake/FMODSTUDIO.cmake @@ -54,6 +54,33 @@ if (USE_FMODSTUDIO) WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}" RESULT_VARIABLE ${_binary}_installed ) + else (DARWIN) + execute_process( + COMMAND tar -xf $ENV{HOME}/Downloads/fmodstudioapi20223linux.tar.gz -C /tmp + COMMAND mkdir -p ${AUTOBUILD_INSTALL_DIR}/include/fmodstudio + ) + execute_process( + COMMAND cp + /tmp/fmodstudioapi20223linux/api/core/inc/fmod.h + /tmp/fmodstudioapi20223linux/api/core/inc/fmod.hpp + /tmp/fmodstudioapi20223linux/api/core/inc/fmod_codec.h + /tmp/fmodstudioapi20223linux/api/core/inc/fmod_common.h + /tmp/fmodstudioapi20223linux/api/core/inc/fmod_dsp.h + /tmp/fmodstudioapi20223linux/api/core/inc/fmod_dsp_effects.h + /tmp/fmodstudioapi20223linux/api/core/inc/fmod_errors.h + /tmp/fmodstudioapi20223linux/api/core/inc/fmod_output.h + ${AUTOBUILD_INSTALL_DIR}/include/fmodstudio/ + COMMAND cp -P + /tmp/fmodstudioapi20223linux/api/core/lib/${CMAKE_SYSTEM_PROCESSOR}/libfmod.so + /tmp/fmodstudioapi20223linux/api/core/lib/${CMAKE_SYSTEM_PROCESSOR}/libfmod.so.13 + /tmp/fmodstudioapi20223linux/api/core/lib/${CMAKE_SYSTEM_PROCESSOR}/libfmod.so.13.23 + ${AUTOBUILD_INSTALL_DIR}/lib/release/ + ) + execute_process( + COMMAND rm -rf /tmp/fmodstudioapi20223linux + WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}" + RESULT_VARIABLE ${_binary}_installed + ) endif (DARWIN) else (USESYSTEMLIBS) use_prebuilt_binary(fmodstudio) -- cgit v1.2.3 From 98f2f92469351447e69f9368d42a7e6f6c3a4da0 Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Thu, 8 Aug 2024 17:23:26 +0800 Subject: Alternative to Autobuild-based use_prebuilt_binary It still parses autobuild.xml, but using `xmllint --xpath`. It searches for the "common" version of the package first, if not found then it searches for the platform specific version. The URL parsed is then fed to cURL, determining our own output file name (since I couldn't find a way to extract remote file name easily using cURL) assuming the ones we need all have tar.zst extension now. It downloads to /tmp and finally extracts to packages. --- indra/cmake/Prebuilt.cmake | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) (limited to 'indra/cmake') diff --git a/indra/cmake/Prebuilt.cmake b/indra/cmake/Prebuilt.cmake index b0acae279b..2078bf29ff 100644 --- a/indra/cmake/Prebuilt.cmake +++ b/indra/cmake/Prebuilt.cmake @@ -40,6 +40,37 @@ macro (use_prebuilt_binary _binary) --install-dir=${AUTOBUILD_INSTALL_DIR} ${_binary} ") endif(DEBUG_PREBUILT) + if(USESYSTEMLIBS) + execute_process(COMMAND xmllint + --xpath + "//map/map/map/map/map/map/string[contains(text(),'${_binary}')][contains(text(),'common')]/text()" autobuild.xml + WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/.. + OUTPUT_VARIABLE package_url + OUTPUT_STRIP_TRAILING_WHITESPACE + ) + if ("${package_url}" STREQUAL "") + string(TOLOWER ${CMAKE_SYSTEM_NAME} system_name) + execute_process(COMMAND xmllint + --xpath + "//map/map/map/map/map/map/string[contains(text(),'${_binary}')][contains(text(),'${system_name}64')]/text()" autobuild.xml + WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/.. + OUTPUT_VARIABLE package_url + OUTPUT_STRIP_TRAILING_WHITESPACE + ) + endif ("${package_url}" STREQUAL "") + execute_process(COMMAND curl + -L + ${package_url} + -o ${_binary}.tar.zst + WORKING_DIRECTORY /tmp + ) + execute_process(COMMAND tar + xf + /tmp/${_binary}.tar.zst + WORKING_DIRECTORY ${AUTOBUILD_INSTALL_DIR} + RESULT_VARIABLE ${_binary}_installed + ) + else(USESYSTEMLIBS) execute_process(COMMAND "${AUTOBUILD_EXECUTABLE}" install --install-dir=${AUTOBUILD_INSTALL_DIR} @@ -47,6 +78,7 @@ macro (use_prebuilt_binary _binary) WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}" RESULT_VARIABLE ${_binary}_installed ) + endif(USESYSTEMLIBS) file(WRITE ${PREBUILD_TRACKING_DIR}/${_binary}_installed "${${_binary}_installed}") endif(${PREBUILD_TRACKING_DIR}/sentinel_installed IS_NEWER_THAN ${PREBUILD_TRACKING_DIR}/${_binary}_installed OR NOT ${${_binary}_installed} EQUAL 0) -- cgit v1.2.3 From 4ccc3db9033a039aaa618db85126e669e08ac4c7 Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Thu, 8 Aug 2024 17:43:37 +0800 Subject: Automate viewer fonts & emoji shortcodes install Also minimise ViewerMiscLibs.cmake diff from upstream. --- indra/cmake/ViewerMiscLibs.cmake | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'indra/cmake') diff --git a/indra/cmake/ViewerMiscLibs.cmake b/indra/cmake/ViewerMiscLibs.cmake index 7de21fd59b..fad95beae8 100644 --- a/indra/cmake/ViewerMiscLibs.cmake +++ b/indra/cmake/ViewerMiscLibs.cmake @@ -1,24 +1,22 @@ # -*- cmake -*- include(Prebuilt) -if (NOT (USE_AUTOBUILD_3P OR USE_CONAN)) - add_library( ll::fontconfig INTERFACE IMPORTED ) - use_system_binary(fontconfig) -endif () - -if (LINUX) +if (NOT DARWIN) add_library( ll::fontconfig INTERFACE IMPORTED ) find_package(Fontconfig REQUIRED) target_link_libraries( ll::fontconfig INTERFACE Fontconfig::Fontconfig ) -endif (LINUX) +endif (NOT DARWIN) -if( NOT USE_CONAN ) +if( USE_AUTOBUILD_3P ) use_prebuilt_binary(libhunspell) endif() +if (NOT USESYSTEMLIBS) use_prebuilt_binary(slvoice) use_prebuilt_binary(nanosvg) +endif (NOT USESYSTEMLIBS) + use_prebuilt_binary(viewer-fonts) use_prebuilt_binary(emoji_shortcodes) -- cgit v1.2.3 From ada9a349cab2a04f7f431f6955f3c70c6b740154 Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Thu, 8 Aug 2024 17:47:11 +0800 Subject: FreeBSD uses linux64 package when it's common For example, emoji_shortcodes, it's actually common, not a platform specific binary, so it can be used by FBSD as well. --- indra/cmake/Prebuilt.cmake | 3 +++ 1 file changed, 3 insertions(+) (limited to 'indra/cmake') diff --git a/indra/cmake/Prebuilt.cmake b/indra/cmake/Prebuilt.cmake index 2078bf29ff..683c30c059 100644 --- a/indra/cmake/Prebuilt.cmake +++ b/indra/cmake/Prebuilt.cmake @@ -50,6 +50,9 @@ macro (use_prebuilt_binary _binary) ) if ("${package_url}" STREQUAL "") string(TOLOWER ${CMAKE_SYSTEM_NAME} system_name) + if (${system_name} MATCHES freebsd) + set(system_name "linux") + endif (${system_name} MATCHES freebsd) execute_process(COMMAND xmllint --xpath "//map/map/map/map/map/map/string[contains(text(),'${_binary}')][contains(text(),'${system_name}64')]/text()" autobuild.xml -- cgit v1.2.3 From 3d24e99b8c5282635ac8395ef933dc03d73d5a5f Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Thu, 8 Aug 2024 17:56:51 +0800 Subject: Make sure lib/release exists before copying FMOD Since llaudio is configured before any other LL library, FMOD gets to be checked first that has a binary library. --- indra/cmake/FMODSTUDIO.cmake | 1 + 1 file changed, 1 insertion(+) (limited to 'indra/cmake') diff --git a/indra/cmake/FMODSTUDIO.cmake b/indra/cmake/FMODSTUDIO.cmake index bedf64ddac..a278289bb6 100644 --- a/indra/cmake/FMODSTUDIO.cmake +++ b/indra/cmake/FMODSTUDIO.cmake @@ -35,6 +35,7 @@ if (USE_FMODSTUDIO) execute_process( COMMAND hdiutil attach -noverify $ENV{HOME}/Downloads/fmodstudioapi20223mac-installer.dmg COMMAND mkdir -p ${AUTOBUILD_INSTALL_DIR}/include/fmodstudio + COMMAND mkdir -p ${AUTOBUILD_INSTALL_DIR}/lib/release ) execute_process( COMMAND cp -- cgit v1.2.3 From 4a2a9d22f287cfd4765dd5353e8fdf2793b9ba0a Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Thu, 8 Aug 2024 18:08:58 +0800 Subject: Long parameters go into new lines in FMOD CMake --- indra/cmake/FMODSTUDIO.cmake | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'indra/cmake') diff --git a/indra/cmake/FMODSTUDIO.cmake b/indra/cmake/FMODSTUDIO.cmake index a278289bb6..39636d7522 100644 --- a/indra/cmake/FMODSTUDIO.cmake +++ b/indra/cmake/FMODSTUDIO.cmake @@ -34,8 +34,9 @@ if (USE_FMODSTUDIO) if (DARWIN) execute_process( COMMAND hdiutil attach -noverify $ENV{HOME}/Downloads/fmodstudioapi20223mac-installer.dmg - COMMAND mkdir -p ${AUTOBUILD_INSTALL_DIR}/include/fmodstudio - COMMAND mkdir -p ${AUTOBUILD_INSTALL_DIR}/lib/release + COMMAND mkdir -p + ${AUTOBUILD_INSTALL_DIR}/include/fmodstudio + ${AUTOBUILD_INSTALL_DIR}/lib/release ) execute_process( COMMAND cp @@ -48,7 +49,9 @@ if (USE_FMODSTUDIO) /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/ + 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 -- cgit v1.2.3 From 9bb9b975d9a2f2830865a63f5fe339b8f74147c8 Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Thu, 8 Aug 2024 20:45:11 +0800 Subject: Install GLH, Mikktspace, TinyEXR, TinyGLTF & LLCA automatically. Fix tab to spaces too. --- indra/cmake/GLH.cmake | 8 +++----- indra/cmake/Mikktspace.cmake | 2 -- indra/cmake/Prebuilt.cmake | 2 +- indra/cmake/TinyEXR.cmake | 2 -- indra/cmake/TinyGLTF.cmake | 2 -- 5 files changed, 4 insertions(+), 12 deletions(-) (limited to 'indra/cmake') diff --git a/indra/cmake/GLH.cmake b/indra/cmake/GLH.cmake index bdd8bc4836..648a08454b 100644 --- a/indra/cmake/GLH.cmake +++ b/indra/cmake/GLH.cmake @@ -2,11 +2,9 @@ include(Prebuilt) add_library( ll::glh_linear INTERFACE IMPORTED ) +target_include_directories( ll::glh_linear SYSTEM INTERFACE ${LIBS_PREBUILT_DIR}/include) -if (USESYSTEMLIBS) - target_include_directories( ll::glh_linear SYSTEM INTERFACE ${LIBS_PREBUILT_DIR}/include) - return () -endif () - +if (NOT USESYSTEMLIBS) use_system_binary( glh_linear ) +endif (NOT USESYSTEMLIBS) use_prebuilt_binary(glh_linear) diff --git a/indra/cmake/Mikktspace.cmake b/indra/cmake/Mikktspace.cmake index 9fd2becba4..c73321e313 100644 --- a/indra/cmake/Mikktspace.cmake +++ b/indra/cmake/Mikktspace.cmake @@ -1,6 +1,4 @@ # -*- cmake -*- include(Prebuilt) -if (NOT USESYSTEMLIBS) use_prebuilt_binary(mikktspace) -endif (NOT USESYSTEMLIBS) diff --git a/indra/cmake/Prebuilt.cmake b/indra/cmake/Prebuilt.cmake index 683c30c059..9125864c1d 100644 --- a/indra/cmake/Prebuilt.cmake +++ b/indra/cmake/Prebuilt.cmake @@ -44,7 +44,7 @@ macro (use_prebuilt_binary _binary) execute_process(COMMAND xmllint --xpath "//map/map/map/map/map/map/string[contains(text(),'${_binary}')][contains(text(),'common')]/text()" autobuild.xml - WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/.. + WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/.. OUTPUT_VARIABLE package_url OUTPUT_STRIP_TRAILING_WHITESPACE ) diff --git a/indra/cmake/TinyEXR.cmake b/indra/cmake/TinyEXR.cmake index c3053b8149..e6d142d19d 100644 --- a/indra/cmake/TinyEXR.cmake +++ b/indra/cmake/TinyEXR.cmake @@ -1,9 +1,7 @@ # -*- cmake -*- include(Prebuilt) -if (NOT USESYSTEMLIBS) use_prebuilt_binary(tinyexr) -endif () set(TINYEXR_INCLUDE_DIR ${LIBS_PREBUILT_DIR}/include/tinyexr) diff --git a/indra/cmake/TinyGLTF.cmake b/indra/cmake/TinyGLTF.cmake index 7e74089208..92b2de309f 100644 --- a/indra/cmake/TinyGLTF.cmake +++ b/indra/cmake/TinyGLTF.cmake @@ -1,9 +1,7 @@ # -*- cmake -*- include(Prebuilt) -if (NOT USESYSTEMLIBS) use_prebuilt_binary(tinygltf) -endif (NOT USESYSTEMLIBS) set(TINYGLTF_INCLUDE_DIR ${LIBS_PREBUILT_DIR}/include/tinygltf) -- cgit v1.2.3