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/cmake/LLKDU.cmake | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) (limited to 'indra/cmake/LLKDU.cmake') diff --git a/indra/cmake/LLKDU.cmake b/indra/cmake/LLKDU.cmake index e478b01f84..25762ab066 100644 --- a/indra/cmake/LLKDU.cmake +++ b/indra/cmake/LLKDU.cmake @@ -7,15 +7,23 @@ if (INSTALL_PROPRIETARY) set(USE_KDU ON CACHE BOOL "Use Kakadu library.") endif (INSTALL_PROPRIETARY) +if( TARGET kdu::kdu ) + return() +endif() +create_target( kdu::kdu ) + if (USE_KDU) include(Prebuilt) use_prebuilt_binary(kdu) if (WINDOWS) - set(KDU_LIBRARY kdu.lib) + set_target_libraries( kdu::kdu kdu.lib) else (WINDOWS) - set(KDU_LIBRARY libkdu.a) + set_target_libraries( kdu::kdu libkdu.a) endif (WINDOWS) - set(KDU_INCLUDE_DIR ${AUTOBUILD_INSTALL_DIR}/include/kdu) - set(LLKDU_INCLUDE_DIRS ${LIBS_OPEN_DIR}/llkdu) - set(LLKDU_LIBRARIES llkdu) + set_target_libraries( kdu::kdu kdu.lib) + + set_target_include_dirs( kdu::kdu + ${AUTOBUILD_INSTALL_DIR}/include/kdu + ${LIBS_OPEN_DIR}/llkdu + ) endif (USE_KDU) -- cgit v1.2.3 From 495b35032ce5616cfe99f0fcb58c8963a7454929 Mon Sep 17 00:00:00 2001 From: Nicky Date: Wed, 6 Apr 2022 20:22:13 +0200 Subject: Remove erroneous lines. --- indra/cmake/LLKDU.cmake | 1 - 1 file changed, 1 deletion(-) (limited to 'indra/cmake/LLKDU.cmake') diff --git a/indra/cmake/LLKDU.cmake b/indra/cmake/LLKDU.cmake index 25762ab066..a0463be635 100644 --- a/indra/cmake/LLKDU.cmake +++ b/indra/cmake/LLKDU.cmake @@ -20,7 +20,6 @@ if (USE_KDU) else (WINDOWS) set_target_libraries( kdu::kdu libkdu.a) endif (WINDOWS) - set_target_libraries( kdu::kdu kdu.lib) set_target_include_dirs( kdu::kdu ${AUTOBUILD_INSTALL_DIR}/include/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/cmake/LLKDU.cmake | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'indra/cmake/LLKDU.cmake') diff --git a/indra/cmake/LLKDU.cmake b/indra/cmake/LLKDU.cmake index a0463be635..a57c3d8715 100644 --- a/indra/cmake/LLKDU.cmake +++ b/indra/cmake/LLKDU.cmake @@ -7,21 +7,19 @@ if (INSTALL_PROPRIETARY) set(USE_KDU ON CACHE BOOL "Use Kakadu library.") endif (INSTALL_PROPRIETARY) -if( TARGET kdu::kdu ) - return() -endif() -create_target( kdu::kdu ) +include_guard() +create_target( ll::kdu ) if (USE_KDU) include(Prebuilt) use_prebuilt_binary(kdu) if (WINDOWS) - set_target_libraries( kdu::kdu kdu.lib) + set_target_libraries( ll::kdu kdu.lib) else (WINDOWS) - set_target_libraries( kdu::kdu libkdu.a) + set_target_libraries( ll::kdu libkdu.a) endif (WINDOWS) - set_target_include_dirs( kdu::kdu + set_target_include_dirs( ll::kdu ${AUTOBUILD_INSTALL_DIR}/include/kdu ${LIBS_OPEN_DIR}/llkdu ) -- cgit v1.2.3 From 6d0bba9c03da0d8aca5e88fcb9289cb2f89f3467 Mon Sep 17 00:00:00 2001 From: Nicky Date: Sun, 17 Apr 2022 17:32:14 +0200 Subject: Switch over to standard target_link_libraries (cmake requirements are high enough now). --- indra/cmake/LLKDU.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'indra/cmake/LLKDU.cmake') diff --git a/indra/cmake/LLKDU.cmake b/indra/cmake/LLKDU.cmake index a57c3d8715..08a8229a33 100644 --- a/indra/cmake/LLKDU.cmake +++ b/indra/cmake/LLKDU.cmake @@ -14,9 +14,9 @@ if (USE_KDU) include(Prebuilt) use_prebuilt_binary(kdu) if (WINDOWS) - set_target_libraries( ll::kdu kdu.lib) + target_link_libraries( ll::kdu INTERFACE kdu.lib) else (WINDOWS) - set_target_libraries( ll::kdu libkdu.a) + target_link_libraries( ll::kdu INTERFACE libkdu.a) endif (WINDOWS) set_target_include_dirs( ll::kdu -- 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/cmake/LLKDU.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/cmake/LLKDU.cmake') diff --git a/indra/cmake/LLKDU.cmake b/indra/cmake/LLKDU.cmake index 08a8229a33..bf358cc0eb 100644 --- a/indra/cmake/LLKDU.cmake +++ b/indra/cmake/LLKDU.cmake @@ -19,7 +19,7 @@ if (USE_KDU) target_link_libraries( ll::kdu INTERFACE libkdu.a) endif (WINDOWS) - set_target_include_dirs( ll::kdu + target_include_directories( ll::kdu SYSTEM INTERFACE ${AUTOBUILD_INSTALL_DIR}/include/kdu ${LIBS_OPEN_DIR}/llkdu ) -- cgit v1.2.3 From 363f2df4fa22b3eb95ff4603d73b7a042f3fefd1 Mon Sep 17 00:00:00 2001 From: Nicky Date: Sun, 17 Apr 2022 18:28:55 +0200 Subject: Remove function create_target and instead directly use add_library --- indra/cmake/LLKDU.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/cmake/LLKDU.cmake') diff --git a/indra/cmake/LLKDU.cmake b/indra/cmake/LLKDU.cmake index bf358cc0eb..fda25610da 100644 --- a/indra/cmake/LLKDU.cmake +++ b/indra/cmake/LLKDU.cmake @@ -8,7 +8,7 @@ if (INSTALL_PROPRIETARY) endif (INSTALL_PROPRIETARY) include_guard() -create_target( ll::kdu ) +add_library( ll::kdu INTERFACE IMPORTED ) if (USE_KDU) include(Prebuilt) -- cgit v1.2.3