From f5ab6e11f13699c03a696611f67f8384434130a1 Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Tue, 13 May 2025 10:22:54 +0800 Subject: Not rely on (LL_)USESYSTEMLIBS macro & CMake setting but the fact that we keep on using as many system libraries as we can (and only resort to other sources in certain cases), hasn't changed, of course. Also stop having to set USE_AUTOBUILD_3P to OFF. Lines are reindented, and when a system library can be found for a dependency, then that should be the way. If later we find out that using some other way is better, than stick to that. So, one option at a time, whichever is best for the situation. GLEXT hasn't been used, and in order to be not having to hack its .cmake file, we bypass it and refer to GLH (which is still used) right away in LLWindow. CMake commands that need to be bypassed, if it's a one-liner then it's just commented out, but if it's multiple lines, then scope them with if (FALSE) to minimise difference. --- indra/cmake/LibVLCPlugin.cmake | 77 +++++++++++++++++------------------------- 1 file changed, 31 insertions(+), 46 deletions(-) (limited to 'indra/cmake/LibVLCPlugin.cmake') diff --git a/indra/cmake/LibVLCPlugin.cmake b/indra/cmake/LibVLCPlugin.cmake index 779576a485..5ed77af0c2 100644 --- a/indra/cmake/LibVLCPlugin.cmake +++ b/indra/cmake/LibVLCPlugin.cmake @@ -5,56 +5,41 @@ include(Prebuilt) include_guard() add_library( ll::libvlc INTERFACE IMPORTED ) -if (USESYSTEMLIBS) - if (DARWIN) - if (CMAKE_OSX_ARCHITECTURES MATCHES arm64) - if (${PREBUILD_TRACKING_DIR}/sentinel_installed IS_NEWER_THAN ${PREBUILD_TRACKING_DIR}/vlc_installed OR NOT ${vlc_installed} EQUAL 0) - if (NOT EXISTS ${CMAKE_BINARY_DIR}/vlc-3.0.21-arm64.dmg) - file(DOWNLOAD - https://get.videolan.org/vlc/3.0.21/macosx/vlc-3.0.21-arm64.dmg - ${CMAKE_BINARY_DIR}/vlc-3.0.21-arm64.dmg - ) - endif (NOT EXISTS ${CMAKE_BINARY_DIR}/vlc-3.0.21-arm64.dmg) - file(WRITE ${PREBUILD_TRACKING_DIR}/vlc_installed "0") - endif (${PREBUILD_TRACKING_DIR}/sentinel_installed IS_NEWER_THAN ${PREBUILD_TRACKING_DIR}/vlc_installed OR NOT ${vlc_installed} EQUAL 0) - execute_process( - COMMAND hdiutil attach -noverify vlc-3.0.21-arm64.dmg - WORKING_DIRECTORY ${CMAKE_BINARY_DIR} +if (DARWIN) + if (CMAKE_OSX_ARCHITECTURES MATCHES x86_64) + set(ARCHITECTURE intel64) + else () + set(ARCHITECTURE ${CMAKE_OSX_ARCHITECTURES}) + endif () + if (${PREBUILD_TRACKING_DIR}/sentinel_installed IS_NEWER_THAN ${PREBUILD_TRACKING_DIR}/vlc_installed OR NOT ${vlc_installed} EQUAL 0) + if (NOT EXISTS ${CMAKE_BINARY_DIR}/vlc-3.0.21-${ARCHITECTURE}.dmg) + file(DOWNLOAD + https://get.videolan.org/vlc/3.0.21/macosx/vlc-3.0.21-${ARCHITECTURE}.dmg + ${CMAKE_BINARY_DIR}/vlc-3.0.21-${ARCHITECTURE}.dmg ) - else (CMAKE_OSX_ARCHITECTURES MATCHES arm64) - if (${PREBUILD_TRACKING_DIR}/sentinel_installed IS_NEWER_THAN ${PREBUILD_TRACKING_DIR}/vlc_installed OR NOT ${vlc_installed} EQUAL 0) - if (NOT EXISTS ${CMAKE_BINARY_DIR}/vlc-3.0.21-intel64.dmg) - file(DOWNLOAD - https://get.videolan.org/vlc/3.0.21/macosx/vlc-3.0.21-intel64.dmg - ${CMAKE_BINARY_DIR}/vlc-3.0.21-intel64.dmg - ) - endif (NOT EXISTS ${CMAKE_BINARY_DIR}/vlc-3.0.21-intel64.dmg) - file(WRITE ${PREBUILD_TRACKING_DIR}/vlc_installed "0") - endif (${PREBUILD_TRACKING_DIR}/sentinel_installed IS_NEWER_THAN ${PREBUILD_TRACKING_DIR}/vlc_installed OR NOT ${vlc_installed} EQUAL 0) - execute_process( - COMMAND hdiutil attach -noverify vlc-3.0.21-intel64.dmg - WORKING_DIRECTORY ${CMAKE_BINARY_DIR} - ) - endif (CMAKE_OSX_ARCHITECTURES MATCHES arm64) - 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 (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 (DARWIN) - set(LIBVLCPLUGIN ON CACHE BOOL - "LIBVLCPLUGIN support for the llplugin/llmedia test apps.") - return() -else (USESYSTEMLIBS) + endif () + file(WRITE ${PREBUILD_TRACKING_DIR}/vlc_installed "0") + endif () + execute_process( + COMMAND hdiutil attach -noverify vlc-3.0.21-${ARCHITECTURE}.dmg + WORKING_DIRECTORY ${CMAKE_BINARY_DIR} + ) + 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 () + 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 () -use_prebuilt_binary(vlc-bin) +#use_prebuilt_binary(vlc-bin) set(LIBVLCPLUGIN ON CACHE BOOL "LIBVLCPLUGIN support for the llplugin/llmedia test apps.") -endif (USESYSTEMLIBS) + +return() if (WINDOWS) target_link_libraries( ll::libvlc INTERFACE -- cgit v1.2.3