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/llkdu/CMakeLists.txt | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) (limited to 'indra/llkdu/CMakeLists.txt') diff --git a/indra/llkdu/CMakeLists.txt b/indra/llkdu/CMakeLists.txt index cb0e204e91..035fc746cf 100644 --- a/indra/llkdu/CMakeLists.txt +++ b/indra/llkdu/CMakeLists.txt @@ -13,15 +13,7 @@ include(00-Common) include(LLCommon) include(LLImage) include(LLKDU) -include(LLMath) -include_directories( - ${LLCOMMON_INCLUDE_DIRS} - ${LLIMAGE_INCLUDE_DIRS} - ${KDU_INCLUDE_DIR} - ${LLKDU_INCLUDE_DIRS} - ${LLMATH_INCLUDE_DIRS} - ) set(llkdu_SOURCE_FILES llimagej2ckdu.cpp @@ -51,9 +43,8 @@ set_source_files_properties(${llkdu_SOURCE_FILES} if (USE_KDU) add_library (llkdu ${llkdu_SOURCE_FILES}) - target_link_libraries(llkdu - ${KDU_LIBRARY}) - + target_link_libraries(llkdu kdu::kdu ) + # Add tests if (LL_TESTS) include(LLAddBuildTest) @@ -66,10 +57,7 @@ if (USE_KDU) llkdumem.h lltut.h ) - SET(llkdu_test_additional_INCLUDE_DIRS - ${KDU_INCLUDE_DIR} - ${LLKDU_INCLUDE_DIRS} - ) + LL_ADD_PROJECT_UNIT_TESTS(llkdu "${llkdu_TEST_SOURCE_FILES}") endif (LL_TESTS) -- cgit v1.2.3 From a4e273437262e435940d2fd2f75b72e0cf0ab1bc Mon Sep 17 00:00:00 2001 From: Nicky Date: Wed, 6 Apr 2022 20:23:21 +0200 Subject: Use kdu target --- indra/llkdu/CMakeLists.txt | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'indra/llkdu/CMakeLists.txt') diff --git a/indra/llkdu/CMakeLists.txt b/indra/llkdu/CMakeLists.txt index 035fc746cf..780951cf9d 100644 --- a/indra/llkdu/CMakeLists.txt +++ b/indra/llkdu/CMakeLists.txt @@ -14,7 +14,6 @@ include(LLCommon) include(LLImage) include(LLKDU) - set(llkdu_SOURCE_FILES llimagej2ckdu.cpp llkdumem.cpp @@ -43,10 +42,14 @@ set_source_files_properties(${llkdu_SOURCE_FILES} if (USE_KDU) add_library (llkdu ${llkdu_SOURCE_FILES}) - target_link_libraries(llkdu kdu::kdu ) + target_link_libraries(llkdu kdu::kdu llimage llcommon) + set_target_include_dirs( llkdu ${CMAKE_CURRENT_SOURCE_DIR}) # Add tests - if (LL_TESTS) + # ND: llkdu tests are very strange as they include stubs for KDU classes/methods + # if not having access to the right KDU version this test will fail to compile, incidentally I do not + # have access to a matching version of KDU and thus cannot get this tests to compile + if (LL_TESTS_KDU) include(LLAddBuildTest) include(Tut) SET(llkdu_TEST_SOURCE_FILES @@ -58,7 +61,11 @@ if (USE_KDU) lltut.h ) + get_property( llimage_include_dir TARGET llimage PROPERTY INTERFACE_INCLUDE_DIRECTORIES ) + set_property( SOURCE ${llkdu_TEST_SOURCE_FILES} PROPERTY LL_TEST_ADDITIONAL_LIBRARIES kdu::kdu llcommon) + set_property( SOURCE ${llkdu_TEST_SOURCE_FILES} PROPERTY LL_TEST_ADDITIONAL_INCLUDE_DIRS ${llimage_include_dir}) + LL_ADD_PROJECT_UNIT_TESTS(llkdu "${llkdu_TEST_SOURCE_FILES}") - endif (LL_TESTS) + endif (LL_TESTS_KDU) endif (USE_KDU) -- 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/llkdu/CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'indra/llkdu/CMakeLists.txt') diff --git a/indra/llkdu/CMakeLists.txt b/indra/llkdu/CMakeLists.txt index 780951cf9d..674ad04919 100644 --- a/indra/llkdu/CMakeLists.txt +++ b/indra/llkdu/CMakeLists.txt @@ -42,7 +42,7 @@ set_source_files_properties(${llkdu_SOURCE_FILES} if (USE_KDU) add_library (llkdu ${llkdu_SOURCE_FILES}) - target_link_libraries(llkdu kdu::kdu llimage llcommon) + target_link_libraries(llkdu ll::kdu llimage llcommon) set_target_include_dirs( llkdu ${CMAKE_CURRENT_SOURCE_DIR}) # Add tests @@ -62,7 +62,7 @@ if (USE_KDU) ) get_property( llimage_include_dir TARGET llimage PROPERTY INTERFACE_INCLUDE_DIRECTORIES ) - set_property( SOURCE ${llkdu_TEST_SOURCE_FILES} PROPERTY LL_TEST_ADDITIONAL_LIBRARIES kdu::kdu llcommon) + set_property( SOURCE ${llkdu_TEST_SOURCE_FILES} PROPERTY LL_TEST_ADDITIONAL_LIBRARIES ll::kdu llcommon) set_property( SOURCE ${llkdu_TEST_SOURCE_FILES} PROPERTY LL_TEST_ADDITIONAL_INCLUDE_DIRS ${llimage_include_dir}) LL_ADD_PROJECT_UNIT_TESTS(llkdu "${llkdu_TEST_SOURCE_FILES}") -- 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/llkdu/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/llkdu/CMakeLists.txt') diff --git a/indra/llkdu/CMakeLists.txt b/indra/llkdu/CMakeLists.txt index 674ad04919..aef8dea53f 100644 --- a/indra/llkdu/CMakeLists.txt +++ b/indra/llkdu/CMakeLists.txt @@ -43,7 +43,7 @@ if (USE_KDU) add_library (llkdu ${llkdu_SOURCE_FILES}) target_link_libraries(llkdu ll::kdu llimage llcommon) - set_target_include_dirs( llkdu ${CMAKE_CURRENT_SOURCE_DIR}) + target_include_directories( llkdu INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}) # Add tests # ND: llkdu tests are very strange as they include stubs for KDU classes/methods -- 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/llkdu/CMakeLists.txt | 4 ---- 1 file changed, 4 deletions(-) (limited to 'indra/llkdu/CMakeLists.txt') diff --git a/indra/llkdu/CMakeLists.txt b/indra/llkdu/CMakeLists.txt index aef8dea53f..7cd9f5eb24 100644 --- a/indra/llkdu/CMakeLists.txt +++ b/indra/llkdu/CMakeLists.txt @@ -21,14 +21,10 @@ set(llkdu_SOURCE_FILES set(llkdu_HEADER_FILES CMakeLists.txt - llimagej2ckdu.h llkdumem.h ) -set_source_files_properties(${llkdu_HEADER_FILES} - PROPERTIES HEADER_FILE_ONLY TRUE) - list(APPEND llkdu_SOURCE_FILES ${llkdu_HEADER_FILES}) # Our KDU package is built with KDU_X86_INTRINSICS in its .vcxproj file. -- cgit v1.2.3