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/llui/CMakeLists.txt | 59 ++++++++++++++--------------------------------- 1 file changed, 17 insertions(+), 42 deletions(-) (limited to 'indra/llui/CMakeLists.txt') diff --git a/indra/llui/CMakeLists.txt b/indra/llui/CMakeLists.txt index d96824bbf8..04103b1a94 100644 --- a/indra/llui/CMakeLists.txt +++ b/indra/llui/CMakeLists.txt @@ -6,33 +6,9 @@ include(00-Common) include(Hunspell) include(LLCommon) include(LLImage) -include(LLInventory) -include(LLMath) -include(LLMessage) include(LLCoreHttp) -include(LLRender) include(LLWindow) include(LLCoreHttp) -include(LLFileSystem) -include(LLXML) - -include_directories( - ${LLCOMMON_INCLUDE_DIRS} - ${LLCOREHTTP_INCLUDE_DIRS} - ${LLIMAGE_INCLUDE_DIRS} - ${LLINVENTORY_INCLUDE_DIRS} - ${LLMATH_INCLUDE_DIRS} - ${LLMESSAGE_INCLUDE_DIRS} - ${LLRENDER_INCLUDE_DIRS} - ${LLWINDOW_INCLUDE_DIRS} - ${LLFILESYSTEM_INCLUDE_DIRS} - ${LLXML_INCLUDE_DIRS} - ${LIBS_PREBUILD_DIR}/include/hunspell - ) -include_directories(SYSTEM - ${LLCOMMON_SYSTEM_INCLUDE_DIRS} - ${LLXML_SYSTEM_INCLUDE_DIRS} - ) set(llui_SOURCE_FILES llaccordionctrl.cpp @@ -276,38 +252,37 @@ set_source_files_properties(llurlentry.cpp list(APPEND llui_SOURCE_FILES ${llui_HEADER_FILES}) add_library (llui ${llui_SOURCE_FILES}) +set_target_include_dirs( llui ${CMAKE_CURRENT_SOURCE_DIR}) # Libraries on which this library depends, needed for Linux builds # Sort by high-level to low-level target_link_libraries(llui - ${LLRENDER_LIBRARIES} - ${LLWINDOW_LIBRARIES} - ${LLIMAGE_LIBRARIES} - ${LLINVENTORY_LIBRARIES} - ${LLMESSAGE_LIBRARIES} - ${LLCOREHTTP_LIBRARIES} - ${LLFILESYSTEM_LIBRARIES} - ${LLXUIXML_LIBRARIES} - ${LLXML_LIBRARIES} - ${LLMATH_LIBRARIES} - ${HUNSPELL_LIBRARY} - ${LLMESSAGE_LIBRARIES} - ${LLCOMMON_LIBRARIES} # must be after llimage, llwindow, llrender + llrender + llwindow + llimage + llinventory + llmessage + llcorehttp + llfilesystem + llxml + llmath + hunspell::hunspell + llcommon ) # Add tests if(LL_TESTS) include(LLAddBuildTest) + set(test_libs llmessage llcorehttp llxml llrender llcommon hunspell::hunspell ${WINDOWS_LIBRARIES}) + SET(llui_TEST_SOURCE_FILES llurlmatch.cpp ) + set_property( SOURCE ${llui_TEST_SOURCE_FILES} PROPERTY LL_TEST_ADDITIONAL_LIBRARIES ${test_libs}) LL_ADD_PROJECT_UNIT_TESTS(llui "${llui_TEST_SOURCE_FILES}") # INTEGRATION TESTS - set(test_libs llui llmessage llcorehttp llcommon - ${HUNSPELL_LIBRARY} - ${LLCOMMON_LIBRARIES} - ${BOOST_FIBER_LIBRARY} ${BOOST_CONTEXT_LIBRARY} ${BOOST_SYSTEM_LIBRARY} - ${WINDOWS_LIBRARIES}) + if(NOT LINUX) + set(test_libs llui llmessage llcorehttp llxml llrender llcommon hunspell::hunspell ${WINDOWS_LIBRARIES}) LL_ADD_INTEGRATION_TEST(llurlentry llurlentry.cpp "${test_libs}") endif(NOT LINUX) endif(LL_TESTS) -- 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/llui/CMakeLists.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'indra/llui/CMakeLists.txt') diff --git a/indra/llui/CMakeLists.txt b/indra/llui/CMakeLists.txt index 04103b1a94..9035095d5f 100644 --- a/indra/llui/CMakeLists.txt +++ b/indra/llui/CMakeLists.txt @@ -265,14 +265,14 @@ target_link_libraries(llui llfilesystem llxml llmath - hunspell::hunspell + ll::hunspell llcommon ) # Add tests if(LL_TESTS) include(LLAddBuildTest) - set(test_libs llmessage llcorehttp llxml llrender llcommon hunspell::hunspell ${WINDOWS_LIBRARIES}) + set(test_libs llmessage llcorehttp llxml llrender llcommon ll::hunspell ${WINDOWS_LIBRARIES}) SET(llui_TEST_SOURCE_FILES llurlmatch.cpp @@ -282,7 +282,7 @@ if(LL_TESTS) # INTEGRATION TESTS if(NOT LINUX) - set(test_libs llui llmessage llcorehttp llxml llrender llcommon hunspell::hunspell ${WINDOWS_LIBRARIES}) + set(test_libs llui llmessage llcorehttp llxml llrender llcommon ll::hunspell ${WINDOWS_LIBRARIES}) LL_ADD_INTEGRATION_TEST(llurlentry llurlentry.cpp "${test_libs}") endif(NOT LINUX) endif(LL_TESTS) -- 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/llui/CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'indra/llui/CMakeLists.txt') diff --git a/indra/llui/CMakeLists.txt b/indra/llui/CMakeLists.txt index 9035095d5f..5e71b673a5 100644 --- a/indra/llui/CMakeLists.txt +++ b/indra/llui/CMakeLists.txt @@ -272,7 +272,7 @@ target_link_libraries(llui # Add tests if(LL_TESTS) include(LLAddBuildTest) - set(test_libs llmessage llcorehttp llxml llrender llcommon ll::hunspell ${WINDOWS_LIBRARIES}) + set(test_libs llmessage llcorehttp llxml llrender llcommon ll::hunspell) SET(llui_TEST_SOURCE_FILES llurlmatch.cpp @@ -282,7 +282,7 @@ if(LL_TESTS) # INTEGRATION TESTS if(NOT LINUX) - set(test_libs llui llmessage llcorehttp llxml llrender llcommon ll::hunspell ${WINDOWS_LIBRARIES}) + set(test_libs llui llmessage llcorehttp llxml llrender llcommon ll::hunspell ) LL_ADD_INTEGRATION_TEST(llurlentry llurlentry.cpp "${test_libs}") endif(NOT LINUX) endif(LL_TESTS) -- 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/llui/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/llui/CMakeLists.txt') diff --git a/indra/llui/CMakeLists.txt b/indra/llui/CMakeLists.txt index 5e71b673a5..144923636b 100644 --- a/indra/llui/CMakeLists.txt +++ b/indra/llui/CMakeLists.txt @@ -252,7 +252,7 @@ set_source_files_properties(llurlentry.cpp list(APPEND llui_SOURCE_FILES ${llui_HEADER_FILES}) add_library (llui ${llui_SOURCE_FILES}) -set_target_include_dirs( llui ${CMAKE_CURRENT_SOURCE_DIR}) +target_include_directories( llui INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}) # Libraries on which this library depends, needed for Linux builds # Sort by high-level to low-level target_link_libraries(llui -- 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/llui/CMakeLists.txt | 3 --- 1 file changed, 3 deletions(-) (limited to 'indra/llui/CMakeLists.txt') diff --git a/indra/llui/CMakeLists.txt b/indra/llui/CMakeLists.txt index 144923636b..9108c6143c 100644 --- a/indra/llui/CMakeLists.txt +++ b/indra/llui/CMakeLists.txt @@ -236,9 +236,6 @@ set(llui_HEADER_FILES llxyvector.h ) -set_source_files_properties(${llui_HEADER_FILES} - PROPERTIES HEADER_FILE_ONLY TRUE) - SET(llurlentry_TEST_DEPENDENCIES llurlmatch.cpp llurlregistry.cpp -- cgit v1.2.3