summaryrefslogtreecommitdiff
path: root/indra/cmake
diff options
context:
space:
mode:
authorErik Kundiman <erik@megapahit.org>2024-08-09 14:18:14 +0800
committerErik Kundiman <erik@megapahit.org>2024-08-09 14:18:14 +0800
commit43d43c79d0254b8b27f2386f67335e5f3dc5d24f (patch)
treeb9063c72fa5f7a0cf8b14f55ce1180130a0ff96e /indra/cmake
parentb89076f0567547b9c2749595af5ae9d5f9de9f3a (diff)
parent7c716d6d516f99628655352a0e679455263924e2 (diff)
Merge branch 'main' into webrtc-voice
Diffstat (limited to 'indra/cmake')
-rw-r--r--indra/cmake/FMODSTUDIO.cmake62
-rw-r--r--indra/cmake/GLH.cmake8
-rw-r--r--indra/cmake/LibVLCPlugin.cmake27
-rw-r--r--indra/cmake/Mikktspace.cmake2
-rw-r--r--indra/cmake/Prebuilt.cmake35
-rw-r--r--indra/cmake/TinyEXR.cmake2
-rw-r--r--indra/cmake/TinyGLTF.cmake2
-rw-r--r--indra/cmake/ViewerMiscLibs.cmake14
8 files changed, 121 insertions, 31 deletions
diff --git a/indra/cmake/FMODSTUDIO.cmake b/indra/cmake/FMODSTUDIO.cmake
index 38437b7bfb..39636d7522 100644
--- a/indra/cmake/FMODSTUDIO.cmake
+++ b/indra/cmake/FMODSTUDIO.cmake
@@ -30,9 +30,65 @@ 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
+ ${AUTOBUILD_INSTALL_DIR}/lib/release
+ )
+ 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
+ )
+ 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)
- endif ()
+ endif (USESYSTEMLIBS)
if (WINDOWS)
target_link_libraries( ll::fmodstudio INTERFACE fmod_vc)
elseif (DARWIN)
@@ -42,9 +98,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")
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/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
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 b0acae279b..9125864c1d 100644
--- a/indra/cmake/Prebuilt.cmake
+++ b/indra/cmake/Prebuilt.cmake
@@ -40,6 +40,40 @@ 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)
+ 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
+ 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 +81,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)
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)
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)