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') 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 From 241919e7f7986c11586a49bff53cf19c2c0e0ea6 Mon Sep 17 00:00:00 2001 From: Nicky Date: Wed, 13 Apr 2022 19:21:55 +0200 Subject: Rework cmake, the original plan was to maybe be able to use conan targets with the same name (that's why 3ps had names like apr::apr), but it's safer and saner to put the LL 3ps under the ll:: prefix. This also allows means it is possible to get rid of that bad "if( TRAGET ...) return() endif()" pattern and rather use include_guard(). --- indra/llaudio/CMakeLists.txt | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'indra/llaudio') diff --git a/indra/llaudio/CMakeLists.txt b/indra/llaudio/CMakeLists.txt index 16576ddbad..21e4723e7e 100644 --- a/indra/llaudio/CMakeLists.txt +++ b/indra/llaudio/CMakeLists.txt @@ -63,12 +63,12 @@ target_link_libraries( llaudio llmath llmessage llfilesystem - vorbis::vorbis + ll::vorbis ) -if( TARGET openal::openal ) - target_link_libraries( llaudio openal::openal ) +if( TARGET ll::openal ) + target_link_libraries( llaudio ll::openal ) endif() -if( TARGET fmodstudio::fmodstudio ) - target_link_libraries( llaudio fmodstudio::fmodstudio ) +if( TARGET ll::fmodstudio ) + target_link_libraries( llaudio ll::fmodstudio ) endif() \ No newline at end of file -- cgit v1.2.3 From a950940adb1508908313253a9e5118801b2f6d89 Mon Sep 17 00:00:00 2001 From: Nicky Date: Sat, 16 Apr 2022 22:57:09 +0200 Subject: Streamline fmodstudio/openal targets: - Targets now define the appropriate c++ defines, no more hand magic needed for llstartup.cpp - Switch cmakeflage to USE_xxx rather than xxx as it was before. I personally find the USE_X notion more intuitive and it follows how KDU is used. - To be backward compatible OPENAL/FMODSTUDIO flag will be mapped to USE_OPENAL/USE_FMODSTUDIO --- indra/llaudio/CMakeLists.txt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'indra/llaudio') diff --git a/indra/llaudio/CMakeLists.txt b/indra/llaudio/CMakeLists.txt index 21e4723e7e..220b6d8cfb 100644 --- a/indra/llaudio/CMakeLists.txt +++ b/indra/llaudio/CMakeLists.txt @@ -25,7 +25,7 @@ set(llaudio_HEADER_FILES llwindgen.h ) -if (FMODSTUDIO) +if (TARGET ll::fmodstudio) list(APPEND llaudio_SOURCE_FILES llaudioengine_fmodstudio.cpp lllistener_fmodstudio.cpp @@ -37,9 +37,9 @@ if (FMODSTUDIO) lllistener_fmodstudio.h llstreamingaudio_fmodstudio.h ) -endif (FMODSTUDIO) +endif () -if (OPENAL) +if (TARGET ll::openal) list(APPEND llaudio_SOURCE_FILES llaudioengine_openal.cpp lllistener_openal.cpp @@ -49,7 +49,7 @@ if (OPENAL) llaudioengine_openal.h lllistener_openal.h ) -endif (OPENAL) +endif () set_source_files_properties(${llaudio_HEADER_FILES} PROPERTIES HEADER_FILE_ONLY TRUE) -- cgit v1.2.3 From e0cf0cdfd49e5a946dcd202a083fb23f01e4f1fe Mon Sep 17 00:00:00 2001 From: Nicky Date: Sun, 17 Apr 2022 18:04:57 +0200 Subject: Switch to target_include_directories All 3Ps include dirs are treated as SYSTEM, this will stop compilers stop emitting warnings from those files and greatly helps having high warning levels and not being swamped by warnings that come from external libraries. --- indra/llaudio/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/llaudio') diff --git a/indra/llaudio/CMakeLists.txt b/indra/llaudio/CMakeLists.txt index 220b6d8cfb..b2b479b36f 100644 --- a/indra/llaudio/CMakeLists.txt +++ b/indra/llaudio/CMakeLists.txt @@ -57,7 +57,7 @@ set_source_files_properties(${llaudio_HEADER_FILES} list(APPEND llaudio_SOURCE_FILES ${llaudio_HEADER_FILES}) add_library (llaudio ${llaudio_SOURCE_FILES}) -set_target_include_dirs( llaudio ${CMAKE_CURRENT_SOURCE_DIR}) +target_include_directories( llaudio INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}) target_link_libraries( llaudio llcommon llmath -- cgit v1.2.3 From 283c2a20cc4ef856076d287303c7143332b201fe Mon Sep 17 00:00:00 2001 From: Nicky Date: Sun, 1 May 2022 00:38:40 +0200 Subject: Remove setting of HEADER_FILE_ONLY on .h* files, cmake automatically sets the property on those. --- indra/llaudio/CMakeLists.txt | 3 --- 1 file changed, 3 deletions(-) (limited to 'indra/llaudio') diff --git a/indra/llaudio/CMakeLists.txt b/indra/llaudio/CMakeLists.txt index b2b479b36f..d6846ddf99 100644 --- a/indra/llaudio/CMakeLists.txt +++ b/indra/llaudio/CMakeLists.txt @@ -51,9 +51,6 @@ if (TARGET ll::openal) ) endif () -set_source_files_properties(${llaudio_HEADER_FILES} - PROPERTIES HEADER_FILE_ONLY TRUE) - list(APPEND llaudio_SOURCE_FILES ${llaudio_HEADER_FILES}) add_library (llaudio ${llaudio_SOURCE_FILES}) -- cgit v1.2.3 From c7366f4c55c6442414eb6c5a6736baf90f1a4700 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Sat, 17 Sep 2022 02:09:04 +0300 Subject: SL-17238 Fix coding policy build issues --- indra/llaudio/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/llaudio') diff --git a/indra/llaudio/CMakeLists.txt b/indra/llaudio/CMakeLists.txt index d6846ddf99..4f469b9bb5 100644 --- a/indra/llaudio/CMakeLists.txt +++ b/indra/llaudio/CMakeLists.txt @@ -68,4 +68,4 @@ if( TARGET ll::openal ) endif() if( TARGET ll::fmodstudio ) target_link_libraries( llaudio ll::fmodstudio ) -endif() \ No newline at end of file +endif() -- cgit v1.2.3