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/llplugin/CMakeLists.txt | 22 ++-------------------- indra/llplugin/slplugin/CMakeLists.txt | 19 ++++--------------- 2 files changed, 6 insertions(+), 35 deletions(-) (limited to 'indra/llplugin') diff --git a/indra/llplugin/CMakeLists.txt b/indra/llplugin/CMakeLists.txt index 5cc129a267..872d62a2bb 100644 --- a/indra/llplugin/CMakeLists.txt +++ b/indra/llplugin/CMakeLists.txt @@ -6,26 +6,7 @@ include(00-Common) include(CURL) include(LLCommon) include(LLImage) -include(LLMath) -include(LLMessage) -include(LLRender) -include(LLXML) include(LLWindow) -include(Boost) - -include_directories( - ${LLCOMMON_INCLUDE_DIRS} - ${LLIMAGE_INCLUDE_DIRS} - ${LLMATH_INCLUDE_DIRS} - ${LLMESSAGE_INCLUDE_DIRS} - ${LLRENDER_INCLUDE_DIRS} - ${LLXML_INCLUDE_DIRS} - ${LLWINDOW_INCLUDE_DIRS} - ) -include_directories(SYSTEM - ${LLCOMMON_SYSTEM_INCLUDE_DIRS} - ${LLXML_SYSTEM_INCLUDE_DIRS} - ) set(llplugin_SOURCE_FILES llpluginclassmedia.cpp @@ -65,6 +46,7 @@ endif(NOT ADDRESS_SIZE EQUAL 32) list(APPEND llplugin_SOURCE_FILES ${llplugin_HEADER_FILES}) add_library (llplugin ${llplugin_SOURCE_FILES}) - +set_target_include_dirs(llplugin ${CMAKE_CURRENT_SOURCE_DIR}) +target_link_libraries( llplugin llcommon llmath llrender llmessage ) add_subdirectory(slplugin) diff --git a/indra/llplugin/slplugin/CMakeLists.txt b/indra/llplugin/slplugin/CMakeLists.txt index e4f64448c5..7725489c3e 100644 --- a/indra/llplugin/slplugin/CMakeLists.txt +++ b/indra/llplugin/slplugin/CMakeLists.txt @@ -2,19 +2,8 @@ project(SLPlugin) include(00-Common) include(LLCommon) -include(LLPlugin) include(Linking) include(PluginAPI) -include(LLMessage) - -include_directories( - ${LLPLUGIN_INCLUDE_DIRS} - ${LLMESSAGE_INCLUDE_DIRS} - ${LLCOMMON_INCLUDE_DIRS} -) -include_directories(SYSTEM - ${LLCOMMON_SYSTEM_INCLUDE_DIRS} - ) if (DARWIN) include(CMakeFindFrameworks) @@ -63,10 +52,10 @@ set_target_properties(SLPlugin endif () target_link_libraries(SLPlugin - ${LEGACY_STDIO_LIBS} - ${LLPLUGIN_LIBRARIES} - ${LLMESSAGE_LIBRARIES} - ${LLCOMMON_LIBRARIES} + ${LEGACY_STDIO_LIBS} + llplugin + llmessage + llcommon ${PLUGIN_API_WINDOWS_LIBRARIES} ) -- cgit v1.2.3 From bb85651d987a6cb969de7dd7c2b130411de6203c Mon Sep 17 00:00:00 2001 From: Nicky Date: Sat, 16 Apr 2022 15:29:02 +0200 Subject: Create a new target ll::oslibrary to link against libs specific to the OS compiled on. This gets rid of the a few OS specific set and uses variables (which some even seemed mostly duplicate like WINDOWS_LIBRARIES ans UI_LIBRARIES) and it also solves the problem of having them to tack on every target, as of no they come as a transitive dependency from llcommon --- indra/llplugin/slplugin/CMakeLists.txt | 8 -------- 1 file changed, 8 deletions(-) (limited to 'indra/llplugin') diff --git a/indra/llplugin/slplugin/CMakeLists.txt b/indra/llplugin/slplugin/CMakeLists.txt index 7725489c3e..05e311f7e4 100644 --- a/indra/llplugin/slplugin/CMakeLists.txt +++ b/indra/llplugin/slplugin/CMakeLists.txt @@ -5,12 +5,6 @@ include(LLCommon) include(Linking) include(PluginAPI) -if (DARWIN) - include(CMakeFindFrameworks) - find_library(COCOA_LIBRARY Cocoa) -endif (DARWIN) - - ### SLPlugin set(SLPlugin_SOURCE_FILES @@ -60,8 +54,6 @@ target_link_libraries(SLPlugin ) if (DARWIN) - # Mac version needs to link against Carbon - target_link_libraries(SLPlugin ${COCOA_LIBRARY}) # Make sure the app bundle has a Resources directory (it will get populated by viewer-manifest.py later) add_custom_command( TARGET SLPlugin POST_BUILD -- cgit v1.2.3 From b9f94c08977ff76f41a32a2bb9f25883e578eea3 Mon Sep 17 00:00:00 2001 From: Nicky Date: Sat, 16 Apr 2022 15:33:32 +0200 Subject: Now there is a oslibrary target get rid of some more obsolete vars: LEGACY_STDIO_LIBS (was only used for Windows) PTHREAD_LIBRARY (only Linux) LLDATABASE_LIBRARIES (that one was supposed for Linux, but never needed anyway) --- indra/llplugin/slplugin/CMakeLists.txt | 1 - 1 file changed, 1 deletion(-) (limited to 'indra/llplugin') diff --git a/indra/llplugin/slplugin/CMakeLists.txt b/indra/llplugin/slplugin/CMakeLists.txt index 05e311f7e4..9daf7d327c 100644 --- a/indra/llplugin/slplugin/CMakeLists.txt +++ b/indra/llplugin/slplugin/CMakeLists.txt @@ -46,7 +46,6 @@ set_target_properties(SLPlugin endif () target_link_libraries(SLPlugin - ${LEGACY_STDIO_LIBS} llplugin llmessage llcommon -- 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/llplugin/slplugin/CMakeLists.txt | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'indra/llplugin') diff --git a/indra/llplugin/slplugin/CMakeLists.txt b/indra/llplugin/slplugin/CMakeLists.txt index 9daf7d327c..1fa4f0346d 100644 --- a/indra/llplugin/slplugin/CMakeLists.txt +++ b/indra/llplugin/slplugin/CMakeLists.txt @@ -20,10 +20,9 @@ if (DARWIN) ) endif (DARWIN) -set_source_files_properties(${SLPlugin_HEADER_FILES} - PROPERTIES HEADER_FILE_ONLY TRUE) - if (SLPlugin_HEADER_FILES) + set_source_files_properties(${SLPlugin_HEADER_FILES} + PROPERTIES HEADER_FILE_ONLY TRUE) list(APPEND SLPlugin_SOURCE_FILES ${SLPlugin_HEADER_FILES}) endif (SLPlugin_HEADER_FILES) @@ -46,11 +45,11 @@ set_target_properties(SLPlugin endif () target_link_libraries(SLPlugin - llplugin - llmessage - llcommon - ${PLUGIN_API_WINDOWS_LIBRARIES} -) + llplugin + llmessage + llcommon + ll::pluginlibraries + ) if (DARWIN) # Make sure the app bundle has a Resources directory (it will get populated by viewer-manifest.py later) -- 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/llplugin/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/llplugin') diff --git a/indra/llplugin/CMakeLists.txt b/indra/llplugin/CMakeLists.txt index 872d62a2bb..71801e05af 100644 --- a/indra/llplugin/CMakeLists.txt +++ b/indra/llplugin/CMakeLists.txt @@ -46,7 +46,7 @@ endif(NOT ADDRESS_SIZE EQUAL 32) list(APPEND llplugin_SOURCE_FILES ${llplugin_HEADER_FILES}) add_library (llplugin ${llplugin_SOURCE_FILES}) -set_target_include_dirs(llplugin ${CMAKE_CURRENT_SOURCE_DIR}) +target_include_directories( llplugin INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}) target_link_libraries( llplugin llcommon llmath llrender llmessage ) add_subdirectory(slplugin) -- 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/llplugin/CMakeLists.txt | 4 ---- indra/llplugin/slplugin/CMakeLists.txt | 2 -- 2 files changed, 6 deletions(-) (limited to 'indra/llplugin') diff --git a/indra/llplugin/CMakeLists.txt b/indra/llplugin/CMakeLists.txt index 71801e05af..14a69afe6e 100644 --- a/indra/llplugin/CMakeLists.txt +++ b/indra/llplugin/CMakeLists.txt @@ -20,7 +20,6 @@ set(llplugin_SOURCE_FILES set(llplugin_HEADER_FILES CMakeLists.txt - llpluginclassmedia.h llpluginclassmediaowner.h llplugininstance.h @@ -32,9 +31,6 @@ set(llplugin_HEADER_FILES llpluginsharedmemory.h ) -set_source_files_properties(${llplugin_HEADER_FILES} - PROPERTIES HEADER_FILE_ONLY TRUE) - if(NOT ADDRESS_SIZE EQUAL 32) if(WINDOWS) ##add_definitions(/FIXED:NO) diff --git a/indra/llplugin/slplugin/CMakeLists.txt b/indra/llplugin/slplugin/CMakeLists.txt index 1fa4f0346d..5b80d80c9b 100644 --- a/indra/llplugin/slplugin/CMakeLists.txt +++ b/indra/llplugin/slplugin/CMakeLists.txt @@ -21,8 +21,6 @@ if (DARWIN) endif (DARWIN) if (SLPlugin_HEADER_FILES) - set_source_files_properties(${SLPlugin_HEADER_FILES} - PROPERTIES HEADER_FILE_ONLY TRUE) list(APPEND SLPlugin_SOURCE_FILES ${SLPlugin_HEADER_FILES}) endif (SLPlugin_HEADER_FILES) -- cgit v1.2.3 From 767464a2627036e8a16ac323c886e0a1712e0a5f Mon Sep 17 00:00:00 2001 From: Nicky Date: Sat, 7 May 2022 02:19:51 +0200 Subject: Adapt gnerator expression usage to work on OSX. --- indra/llplugin/slplugin/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/llplugin') diff --git a/indra/llplugin/slplugin/CMakeLists.txt b/indra/llplugin/slplugin/CMakeLists.txt index 5b80d80c9b..0ea6495eac 100644 --- a/indra/llplugin/slplugin/CMakeLists.txt +++ b/indra/llplugin/slplugin/CMakeLists.txt @@ -56,7 +56,7 @@ if (DARWIN) COMMAND mkdir ARGS -p - ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/SLPlugin.app/Contents/Resources + ${CMAKE_CURRENT_BINARY_DIR}/$,$,>/SLPlugin.app/Contents/Resources ) endif (DARWIN) -- cgit v1.2.3