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/llimage/CMakeLists.txt | 30 ++++++++++-------------------- 1 file changed, 10 insertions(+), 20 deletions(-) (limited to 'indra/llimage') diff --git a/indra/llimage/CMakeLists.txt b/indra/llimage/CMakeLists.txt index 436b8dd1a2..5387a22601 100644 --- a/indra/llimage/CMakeLists.txt +++ b/indra/llimage/CMakeLists.txt @@ -5,24 +5,13 @@ project(llimage) include(00-Common) include(LLCommon) include(LLImage) -include(LLMath) -include(LLFileSystem) +include(JPEG) include(LLKDU) -include(LLImageJ2COJ) include(ZLIBNG) include(LLAddBuildTest) include(bugsplat) include(Tut) -include_directories( - ${LLCOMMON_INCLUDE_DIRS} - ${LLCOMMON_SYSTEM_INCLUDE_DIRS} - ${LLMATH_INCLUDE_DIRS} - ${LLFILESYSTEM_INCLUDE_DIRS} - ${PNG_INCLUDE_DIRS} - ${ZLIBNG_INCLUDE_DIRS} - ) - set(llimage_SOURCE_FILES llimagebmp.cpp llimage.cpp @@ -60,21 +49,22 @@ set_source_files_properties(${llimage_HEADER_FILES} list(APPEND llimage_SOURCE_FILES ${llimage_HEADER_FILES}) add_library (llimage ${llimage_SOURCE_FILES}) +set_target_include_dirs( llimage ${CMAKE_CURRENT_SOURCE_DIR}) # Libraries on which this library depends, needed for Linux builds # Sort by high-level to low-level if (USE_KDU) - target_link_libraries(llimage ${LLKDU_LIBRARIES}) + target_link_libraries(llimage llkdu) else (USE_KDU) - target_link_libraries(llimage ${LLIMAGEJ2COJ_LIBRARIES}) + target_link_libraries(llimage llimagej2coj) endif (USE_KDU) target_link_libraries(llimage - ${LLFILESYSTEM_LIBRARIES} - ${LLMATH_LIBRARIES} - ${LLCOMMON_LIBRARIES} - ${JPEG_LIBRARIES} - ${PNG_LIBRARIES} - ${ZLIBNG_LIBRARIES} + llfilesystem + llmath + llcommon + zlib-ng::zlib-ng + libpng::libpng + jpeglib::jpeglib ) # Add 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/llimage/CMakeLists.txt | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'indra/llimage') diff --git a/indra/llimage/CMakeLists.txt b/indra/llimage/CMakeLists.txt index 5387a22601..7b3c1110a2 100644 --- a/indra/llimage/CMakeLists.txt +++ b/indra/llimage/CMakeLists.txt @@ -62,9 +62,8 @@ target_link_libraries(llimage llfilesystem llmath llcommon - zlib-ng::zlib-ng - libpng::libpng - jpeglib::jpeglib + ll::libpng + ll::jpeglib ) # Add 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/llimage/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/llimage') diff --git a/indra/llimage/CMakeLists.txt b/indra/llimage/CMakeLists.txt index 7b3c1110a2..0984493941 100644 --- a/indra/llimage/CMakeLists.txt +++ b/indra/llimage/CMakeLists.txt @@ -49,7 +49,7 @@ set_source_files_properties(${llimage_HEADER_FILES} list(APPEND llimage_SOURCE_FILES ${llimage_HEADER_FILES}) add_library (llimage ${llimage_SOURCE_FILES}) -set_target_include_dirs( llimage ${CMAKE_CURRENT_SOURCE_DIR}) +target_include_directories( llimage INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}) # Libraries on which this library depends, needed for Linux builds # Sort by high-level to low-level if (USE_KDU) -- cgit v1.2.3 From 2b151e0aefd54671e1be504269f10318d303dccb Mon Sep 17 00:00:00 2001 From: Nicky Date: Mon, 18 Apr 2022 18:11:43 +0200 Subject: Round one to support conan for 3P packages, this allows to build the viewer on Linux again. --- indra/llimage/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/llimage') diff --git a/indra/llimage/CMakeLists.txt b/indra/llimage/CMakeLists.txt index 0984493941..57703818c9 100644 --- a/indra/llimage/CMakeLists.txt +++ b/indra/llimage/CMakeLists.txt @@ -63,7 +63,7 @@ target_link_libraries(llimage llmath llcommon ll::libpng - ll::jpeglib + ll::libjpeg ) # Add 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/llimage/CMakeLists.txt | 3 --- 1 file changed, 3 deletions(-) (limited to 'indra/llimage') diff --git a/indra/llimage/CMakeLists.txt b/indra/llimage/CMakeLists.txt index 57703818c9..cc75c463bc 100644 --- a/indra/llimage/CMakeLists.txt +++ b/indra/llimage/CMakeLists.txt @@ -43,9 +43,6 @@ set(llimage_HEADER_FILES llpngwrapper.h ) -set_source_files_properties(${llimage_HEADER_FILES} - PROPERTIES HEADER_FILE_ONLY TRUE) - list(APPEND llimage_SOURCE_FILES ${llimage_HEADER_FILES}) add_library (llimage ${llimage_SOURCE_FILES}) -- cgit v1.2.3