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/llrender/CMakeLists.txt | 56 +++++++++++++++---------------------------- 1 file changed, 19 insertions(+), 37 deletions(-) (limited to 'indra/llrender/CMakeLists.txt') diff --git a/indra/llrender/CMakeLists.txt b/indra/llrender/CMakeLists.txt index baab09a104..7d42043613 100644 --- a/indra/llrender/CMakeLists.txt +++ b/indra/llrender/CMakeLists.txt @@ -7,26 +7,7 @@ include(OpenGL) include(FreeType) include(LLCommon) include(LLImage) -include(LLMath) -include(LLRender) include(LLWindow) -include(LLXML) -include(LLFileSystem) - -include_directories( - ${FREETYPE_INCLUDE_DIRS} - ${LLCOMMON_INCLUDE_DIRS} - ${LLIMAGE_INCLUDE_DIRS} - ${LLMATH_INCLUDE_DIRS} - ${LLRENDER_INCLUDE_DIRS} - ${LLFILESYSTEM_INCLUDE_DIRS} - ${LLWINDOW_INCLUDE_DIRS} - ${LLXML_INCLUDE_DIRS} - ) -include_directories(SYSTEM - ${LLCOMMON_SYSTEM_INCLUDE_DIRS} - ${LLXML_SYSTEM_INCLUDE_DIRS} - ) set(llrender_SOURCE_FILES llatmosphere.cpp @@ -98,18 +79,17 @@ if (BUILD_HEADLESS) ) target_link_libraries(llrenderheadless - ${LLCOMMON_LIBRARIES} - ${LLIMAGE_LIBRARIES} - ${LLMATH_LIBRARIES} - ${LLRENDER_HEADLESS_LIBRARIES} - ${LLXML_LIBRARIES} - ${LLFILESYSTEM_LIBRARIES} - ${LLWINDOW_HEADLESS_LIBRARIES} - ${OPENGL_HEADLESS_LIBRARIES}) - + llcommon + llimage + llmath + llrender + llxml + llfilesystem + ) endif (BUILD_HEADLESS) add_library (llrender ${llrender_SOURCE_FILES}) +set_target_include_dirs(llrender ${CMAKE_CURRENT_SOURCE_DIR}) if (SDL_FOUND) set_property(TARGET llrender @@ -119,13 +99,15 @@ endif (SDL_FOUND) # Libraries on which this library depends, needed for Linux builds # Sort by high-level to low-level -target_link_libraries(llrender - ${LLCOMMON_LIBRARIES} - ${LLIMAGE_LIBRARIES} - ${LLMATH_LIBRARIES} - ${LLFILESYSTEM_LIBRARIES} - ${LLXML_LIBRARIES} - ${LLWINDOW_LIBRARIES} - ${FREETYPE_LIBRARIES} - ${OPENGL_LIBRARIES}) +target_link_libraries(llrender + llcommon + llimage + llmath + llfilesystem + llxml + llwindow + freetype::freetype + OpenGL::GL + OpenGL::GLU + ) -- cgit v1.2.3 From 5f7c74fa2e796c04915b6da5e7db013a94c00e2d Mon Sep 17 00:00:00 2001 From: Nicky Date: Wed, 6 Apr 2022 20:25:49 +0200 Subject: Create and use sdl::sdl target --- indra/llrender/CMakeLists.txt | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'indra/llrender/CMakeLists.txt') diff --git a/indra/llrender/CMakeLists.txt b/indra/llrender/CMakeLists.txt index 7d42043613..cb98886f9b 100644 --- a/indra/llrender/CMakeLists.txt +++ b/indra/llrender/CMakeLists.txt @@ -91,12 +91,6 @@ endif (BUILD_HEADLESS) add_library (llrender ${llrender_SOURCE_FILES}) set_target_include_dirs(llrender ${CMAKE_CURRENT_SOURCE_DIR}) -if (SDL_FOUND) - set_property(TARGET llrender - PROPERTY COMPILE_DEFINITIONS LL_SDL=1 - ) -endif (SDL_FOUND) - # Libraries on which this library depends, needed for Linux builds # Sort by high-level to low-level target_link_libraries(llrender @@ -106,6 +100,7 @@ target_link_libraries(llrender llfilesystem llxml llwindow + sdl::sdl freetype::freetype OpenGL::GL OpenGL::GLU -- 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/llrender/CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'indra/llrender/CMakeLists.txt') diff --git a/indra/llrender/CMakeLists.txt b/indra/llrender/CMakeLists.txt index cb98886f9b..8f9089f4b7 100644 --- a/indra/llrender/CMakeLists.txt +++ b/indra/llrender/CMakeLists.txt @@ -100,8 +100,8 @@ target_link_libraries(llrender llfilesystem llxml llwindow - sdl::sdl - freetype::freetype + ll::sdl + ll::freetype OpenGL::GL OpenGL::GLU ) -- 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/llrender/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/llrender/CMakeLists.txt') diff --git a/indra/llrender/CMakeLists.txt b/indra/llrender/CMakeLists.txt index 8f9089f4b7..db672303be 100644 --- a/indra/llrender/CMakeLists.txt +++ b/indra/llrender/CMakeLists.txt @@ -89,7 +89,7 @@ if (BUILD_HEADLESS) endif (BUILD_HEADLESS) add_library (llrender ${llrender_SOURCE_FILES}) -set_target_include_dirs(llrender ${CMAKE_CURRENT_SOURCE_DIR}) +target_include_directories( llrender INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}) # Libraries on which this library depends, needed for Linux builds # Sort by high-level to low-level -- cgit v1.2.3 From 29ca8560381424adcee2f096de0e940b3d1f46b0 Mon Sep 17 00:00:00 2001 From: Nicky Date: Mon, 18 Apr 2022 16:50:17 +0200 Subject: llrender does not need a dependency on sdl. There was some comment out code which suggests it was needed long ago. --- indra/llrender/CMakeLists.txt | 1 - 1 file changed, 1 deletion(-) (limited to 'indra/llrender/CMakeLists.txt') diff --git a/indra/llrender/CMakeLists.txt b/indra/llrender/CMakeLists.txt index db672303be..bb22a969f5 100644 --- a/indra/llrender/CMakeLists.txt +++ b/indra/llrender/CMakeLists.txt @@ -100,7 +100,6 @@ target_link_libraries(llrender llfilesystem llxml llwindow - ll::sdl ll::freetype OpenGL::GL OpenGL::GLU -- 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/llrender/CMakeLists.txt | 3 --- 1 file changed, 3 deletions(-) (limited to 'indra/llrender/CMakeLists.txt') diff --git a/indra/llrender/CMakeLists.txt b/indra/llrender/CMakeLists.txt index bb22a969f5..c5cf1100d5 100644 --- a/indra/llrender/CMakeLists.txt +++ b/indra/llrender/CMakeLists.txt @@ -64,9 +64,6 @@ set(llrender_HEADER_FILES llglcommonfunc.h ) -set_source_files_properties(${llrender_HEADER_FILES} - PROPERTIES HEADER_FILE_ONLY TRUE) - list(APPEND llrender_SOURCE_FILES ${llrender_HEADER_FILES}) if (BUILD_HEADLESS) -- cgit v1.2.3