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/llfilesystem/CMakeLists.txt | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) (limited to 'indra/llfilesystem') diff --git a/indra/llfilesystem/CMakeLists.txt b/indra/llfilesystem/CMakeLists.txt index 09c4c33ebf..dfc290a48b 100644 --- a/indra/llfilesystem/CMakeLists.txt +++ b/indra/llfilesystem/CMakeLists.txt @@ -60,15 +60,10 @@ list(APPEND llfilesystem_SOURCE_FILES ${llfilesystem_HEADER_FILES}) add_library (llfilesystem ${llfilesystem_SOURCE_FILES}) -set(cache_BOOST_LIBRARIES - ${BOOST_FILESYSTEM_LIBRARY} - ${BOOST_SYSTEM_LIBRARY} - ) - target_link_libraries(llfilesystem - ${LLCOMMON_LIBRARIES} - ${cache_BOOST_LIBRARIES} + llcommon ) +set_target_include_dirs( llfilesystem ${CMAKE_CURRENT_SOURCE_DIR}) if (DARWIN) include(CMakeFindFrameworks) @@ -92,7 +87,7 @@ if (LL_TESTS) LL_ADD_PROJECT_UNIT_TESTS(llfilesystem "${llfilesystem_TEST_SOURCE_FILES}") # INTEGRATION TESTS - set(test_libs llmath llcommon llfilesystem ${LLCOMMON_LIBRARIES} ${WINDOWS_LIBRARIES}) + set(test_libs llmath llcommon llfilesystem ${WINDOWS_LIBRARIES}) # TODO: Some of these need refactoring to be proper Unit tests rather than Integration tests. LL_ADD_INTEGRATION_TEST(lldir "" "${test_libs}") -- 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/llfilesystem/CMakeLists.txt | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) (limited to 'indra/llfilesystem') diff --git a/indra/llfilesystem/CMakeLists.txt b/indra/llfilesystem/CMakeLists.txt index dfc290a48b..7274c3b450 100644 --- a/indra/llfilesystem/CMakeLists.txt +++ b/indra/llfilesystem/CMakeLists.txt @@ -65,13 +65,6 @@ target_link_libraries(llfilesystem ) set_target_include_dirs( llfilesystem ${CMAKE_CURRENT_SOURCE_DIR}) -if (DARWIN) - include(CMakeFindFrameworks) - find_library(COCOA_LIBRARY Cocoa) - target_link_libraries(llfilesystem ${COCOA_LIBRARY}) -endif (DARWIN) - - # Add tests if (LL_TESTS) include(LLAddBuildTest) @@ -87,7 +80,7 @@ if (LL_TESTS) LL_ADD_PROJECT_UNIT_TESTS(llfilesystem "${llfilesystem_TEST_SOURCE_FILES}") # INTEGRATION TESTS - set(test_libs llmath llcommon llfilesystem ${WINDOWS_LIBRARIES}) + set(test_libs llmath llcommon llfilesystem ) # TODO: Some of these need refactoring to be proper Unit tests rather than Integration tests. LL_ADD_INTEGRATION_TEST(lldir "" "${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/llfilesystem/CMakeLists.txt | 10 ---------- 1 file changed, 10 deletions(-) (limited to 'indra/llfilesystem') diff --git a/indra/llfilesystem/CMakeLists.txt b/indra/llfilesystem/CMakeLists.txt index 7274c3b450..882f5b8fba 100644 --- a/indra/llfilesystem/CMakeLists.txt +++ b/indra/llfilesystem/CMakeLists.txt @@ -4,12 +4,6 @@ project(llfilesystem) include(00-Common) include(LLCommon) -include(UnixInstall) - -include_directories( - ${LLCOMMON_INCLUDE_DIRS} - ${LLCOMMON_SYSTEM_INCLUDE_DIRS} - ) set(llfilesystem_SOURCE_FILES lldir.cpp @@ -73,10 +67,6 @@ if (LL_TESTS) lldiriterator.cpp ) - set_source_files_properties(lldiriterator.cpp - PROPERTIES - LL_TEST_ADDITIONAL_LIBRARIES "${cache_BOOST_LIBRARIES}" - ) LL_ADD_PROJECT_UNIT_TESTS(llfilesystem "${llfilesystem_TEST_SOURCE_FILES}") # INTEGRATION 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/llfilesystem/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/llfilesystem') diff --git a/indra/llfilesystem/CMakeLists.txt b/indra/llfilesystem/CMakeLists.txt index 882f5b8fba..537f43007a 100644 --- a/indra/llfilesystem/CMakeLists.txt +++ b/indra/llfilesystem/CMakeLists.txt @@ -57,7 +57,7 @@ add_library (llfilesystem ${llfilesystem_SOURCE_FILES}) target_link_libraries(llfilesystem llcommon ) -set_target_include_dirs( llfilesystem ${CMAKE_CURRENT_SOURCE_DIR}) +target_include_directories( llfilesystem INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}) # Add 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/llfilesystem/CMakeLists.txt | 3 --- 1 file changed, 3 deletions(-) (limited to 'indra/llfilesystem') diff --git a/indra/llfilesystem/CMakeLists.txt b/indra/llfilesystem/CMakeLists.txt index 537f43007a..9f24f75eab 100644 --- a/indra/llfilesystem/CMakeLists.txt +++ b/indra/llfilesystem/CMakeLists.txt @@ -47,9 +47,6 @@ if (WINDOWS) LIST(APPEND llfilesystem_HEADER_FILES lldir_win32.h) endif (WINDOWS) -set_source_files_properties(${llfilesystem_HEADER_FILES} - PROPERTIES HEADER_FILE_ONLY TRUE) - list(APPEND llfilesystem_SOURCE_FILES ${llfilesystem_HEADER_FILES}) add_library (llfilesystem ${llfilesystem_SOURCE_FILES}) -- cgit v1.2.3