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/llxml/CMakeLists.txt | 32 +++++++++++--------------------- 1 file changed, 11 insertions(+), 21 deletions(-) (limited to 'indra/llxml') diff --git a/indra/llxml/CMakeLists.txt b/indra/llxml/CMakeLists.txt index 3a7a54e51d..b585dbd26e 100644 --- a/indra/llxml/CMakeLists.txt +++ b/indra/llxml/CMakeLists.txt @@ -4,18 +4,6 @@ project(llxml) include(00-Common) include(LLCommon) -include(LLMath) -include(LLFileSystem) -include(LLXML) - -include_directories( - ${LLCOMMON_INCLUDE_DIRS} - ${LLMATH_INCLUDE_DIRS} - ${LLFILESYSTEM_INCLUDE_DIRS} - ) -include_directories( - ${LLCOMMON_SYSTEM_INCLUDE_DIRS} - ) set(llxml_SOURCE_FILES llcontrol.cpp @@ -42,11 +30,13 @@ add_library (llxml ${llxml_SOURCE_FILES}) # Libraries on which this library depends, needed for Linux builds # Sort by high-level to low-level target_link_libraries( llxml - ${LLFILESYSTEM_LIBRARIES} - ${LLMATH_LIBRARIES} - ${LLCOMMON_LIBRARIES} - ${EXPAT_LIBRARIES} + llfilesystem + llmath + llcommon + expat::expat ) +set_target_include_dirs( llxml ${CMAKE_CURRENT_SOURCE_DIR}) + # tests @@ -62,11 +52,11 @@ if (LL_TESTS) # set(TEST_DEBUG on) set(test_libs - ${LLXML_LIBRARIES} - ${WINDOWS_LIBRARIES} - ${LLMATH_LIBRARIES} - ${LLCOMMON_LIBRARIES} - ) + llxml + llmath + llcommon + ${WINDOWS_LIBRARIES} + ) LL_ADD_INTEGRATION_TEST(llcontrol "" "${test_libs}") 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/llxml/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/llxml') diff --git a/indra/llxml/CMakeLists.txt b/indra/llxml/CMakeLists.txt index b585dbd26e..5953cb79e8 100644 --- a/indra/llxml/CMakeLists.txt +++ b/indra/llxml/CMakeLists.txt @@ -33,7 +33,7 @@ target_link_libraries( llxml llfilesystem llmath llcommon - expat::expat + ll::expat ) set_target_include_dirs( llxml ${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/llxml/CMakeLists.txt | 1 - 1 file changed, 1 deletion(-) (limited to 'indra/llxml') diff --git a/indra/llxml/CMakeLists.txt b/indra/llxml/CMakeLists.txt index 5953cb79e8..fc680e6da5 100644 --- a/indra/llxml/CMakeLists.txt +++ b/indra/llxml/CMakeLists.txt @@ -55,7 +55,6 @@ if (LL_TESTS) llxml llmath llcommon - ${WINDOWS_LIBRARIES} ) LL_ADD_INTEGRATION_TEST(llcontrol "" "${test_libs}") -- 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/llxml/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/llxml') diff --git a/indra/llxml/CMakeLists.txt b/indra/llxml/CMakeLists.txt index fc680e6da5..5ac6aae78e 100644 --- a/indra/llxml/CMakeLists.txt +++ b/indra/llxml/CMakeLists.txt @@ -35,7 +35,7 @@ target_link_libraries( llxml llcommon ll::expat ) -set_target_include_dirs( llxml ${CMAKE_CURRENT_SOURCE_DIR}) +target_include_directories( llxml INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}) # 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/llxml/CMakeLists.txt | 3 --- 1 file changed, 3 deletions(-) (limited to 'indra/llxml') diff --git a/indra/llxml/CMakeLists.txt b/indra/llxml/CMakeLists.txt index 5ac6aae78e..508c2b919b 100644 --- a/indra/llxml/CMakeLists.txt +++ b/indra/llxml/CMakeLists.txt @@ -21,9 +21,6 @@ set(llxml_HEADER_FILES llxmltree.h ) -set_source_files_properties(${llxml_HEADER_FILES} - PROPERTIES HEADER_FILE_ONLY TRUE) - list(APPEND llxml_SOURCE_FILES ${llxml_HEADER_FILES}) add_library (llxml ${llxml_SOURCE_FILES}) -- cgit v1.2.3