summaryrefslogtreecommitdiff
path: root/indra/cmake/FMODSTUDIO.cmake
diff options
context:
space:
mode:
authorMnikolenko Productengine <mnikolenko@productengine.com>2022-11-22 23:11:29 +0200
committerMnikolenko Productengine <mnikolenko@productengine.com>2022-11-22 23:12:05 +0200
commitde0317cc3f5f42ccf51a7bbfdd04e8b16d51e811 (patch)
tree36b368602ac3aa1bdf9df97a0fb65c92767f457f /indra/cmake/FMODSTUDIO.cmake
parentdaa1257466ee3cf000e2c94ef05259577ea513b4 (diff)
parent395a60a83e954e9bcbb44dc6f1a49319b2d628b7 (diff)
Merge branch 'DRTVWR-568' into DRTVWR-539
Diffstat (limited to 'indra/cmake/FMODSTUDIO.cmake')
-rw-r--r--indra/cmake/FMODSTUDIO.cmake40
1 files changed, 25 insertions, 15 deletions
diff --git a/indra/cmake/FMODSTUDIO.cmake b/indra/cmake/FMODSTUDIO.cmake
index 8840354ac6..c5b21ac4e5 100644
--- a/indra/cmake/FMODSTUDIO.cmake
+++ b/indra/cmake/FMODSTUDIO.cmake
@@ -1,16 +1,30 @@
# -*- cmake -*-
+include_guard()
+
# FMODSTUDIO can be set when launching the make using the argument -DFMODSTUDIO:BOOL=ON
# When building using proprietary binaries though (i.e. having access to LL private servers),
# we always build with FMODSTUDIO.
if (INSTALL_PROPRIETARY)
- set(FMODSTUDIO ON CACHE BOOL "Using FMODSTUDIO sound library.")
+ set(USE_FMODSTUDIO ON CACHE BOOL "Using FMODSTUDIO sound library.")
endif (INSTALL_PROPRIETARY)
-if (FMODSTUDIO)
+# ND: To streamline arguments passed, switch from FMODSTUDIO to USE_FMODSTUDIO
+# To not break all old build scripts convert old arguments but warn about it
+if(FMODSTUDIO)
+ message( WARNING "Use of the FMODSTUDIO argument is deprecated, please switch to USE_FMODSTUDIO")
+ set(USE_FMODSTUDIO ${FMODSTUDIO})
+endif()
+
+if (USE_FMODSTUDIO)
+ add_library( ll::fmodstudio INTERFACE IMPORTED )
+ target_compile_definitions( ll::fmodstudio INTERFACE LL_FMODSTUDIO=1)
+
if (FMODSTUDIO_LIBRARY AND FMODSTUDIO_INCLUDE_DIR)
# If the path have been specified in the arguments, use that
- set(FMODSTUDIO_LIBRARIES ${FMODSTUDIO_LIBRARY})
+
+ target_link_libraries(ll::fmodstudio INTERFACE ${FMODSTUDIO_LIBRARY})
+ target_include_directories( ll::fmodstudio SYSTEM INTERFACE ${FMODSTUDIO_INCLUDE_DIR})
else (FMODSTUDIO_LIBRARY AND FMODSTUDIO_INCLUDE_DIR)
# If not, we're going to try to get the package listed in autobuild.xml
# Note: if you're not using INSTALL_PROPRIETARY, the package URL should be local (file:/// URL)
@@ -18,21 +32,17 @@ if (FMODSTUDIO)
include(Prebuilt)
use_prebuilt_binary(fmodstudio)
if (WINDOWS)
- set(FMODSTUDIO_LIBRARY
- debug fmodL_vc
- optimized fmod_vc)
+ target_link_libraries( ll::fmodstudio INTERFACE fmod_vc)
elseif (DARWIN)
#despite files being called libfmod.dylib, we are searching for fmod
- set(FMODSTUDIO_LIBRARY
- debug fmodL
- optimized fmod)
+ target_link_libraries( ll::fmodstudio INTERFACE fmod)
elseif (LINUX)
- set(FMODSTUDIO_LIBRARY
- debug fmodL
- optimized fmod)
+ target_link_libraries( ll::fmodstudio INTERFACE fmod)
endif (WINDOWS)
- set(FMODSTUDIO_LIBRARIES ${FMODSTUDIO_LIBRARY})
- set(FMODSTUDIO_INCLUDE_DIR ${LIBS_PREBUILT_DIR}/include/fmodstudio)
+
+ target_include_directories( ll::fmodstudio SYSTEM INTERFACE ${LIBS_PREBUILT_DIR}/include/fmodstudio)
endif (FMODSTUDIO_LIBRARY AND FMODSTUDIO_INCLUDE_DIR)
-endif (FMODSTUDIO)
+else()
+ set( USE_FMODSTUDIO "OFF")
+endif ()