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/media_plugins/base/CMakeLists.txt | 20 ++---------- indra/media_plugins/cef/CMakeLists.txt | 30 +++-------------- indra/media_plugins/example/CMakeLists.txt | 35 +------------------- indra/media_plugins/gstreamer010/CMakeLists.txt | 30 ++--------------- indra/media_plugins/libvlc/CMakeLists.txt | 43 ++----------------------- 5 files changed, 12 insertions(+), 146 deletions(-) (limited to 'indra/media_plugins') diff --git a/indra/media_plugins/base/CMakeLists.txt b/indra/media_plugins/base/CMakeLists.txt index 7f2b82ffdd..9da249bd27 100644 --- a/indra/media_plugins/base/CMakeLists.txt +++ b/indra/media_plugins/base/CMakeLists.txt @@ -5,25 +5,9 @@ project(media_plugin_base) include(00-Common) include(LLCommon) include(LLImage) -include(LLPlugin) -include(LLMath) -include(LLRender) include(LLWindow) include(Linking) include(PluginAPI) -include(OpenGL) - -include_directories( - ${LLPLUGIN_INCLUDE_DIRS} - ${LLCOMMON_INCLUDE_DIRS} - ${LLMATH_INCLUDE_DIRS} - ${LLIMAGE_INCLUDE_DIRS} - ${LLRENDER_INCLUDE_DIRS} - ${LLWINDOW_INCLUDE_DIRS} -) -include_directories(SYSTEM - ${LLCOMMON_SYSTEM_INCLUDE_DIRS} - ) ### media_plugin_base @@ -48,5 +32,7 @@ set(media_plugin_base_HEADER_FILES add_library(media_plugin_base ${media_plugin_base_SOURCE_FILES} - ) + ) +target_link_libraries( media_plugin_base llplugin ) +set_target_include_dirs(media_plugin_base ${CMAKE_CURRENT_SOURCE_DIR}) diff --git a/indra/media_plugins/cef/CMakeLists.txt b/indra/media_plugins/cef/CMakeLists.txt index 854ba55731..8d14714020 100644 --- a/indra/media_plugins/cef/CMakeLists.txt +++ b/indra/media_plugins/cef/CMakeLists.txt @@ -5,29 +5,12 @@ project(media_plugin_cef) include(Boost) include(00-Common) include(LLCommon) -include(LLPlugin) -include(LLMath) -include(LLRender) include(LLWindow) include(Linking) include(PluginAPI) -include(MediaPluginBase) include(CEFPlugin) -include_directories( - ${LLPLUGIN_INCLUDE_DIRS} - ${MEDIA_PLUGIN_BASE_INCLUDE_DIRS} - ${LLCOMMON_INCLUDE_DIRS} - ${LLMATH_INCLUDE_DIRS} - ${LLRENDER_INCLUDE_DIRS} - ${LLWINDOW_INCLUDE_DIRS} - ${CEF_INCLUDE_DIR} -) -include_directories(SYSTEM - ${LLCOMMON_SYSTEM_INCLUDE_DIRS} - ) - ### media_plugin_cef @@ -47,13 +30,6 @@ set(media_plugin_cef_HEADER_FILES volume_catcher.h ) -set (media_plugin_cef_LINK_LIBRARIES - ${LLPLUGIN_LIBRARIES} - ${MEDIA_PLUGIN_BASE_LIBRARIES} - ${CEF_PLUGIN_LIBRARIES} - ${LLCOMMON_LIBRARIES} - ${PLUGIN_API_WINDOWS_LIBRARIES}) - # Select which VolumeCatcher implementation to use if (LINUX) message(FATAL_ERROR "CEF plugin has been enabled for a Linux compile.\n" @@ -62,7 +38,7 @@ elseif (DARWIN) list(APPEND media_plugin_cef_SOURCE_FILES mac_volume_catcher_null.cpp) find_library(CORESERVICES_LIBRARY CoreServices) find_library(AUDIOUNIT_LIBRARY AudioUnit) - list(APPEND media_plugin_cef_LINK_LIBRARIES + set( media_plugin_cef_LINK_LIBRARIES ${CORESERVICES_LIBRARY} # for Component Manager calls ${AUDIOUNIT_LIBRARY} # for AudioUnit calls ) @@ -85,7 +61,9 @@ add_library(media_plugin_cef #) target_link_libraries(media_plugin_cef - ${media_plugin_cef_LINK_LIBRARIES} + media_plugin_base + cef::cef + ${media_plugin_cef_LINK_LIBRARIES} ) if (WINDOWS) diff --git a/indra/media_plugins/example/CMakeLists.txt b/indra/media_plugins/example/CMakeLists.txt index eb067a7f6e..7d3e7f663b 100644 --- a/indra/media_plugins/example/CMakeLists.txt +++ b/indra/media_plugins/example/CMakeLists.txt @@ -5,31 +5,12 @@ project(media_plugin_example) include(00-Common) include(LLCommon) include(LLImage) -include(LLPlugin) -include(LLMath) -include(LLRender) include(LLWindow) include(Linking) include(PluginAPI) -include(MediaPluginBase) -include(OpenGL) include(ExamplePlugin) -include_directories( - ${LLPLUGIN_INCLUDE_DIRS} - ${MEDIA_PLUGIN_BASE_INCLUDE_DIRS} - ${LLCOMMON_INCLUDE_DIRS} - ${LLMATH_INCLUDE_DIRS} - ${LLIMAGE_INCLUDE_DIRS} - ${LLRENDER_INCLUDE_DIRS} - ${LLWINDOW_INCLUDE_DIRS} -) -include_directories(SYSTEM - ${LLCOMMON_SYSTEM_INCLUDE_DIRS} - ) - - ### media_plugin_example if(NOT ADDRESS_SIZE EQUAL 32) @@ -49,21 +30,7 @@ add_library(media_plugin_example ${media_plugin_example_SOURCE_FILES} ) -target_link_libraries(media_plugin_example - ${LLPLUGIN_LIBRARIES} - ${MEDIA_PLUGIN_BASE_LIBRARIES} - ${LLCOMMON_LIBRARIES} - ${EXAMPLE_PLUGIN_LIBRARIES} - ${PLUGIN_API_WINDOWS_LIBRARIES} -) - -add_dependencies(media_plugin_example - ${LLPLUGIN_LIBRARIES} - ${MEDIA_PLUGIN_BASE_LIBRARIES} - # Using ${LLCOMMON_LIBRARIES} here drags in a whole bunch of Boost stuff - # that only produces CMake warnings about nonexistent dependencies. - llcommon -) +target_link_libraries(media_plugin_example media_plugin_base ) if (WINDOWS) set_target_properties( diff --git a/indra/media_plugins/gstreamer010/CMakeLists.txt b/indra/media_plugins/gstreamer010/CMakeLists.txt index 571eb57b24..c66b5d0d2e 100644 --- a/indra/media_plugins/gstreamer010/CMakeLists.txt +++ b/indra/media_plugins/gstreamer010/CMakeLists.txt @@ -16,20 +16,6 @@ include(OpenGL) include(GStreamer010Plugin) -include_directories( - ${LLPLUGIN_INCLUDE_DIRS} - ${MEDIA_PLUGIN_BASE_INCLUDE_DIRS} - ${LLCOMMON_INCLUDE_DIRS} - ${LLMATH_INCLUDE_DIRS} - ${LLIMAGE_INCLUDE_DIRS} - ${LLRENDER_INCLUDE_DIRS} - ${LLWINDOW_INCLUDE_DIRS} - ${GSTREAMER010_INCLUDE_DIRS} - ${GSTREAMER010_PLUGINS_BASE_INCLUDE_DIRS} -) -include_directories(SYSTEM - ${LLCOMMON_SYSTEM_INCLUDE_DIRS} - ) ### media_plugin_gstreamer010 @@ -59,17 +45,5 @@ add_library(media_plugin_gstreamer010 ) target_link_libraries(media_plugin_gstreamer010 - ${LLPLUGIN_LIBRARIES} - ${MEDIA_PLUGIN_BASE_LIBRARIES} - ${LLCOMMON_LIBRARIES} - ${PLUGIN_API_WINDOWS_LIBRARIES} - ${GSTREAMER010_LIBRARIES} -) - -add_dependencies(media_plugin_gstreamer010 - ${LLPLUGIN_LIBRARIES} - ${MEDIA_PLUGIN_BASE_LIBRARIES} - ${LLCOMMON_LIBRARIES} -) - - + media_plugin_base + ) diff --git a/indra/media_plugins/libvlc/CMakeLists.txt b/indra/media_plugins/libvlc/CMakeLists.txt index 97392bbe08..cae1c4f92b 100644 --- a/indra/media_plugins/libvlc/CMakeLists.txt +++ b/indra/media_plugins/libvlc/CMakeLists.txt @@ -5,32 +5,12 @@ project(media_plugin_libvlc) include(00-Common) include(LLCommon) include(LLImage) -include(LLPlugin) -include(LLMath) -include(LLRender) include(LLWindow) include(Linking) include(PluginAPI) -include(MediaPluginBase) -include(OpenGL) include(LibVLCPlugin) -include_directories( - ${LLPLUGIN_INCLUDE_DIRS} - ${MEDIA_PLUGIN_BASE_INCLUDE_DIRS} - ${LLCOMMON_INCLUDE_DIRS} - ${LLMATH_INCLUDE_DIRS} - ${LLIMAGE_INCLUDE_DIRS} - ${LLRENDER_INCLUDE_DIRS} - ${LLWINDOW_INCLUDE_DIRS} - ${VLC_INCLUDE_DIR} -) -include_directories(SYSTEM - ${LLCOMMON_SYSTEM_INCLUDE_DIRS} - ) - - ### media_plugin_libvlc if(NOT ADDRESS_SIZE EQUAL 32) @@ -51,27 +31,8 @@ add_library(media_plugin_libvlc ) target_link_libraries(media_plugin_libvlc - ${LLPLUGIN_LIBRARIES} - ${MEDIA_PLUGIN_BASE_LIBRARIES} - ${LLCOMMON_LIBRARIES} - ${VLC_PLUGIN_LIBRARIES} - ${PLUGIN_API_WINDOWS_LIBRARIES} -) - -add_dependencies(media_plugin_libvlc - ${LLPLUGIN_LIBRARIES} - ${MEDIA_PLUGIN_BASE_LIBRARIES} -##${LLCOMMON_LIBRARIES} - # Just say 'llcommon' here. LLCOMMON_LIBRARIES is specified for use in - # target_link_libraries: it includes several Boost libraries, which are - # absolutely NOT dependencies in the sense intended here. Those Boost - # library macros, in turn, specify 'debug' and 'optimized' and a different - # library name for each, producing several wordy errors: - # Policy CMP0046 is not set: Error on non-existent dependency in - # add_dependencies. - # Really, the only dependency we should mention from LLCOMMON_LIBRARIES is - # llcommon itself. - llcommon + media_plugin_base + libvlc::libvlc ) if (WINDOWS) -- cgit v1.2.3 From 2c9ede0ccc3b6a27ca418fcb6e7a91eb87b261e9 Mon Sep 17 00:00:00 2001 From: Nicky Date: Wed, 13 Apr 2022 10:29:10 +0200 Subject: Remove another old remnant of the debug config. --- indra/media_plugins/cef/CMakeLists.txt | 1 - 1 file changed, 1 deletion(-) (limited to 'indra/media_plugins') diff --git a/indra/media_plugins/cef/CMakeLists.txt b/indra/media_plugins/cef/CMakeLists.txt index 8d14714020..94281465e7 100644 --- a/indra/media_plugins/cef/CMakeLists.txt +++ b/indra/media_plugins/cef/CMakeLists.txt @@ -71,7 +71,6 @@ if (WINDOWS) media_plugin_cef PROPERTIES LINK_FLAGS "/MANIFEST:NO /SAFESEH:NO /NODEFAULTLIB:LIBCMT /IGNORE:4099" - LINK_FLAGS_DEBUG "/MANIFEST:NO /SAFESEH:NO /NODEFAULTLIB:LIBCMTD /IGNORE:4099" ) endif (WINDOWS) -- 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/media_plugins/libvlc/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/media_plugins') diff --git a/indra/media_plugins/libvlc/CMakeLists.txt b/indra/media_plugins/libvlc/CMakeLists.txt index cae1c4f92b..a3c1c4ef99 100644 --- a/indra/media_plugins/libvlc/CMakeLists.txt +++ b/indra/media_plugins/libvlc/CMakeLists.txt @@ -32,7 +32,7 @@ add_library(media_plugin_libvlc target_link_libraries(media_plugin_libvlc media_plugin_base - libvlc::libvlc + ll::libvlc ) if (WINDOWS) -- cgit v1.2.3 From 2c3507a9d2a32749df695ee04f7612c3049c86c8 Mon Sep 17 00:00:00 2001 From: Nicky Date: Sat, 16 Apr 2022 19:58:17 +0200 Subject: Cleanup plugin, create proper target for link libraries. Remove unused variables. --- indra/media_plugins/cef/CMakeLists.txt | 1 - 1 file changed, 1 deletion(-) (limited to 'indra/media_plugins') diff --git a/indra/media_plugins/cef/CMakeLists.txt b/indra/media_plugins/cef/CMakeLists.txt index 94281465e7..c4cf292dde 100644 --- a/indra/media_plugins/cef/CMakeLists.txt +++ b/indra/media_plugins/cef/CMakeLists.txt @@ -63,7 +63,6 @@ add_library(media_plugin_cef target_link_libraries(media_plugin_cef media_plugin_base cef::cef - ${media_plugin_cef_LINK_LIBRARIES} ) if (WINDOWS) -- 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/media_plugins/base/CMakeLists.txt | 2 +- indra/media_plugins/cef/CMakeLists.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'indra/media_plugins') diff --git a/indra/media_plugins/base/CMakeLists.txt b/indra/media_plugins/base/CMakeLists.txt index 9da249bd27..64b6a4228d 100644 --- a/indra/media_plugins/base/CMakeLists.txt +++ b/indra/media_plugins/base/CMakeLists.txt @@ -35,4 +35,4 @@ add_library(media_plugin_base ) target_link_libraries( media_plugin_base llplugin ) -set_target_include_dirs(media_plugin_base ${CMAKE_CURRENT_SOURCE_DIR}) +target_include_directories( media_plugin_base INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}) diff --git a/indra/media_plugins/cef/CMakeLists.txt b/indra/media_plugins/cef/CMakeLists.txt index c4cf292dde..ae3092fff4 100644 --- a/indra/media_plugins/cef/CMakeLists.txt +++ b/indra/media_plugins/cef/CMakeLists.txt @@ -62,7 +62,7 @@ add_library(media_plugin_cef target_link_libraries(media_plugin_cef media_plugin_base - cef::cef + ll::cef ) if (WINDOWS) -- cgit v1.2.3 From defdbaf40d7a2621d36df8efa07157f71e91baa5 Mon Sep 17 00:00:00 2001 From: Nicky Date: Mon, 18 Apr 2022 03:12:19 +0200 Subject: Fixup for Linux media plugins. - Remove VLC - Remove missing cmake includes (that got deleted in earlier changes) from gstreamer plugin. --- indra/media_plugins/CMakeLists.txt | 1 - indra/media_plugins/gstreamer010/CMakeLists.txt | 4 ---- 2 files changed, 5 deletions(-) (limited to 'indra/media_plugins') diff --git a/indra/media_plugins/CMakeLists.txt b/indra/media_plugins/CMakeLists.txt index 1a5cc8ec9a..9e24e7acf9 100644 --- a/indra/media_plugins/CMakeLists.txt +++ b/indra/media_plugins/CMakeLists.txt @@ -4,7 +4,6 @@ add_subdirectory(base) if (LINUX) add_subdirectory(gstreamer010) - add_subdirectory(libvlc) add_subdirectory(example) endif (LINUX) diff --git a/indra/media_plugins/gstreamer010/CMakeLists.txt b/indra/media_plugins/gstreamer010/CMakeLists.txt index c66b5d0d2e..3b5debc585 100644 --- a/indra/media_plugins/gstreamer010/CMakeLists.txt +++ b/indra/media_plugins/gstreamer010/CMakeLists.txt @@ -5,18 +5,14 @@ project(media_plugin_gstreamer010) include(00-Common) include(LLCommon) include(LLImage) -include(LLPlugin) include(LLMath) -include(LLRender) include(LLWindow) include(Linking) include(PluginAPI) -include(MediaPluginBase) include(OpenGL) include(GStreamer010Plugin) - ### media_plugin_gstreamer010 if(NOT ADDRESS_SIZE EQUAL 32) -- cgit v1.2.3 From 2b151e0aefd54671e1be504269f10318d303dccb Mon Sep 17 00:00:00 2001 From: Nicky Date: Mon, 18 Apr 2022 18:11:43 +0200 Subject: Round one to support conan for 3P packages, this allows to build the viewer on Linux again. --- indra/media_plugins/CMakeLists.txt | 2 +- indra/media_plugins/gstreamer010/CMakeLists.txt | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) (limited to 'indra/media_plugins') diff --git a/indra/media_plugins/CMakeLists.txt b/indra/media_plugins/CMakeLists.txt index 9e24e7acf9..972bb7dd2d 100644 --- a/indra/media_plugins/CMakeLists.txt +++ b/indra/media_plugins/CMakeLists.txt @@ -3,7 +3,7 @@ add_subdirectory(base) if (LINUX) - add_subdirectory(gstreamer010) + #add_subdirectory(gstreamer010) add_subdirectory(example) endif (LINUX) diff --git a/indra/media_plugins/gstreamer010/CMakeLists.txt b/indra/media_plugins/gstreamer010/CMakeLists.txt index 3b5debc585..38fc8201bf 100644 --- a/indra/media_plugins/gstreamer010/CMakeLists.txt +++ b/indra/media_plugins/gstreamer010/CMakeLists.txt @@ -42,4 +42,5 @@ add_library(media_plugin_gstreamer010 target_link_libraries(media_plugin_gstreamer010 media_plugin_base + ll::gstreamer ) -- 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/media_plugins/cef/CMakeLists.txt | 3 --- 1 file changed, 3 deletions(-) (limited to 'indra/media_plugins') diff --git a/indra/media_plugins/cef/CMakeLists.txt b/indra/media_plugins/cef/CMakeLists.txt index ae3092fff4..d8ae099eca 100644 --- a/indra/media_plugins/cef/CMakeLists.txt +++ b/indra/media_plugins/cef/CMakeLists.txt @@ -46,9 +46,6 @@ elseif (WINDOWS) list(APPEND media_plugin_cef_SOURCE_FILES windows_volume_catcher.cpp) endif (LINUX) -set_source_files_properties(${media_plugin_cef_HEADER_FILES} - PROPERTIES HEADER_FILE_ONLY TRUE) - list(APPEND media_plugin_cef_SOURCE_FILES ${media_plugin_cef_HEADER_FILES}) add_library(media_plugin_cef -- cgit v1.2.3