From 786b291d9c6b784c7ce6ceef0e38a4ec76ea14db Mon Sep 17 00:00:00 2001 From: Nicky Date: Wed, 6 Apr 2022 16:32:52 +0200 Subject: Move CMake files to modernized cmake syntax, step 1. Change projects to cmake targetsto get rid of havig to hardcore include directories and link libraries in consumer projects. --- indra/llaudio/CMakeLists.txt | 48 +++++++++++++------------------------------- 1 file changed, 14 insertions(+), 34 deletions(-) (limited to 'indra/llaudio/CMakeLists.txt') diff --git a/indra/llaudio/CMakeLists.txt b/indra/llaudio/CMakeLists.txt index 92a5cfe22f..16576ddbad 100644 --- a/indra/llaudio/CMakeLists.txt +++ b/indra/llaudio/CMakeLists.txt @@ -7,23 +7,6 @@ include(LLAudio) include(FMODSTUDIO) include(OPENAL) include(LLCommon) -include(LLMath) -include(LLMessage) -include(LLFileSystem) - -include_directories( - ${LLAUDIO_INCLUDE_DIRS} - ${LLCOMMON_INCLUDE_DIRS} - ${LLMATH_INCLUDE_DIRS} - ${LLMESSAGE_INCLUDE_DIRS} - ${LLFILESYSTEM_INCLUDE_DIRS} - ${OGG_INCLUDE_DIRS} - ${VORBISENC_INCLUDE_DIRS} - ${VORBISFILE_INCLUDE_DIRS} - ${VORBIS_INCLUDE_DIRS} - ${OPENAL_LIB_INCLUDE_DIRS} - ${FREEAULT_LIB_INCLUDE_DIRS} - ) set(llaudio_SOURCE_FILES llaudioengine.cpp @@ -43,9 +26,6 @@ set(llaudio_HEADER_FILES ) if (FMODSTUDIO) - include_directories( - ${FMODSTUDIO_INCLUDE_DIR} - ) list(APPEND llaudio_SOURCE_FILES llaudioengine_fmodstudio.cpp lllistener_fmodstudio.cpp @@ -60,10 +40,6 @@ if (FMODSTUDIO) endif (FMODSTUDIO) if (OPENAL) - include_directories( - ${OPENAL_LIBRARIES} - ) - list(APPEND llaudio_SOURCE_FILES llaudioengine_openal.cpp lllistener_openal.cpp @@ -81,14 +57,18 @@ set_source_files_properties(${llaudio_HEADER_FILES} list(APPEND llaudio_SOURCE_FILES ${llaudio_HEADER_FILES}) add_library (llaudio ${llaudio_SOURCE_FILES}) -target_link_libraries( - llaudio - ${LLCOMMON_LIBRARIES} - ${LLMATH_LIBRARIES} - ${LLMESSAGE_LIBRARIES} - ${LLFILESYSTEM_LIBRARIES} - ${VORBISENC_LIBRARIES} - ${VORBISFILE_LIBRARIES} - ${VORBIS_LIBRARIES} - ${OGG_LIBRARIES} +set_target_include_dirs( llaudio ${CMAKE_CURRENT_SOURCE_DIR}) +target_link_libraries( llaudio + llcommon + llmath + llmessage + llfilesystem + vorbis::vorbis ) + +if( TARGET openal::openal ) + target_link_libraries( llaudio openal::openal ) +endif() +if( TARGET fmodstudio::fmodstudio ) + target_link_libraries( llaudio fmodstudio::fmodstudio ) +endif() \ No newline at end of file -- cgit v1.2.3