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/llmessage/CMakeLists.txt | 92 ++++++++++++------------------------------ 1 file changed, 25 insertions(+), 67 deletions(-) (limited to 'indra/llmessage/CMakeLists.txt') diff --git a/indra/llmessage/CMakeLists.txt b/indra/llmessage/CMakeLists.txt index f0a1dfe940..6be0262b25 100644 --- a/indra/llmessage/CMakeLists.txt +++ b/indra/llmessage/CMakeLists.txt @@ -7,9 +7,6 @@ include(GoogleMock) include(LLAddBuildTest) include(LLCommon) include(LLCoreHttp) -include(LLMath) -include(LLMessage) -include(LLFileSystem) include(LLAddBuildTest) include(Python) include(Tut) @@ -19,12 +16,9 @@ include(JsonCpp) include_directories (${CMAKE_CURRENT_SOURCE_DIR}) include_directories( - ${LLCOMMON_INCLUDE_DIRS} ${LLCOREHTTP_INCLUDE_DIRS} - ${LLMATH_INCLUDE_DIRS} ${LLMESSAGE_INCLUDE_DIRS} ${LLFILESYSTEM_INCLUDE_DIRS} - ${JSONCPP_INCLUDE_DIR} ) set(llmessage_SOURCE_FILES @@ -204,42 +198,18 @@ list(APPEND llmessage_SOURCE_FILES ${llmessage_HEADER_FILES}) add_library (llmessage ${llmessage_SOURCE_FILES}) -if (LINUX) -target_link_libraries( - llmessage - ${CURL_LIBRARIES} - ${LLCOMMON_LIBRARIES} - ${LLFILESYSTEM_LIBRARIES} - ${LLMATH_LIBRARIES} - ${JSONCPP_LIBRARIES} - ${OPENSSL_LIBRARIES} - ${CRYPTO_LIBRARIES} - ${NGHTTP2_LIBRARIES} - ${XMLRPCEPI_LIBRARIES} - ${LLCOREHTTP_LIBRARIES} - ${BOOST_FIBER_LIBRARY} - ${BOOST_CONTEXT_LIBRARY} - ${BOOST_SYSTEM_LIBRARY} - rt - ) -else (LINUX) target_link_libraries( - llmessage - ${CURL_LIBRARIES} - ${LLCOMMON_LIBRARIES} - ${LLFILESYSTEM_LIBRARIES} - ${LLMATH_LIBRARIES} - ${JSONCPP_LIBRARIES} - ${OPENSSL_LIBRARIES} - ${CRYPTO_LIBRARIES} - ${NGHTTP2_LIBRARIES} - ${XMLRPCEPI_LIBRARIES} - ${LLCOREHTTP_LIBRARIES} - ${BOOST_FIBER_LIBRARY} - ${BOOST_CONTEXT_LIBRARY} - ${BOOST_SYSTEM_LIBRARY} - ) -endif(LINUX) + llmessage + libcurl::libcurl + llcommon + llfilesystem + llmath + openssl::openssl + xmlrpc-epi::xmlrpc-epi + llcorehttp + nghttp2::nghttp2 +) +set_target_include_dirs( llmessage ${CMAKE_CURRENT_SOURCE_DIR}) # tests if (LL_TESTS) @@ -249,41 +219,29 @@ if (LL_TESTS) lltrustedmessageservice.cpp lltemplatemessagedispatcher.cpp ) + set_property( SOURCE ${llmessage_TEST_SOURCE_FILES} PROPERTY LL_TEST_ADDITIONAL_LIBRARIES llmath llcorehttp) LL_ADD_PROJECT_UNIT_TESTS(llmessage "${llmessage_TEST_SOURCE_FILES}") - # set(TEST_DEBUG on) if (LINUX) set(test_libs - ${WINDOWS_LIBRARIES} - ${LLFILESYSTEM_LIBRARIES} - ${LLMATH_LIBRARIES} - ${CURL_LIBRARIES} - ${NGHTTP2_LIBRARIES} - ${LLCOMMON_LIBRARIES} - ${LLMESSAGE_LIBRARIES} - ${LLCOREHTTP_LIBRARIES} - ${JSONCPP_LIBRARIES} - ${BOOST_FIBER_LIBRARY} - ${BOOST_CONTEXT_LIBRARY} - rt - ${GOOGLEMOCK_LIBRARIES} + ${WINDOWS_LIBRARIES} + llfilesystem + llmath + llcorehttp + llmessage + llcommon + rt ) else (LINUX) set(test_libs - ${WINDOWS_LIBRARIES} - ${LLFILESYSTEM_LIBRARIES} - ${LLMATH_LIBRARIES} - ${CURL_LIBRARIES} - ${NGHTTP2_LIBRARIES} - ${LLCOMMON_LIBRARIES} - ${LLMESSAGE_LIBRARIES} - ${LLCOREHTTP_LIBRARIES} - ${JSONCPP_LIBRARIES} - ${BOOST_FIBER_LIBRARY} - ${BOOST_CONTEXT_LIBRARY} - ${GOOGLEMOCK_LIBRARIES} + ${WINDOWS_LIBRARIES} + llfilesystem + llmath + llcorehttp + llmessage + llcommon ) endif(LINUX) -- 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/llmessage/CMakeLists.txt | 4 ---- 1 file changed, 4 deletions(-) (limited to 'indra/llmessage/CMakeLists.txt') diff --git a/indra/llmessage/CMakeLists.txt b/indra/llmessage/CMakeLists.txt index 6be0262b25..334a55348c 100644 --- a/indra/llmessage/CMakeLists.txt +++ b/indra/llmessage/CMakeLists.txt @@ -200,14 +200,10 @@ add_library (llmessage ${llmessage_SOURCE_FILES}) target_link_libraries( llmessage - libcurl::libcurl llcommon llfilesystem llmath - openssl::openssl - xmlrpc-epi::xmlrpc-epi llcorehttp - nghttp2::nghttp2 ) set_target_include_dirs( llmessage ${CMAKE_CURRENT_SOURCE_DIR}) -- cgit v1.2.3 From db8bc696847a4bba46e61f368f9ba17ad37ad4ab Mon Sep 17 00:00:00 2001 From: Nicky Date: Wed, 13 Apr 2022 21:27:27 +0200 Subject: Dependency on target xml-rpc-epi got lost, bring it back --- indra/llmessage/CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) (limited to 'indra/llmessage/CMakeLists.txt') diff --git a/indra/llmessage/CMakeLists.txt b/indra/llmessage/CMakeLists.txt index 334a55348c..5f48ea60dc 100644 --- a/indra/llmessage/CMakeLists.txt +++ b/indra/llmessage/CMakeLists.txt @@ -204,6 +204,7 @@ target_link_libraries( llfilesystem llmath llcorehttp + ll::xmlrpc-epi ) set_target_include_dirs( llmessage ${CMAKE_CURRENT_SOURCE_DIR}) -- 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/llmessage/CMakeLists.txt | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) (limited to 'indra/llmessage/CMakeLists.txt') diff --git a/indra/llmessage/CMakeLists.txt b/indra/llmessage/CMakeLists.txt index 5f48ea60dc..20435d991a 100644 --- a/indra/llmessage/CMakeLists.txt +++ b/indra/llmessage/CMakeLists.txt @@ -220,27 +220,14 @@ if (LL_TESTS) LL_ADD_PROJECT_UNIT_TESTS(llmessage "${llmessage_TEST_SOURCE_FILES}") # set(TEST_DEBUG on) - -if (LINUX) - set(test_libs - ${WINDOWS_LIBRARIES} - llfilesystem - llmath - llcorehttp - llmessage - llcommon - rt - ) -else (LINUX) + set(test_libs - ${WINDOWS_LIBRARIES} llfilesystem llmath llcorehttp llmessage llcommon - ) -endif(LINUX) + ) #LL_ADD_INTEGRATION_TEST(llavatarnamecache "" "${test_libs}") LL_ADD_INTEGRATION_TEST(llhost "" "${test_libs}") -- cgit v1.2.3 From bb35d5a59965235fa212299f11138da7b253760e Mon Sep 17 00:00:00 2001 From: Nicky Date: Sat, 16 Apr 2022 17:30:09 +0200 Subject: Remove some more obsolete includes (UnixInstall) and include_directories() --- indra/llmessage/CMakeLists.txt | 6 ------ 1 file changed, 6 deletions(-) (limited to 'indra/llmessage/CMakeLists.txt') diff --git a/indra/llmessage/CMakeLists.txt b/indra/llmessage/CMakeLists.txt index 20435d991a..623798176b 100644 --- a/indra/llmessage/CMakeLists.txt +++ b/indra/llmessage/CMakeLists.txt @@ -15,12 +15,6 @@ include(JsonCpp) include_directories (${CMAKE_CURRENT_SOURCE_DIR}) -include_directories( - ${LLCOREHTTP_INCLUDE_DIRS} - ${LLMESSAGE_INCLUDE_DIRS} - ${LLFILESYSTEM_INCLUDE_DIRS} - ) - set(llmessage_SOURCE_FILES llassetstorage.cpp llavatarname.cpp -- 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/llmessage/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/llmessage/CMakeLists.txt') diff --git a/indra/llmessage/CMakeLists.txt b/indra/llmessage/CMakeLists.txt index 623798176b..679ff43131 100644 --- a/indra/llmessage/CMakeLists.txt +++ b/indra/llmessage/CMakeLists.txt @@ -200,7 +200,7 @@ target_link_libraries( llcorehttp ll::xmlrpc-epi ) -set_target_include_dirs( llmessage ${CMAKE_CURRENT_SOURCE_DIR}) +target_include_directories( llmessage INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}) # tests if (LL_TESTS) -- 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/llmessage/CMakeLists.txt | 3 --- 1 file changed, 3 deletions(-) (limited to 'indra/llmessage/CMakeLists.txt') diff --git a/indra/llmessage/CMakeLists.txt b/indra/llmessage/CMakeLists.txt index 679ff43131..7340752fb2 100644 --- a/indra/llmessage/CMakeLists.txt +++ b/indra/llmessage/CMakeLists.txt @@ -185,9 +185,6 @@ set(llmessage_HEADER_FILES sound_ids.h ) -set_source_files_properties(${llmessage_HEADER_FILES} - PROPERTIES HEADER_FILE_ONLY TRUE) - list(APPEND llmessage_SOURCE_FILES ${llmessage_HEADER_FILES}) add_library (llmessage ${llmessage_SOURCE_FILES}) -- cgit v1.2.3 From 8e0b039e554e320cedfdef3057a3073a493db2e7 Mon Sep 17 00:00:00 2001 From: Nicky Dasmijn Date: Sat, 17 Sep 2022 17:14:16 +0200 Subject: Cleanup sweep --- indra/llmessage/CMakeLists.txt | 2 -- 1 file changed, 2 deletions(-) (limited to 'indra/llmessage/CMakeLists.txt') diff --git a/indra/llmessage/CMakeLists.txt b/indra/llmessage/CMakeLists.txt index 7340752fb2..4786956e85 100644 --- a/indra/llmessage/CMakeLists.txt +++ b/indra/llmessage/CMakeLists.txt @@ -13,8 +13,6 @@ include(Tut) include(Python) include(JsonCpp) -include_directories (${CMAKE_CURRENT_SOURCE_DIR}) - set(llmessage_SOURCE_FILES llassetstorage.cpp llavatarname.cpp -- cgit v1.2.3