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/OpenJPEG.cmake | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) (limited to 'indra/cmake/OpenJPEG.cmake') diff --git a/indra/cmake/OpenJPEG.cmake b/indra/cmake/OpenJPEG.cmake index bf0bde2ba7..67292250bb 100644 --- a/indra/cmake/OpenJPEG.cmake +++ b/indra/cmake/OpenJPEG.cmake @@ -1,22 +1,16 @@ # -*- cmake -*- include(Prebuilt) -set(OPENJPEG_FIND_QUIETLY ON) -set(OPENJPEG_FIND_REQUIRED ON) +if( TARGET openjpeg::openjpeg ) + return() +endif() +create_target( openjpeg::openjpeg ) if (USESYSTEMLIBS) include(FindOpenJPEG) else (USESYSTEMLIBS) use_prebuilt_binary(openjpeg) - if(WINDOWS) - # Windows has differently named release and debug openjpeg(d) libs. - set(OPENJPEG_LIBRARIES - debug openjpegd - optimized openjpeg) - else(WINDOWS) - set(OPENJPEG_LIBRARIES openjpeg) - endif(WINDOWS) - - set(OPENJPEG_INCLUDE_DIR ${LIBS_PREBUILT_DIR}/include/openjpeg) + set_target_libraries(openjpeg::openjpeg openjpeg ) + set_target_include_dirs( openjpeg::openjpeg ${LIBS_PREBUILT_DIR}/include/openjpeg) endif (USESYSTEMLIBS) -- cgit v1.2.3 From d3521b4462195cfe882b2cc8eb4e7c5e948c0fb6 Mon Sep 17 00:00:00 2001 From: Nicky Date: Wed, 13 Apr 2022 10:28:46 +0200 Subject: Remove obsolete and unmaintained USE_SYSTEMLIBS --- indra/cmake/OpenJPEG.cmake | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'indra/cmake/OpenJPEG.cmake') diff --git a/indra/cmake/OpenJPEG.cmake b/indra/cmake/OpenJPEG.cmake index 67292250bb..e8aa231314 100644 --- a/indra/cmake/OpenJPEG.cmake +++ b/indra/cmake/OpenJPEG.cmake @@ -6,11 +6,7 @@ if( TARGET openjpeg::openjpeg ) endif() create_target( openjpeg::openjpeg ) -if (USESYSTEMLIBS) - include(FindOpenJPEG) -else (USESYSTEMLIBS) - use_prebuilt_binary(openjpeg) - - set_target_libraries(openjpeg::openjpeg openjpeg ) - set_target_include_dirs( openjpeg::openjpeg ${LIBS_PREBUILT_DIR}/include/openjpeg) -endif (USESYSTEMLIBS) +use_prebuilt_binary(openjpeg) + +set_target_libraries(openjpeg::openjpeg openjpeg ) +set_target_include_dirs( openjpeg::openjpeg ${LIBS_PREBUILT_DIR}/include/openjpeg) -- 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/OpenJPEG.cmake | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'indra/cmake/OpenJPEG.cmake') diff --git a/indra/cmake/OpenJPEG.cmake b/indra/cmake/OpenJPEG.cmake index e8aa231314..7d4d0f467a 100644 --- a/indra/cmake/OpenJPEG.cmake +++ b/indra/cmake/OpenJPEG.cmake @@ -1,12 +1,10 @@ # -*- cmake -*- include(Prebuilt) -if( TARGET openjpeg::openjpeg ) - return() -endif() -create_target( openjpeg::openjpeg ) +include_guard() +create_target( ll::openjpeg ) use_prebuilt_binary(openjpeg) -set_target_libraries(openjpeg::openjpeg openjpeg ) -set_target_include_dirs( openjpeg::openjpeg ${LIBS_PREBUILT_DIR}/include/openjpeg) +set_target_libraries(ll::openjpeg openjpeg ) +set_target_include_dirs( ll::openjpeg ${LIBS_PREBUILT_DIR}/include/openjpeg) -- 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/OpenJPEG.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/cmake/OpenJPEG.cmake') diff --git a/indra/cmake/OpenJPEG.cmake b/indra/cmake/OpenJPEG.cmake index 7d4d0f467a..139f6bc7d7 100644 --- a/indra/cmake/OpenJPEG.cmake +++ b/indra/cmake/OpenJPEG.cmake @@ -6,5 +6,5 @@ create_target( ll::openjpeg ) use_prebuilt_binary(openjpeg) -set_target_libraries(ll::openjpeg openjpeg ) +target_link_libraries(ll::openjpeg INTERFACE openjpeg ) set_target_include_dirs( ll::openjpeg ${LIBS_PREBUILT_DIR}/include/openjpeg) -- 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/OpenJPEG.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/cmake/OpenJPEG.cmake') diff --git a/indra/cmake/OpenJPEG.cmake b/indra/cmake/OpenJPEG.cmake index 139f6bc7d7..07dee5c23d 100644 --- a/indra/cmake/OpenJPEG.cmake +++ b/indra/cmake/OpenJPEG.cmake @@ -7,4 +7,4 @@ create_target( ll::openjpeg ) use_prebuilt_binary(openjpeg) target_link_libraries(ll::openjpeg INTERFACE openjpeg ) -set_target_include_dirs( ll::openjpeg ${LIBS_PREBUILT_DIR}/include/openjpeg) +target_include_directories( ll::openjpeg SYSTEM INTERFACE ${LIBS_PREBUILT_DIR}/include/openjpeg) -- 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/OpenJPEG.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/cmake/OpenJPEG.cmake') diff --git a/indra/cmake/OpenJPEG.cmake b/indra/cmake/OpenJPEG.cmake index 07dee5c23d..184fbb3c5f 100644 --- a/indra/cmake/OpenJPEG.cmake +++ b/indra/cmake/OpenJPEG.cmake @@ -2,7 +2,7 @@ include(Prebuilt) include_guard() -create_target( ll::openjpeg ) +add_library( ll::openjpeg INTERFACE IMPORTED ) use_prebuilt_binary(openjpeg) -- 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/cmake/OpenJPEG.cmake | 1 + 1 file changed, 1 insertion(+) (limited to 'indra/cmake/OpenJPEG.cmake') diff --git a/indra/cmake/OpenJPEG.cmake b/indra/cmake/OpenJPEG.cmake index 184fbb3c5f..b016c22a4e 100644 --- a/indra/cmake/OpenJPEG.cmake +++ b/indra/cmake/OpenJPEG.cmake @@ -4,6 +4,7 @@ include(Prebuilt) include_guard() add_library( ll::openjpeg INTERFACE IMPORTED ) +use_conan_binary(openjpeg) use_prebuilt_binary(openjpeg) target_link_libraries(ll::openjpeg INTERFACE openjpeg ) -- cgit v1.2.3 From 3f31d0b5a70af4ebf746d40d478b4e948e904a87 Mon Sep 17 00:00:00 2001 From: Nicky Date: Sun, 17 Jul 2022 17:51:25 +0200 Subject: Be more explicit: Rename use_conan_binary to use_system_binary, this will allow us to reuse the macro for more than just conan. --- indra/cmake/OpenJPEG.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/cmake/OpenJPEG.cmake') diff --git a/indra/cmake/OpenJPEG.cmake b/indra/cmake/OpenJPEG.cmake index b016c22a4e..f0311439bf 100644 --- a/indra/cmake/OpenJPEG.cmake +++ b/indra/cmake/OpenJPEG.cmake @@ -4,7 +4,7 @@ include(Prebuilt) include_guard() add_library( ll::openjpeg INTERFACE IMPORTED ) -use_conan_binary(openjpeg) +use_system_binary(openjpeg) use_prebuilt_binary(openjpeg) target_link_libraries(ll::openjpeg INTERFACE openjpeg ) -- cgit v1.2.3 From c844bf0ab8acbbb2d4ef0814d8ed7ac9291b7f44 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Fri, 17 Dec 2021 01:39:40 +0200 Subject: SL-16542 Pull in chunks of graham's openjpeg code, update openjpeg and enable partial bitstreams Openjpeg was modified: "p_max_len -= l_nb_bytes_read;" was causing an overflow. I'm not sure if I did something incorectly in opj_skip/opj_seek viewer side, but seems like openjpeg should have been checking remaining space in p_max_len either way. P.S. Many thanks to Chafey and Neopallium for implementing openjpeg's partial bitstream support --- indra/cmake/OpenJPEG.cmake | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) (limited to 'indra/cmake/OpenJPEG.cmake') diff --git a/indra/cmake/OpenJPEG.cmake b/indra/cmake/OpenJPEG.cmake index bf0bde2ba7..a078c97cb8 100644 --- a/indra/cmake/OpenJPEG.cmake +++ b/indra/cmake/OpenJPEG.cmake @@ -8,15 +8,7 @@ if (USESYSTEMLIBS) include(FindOpenJPEG) else (USESYSTEMLIBS) use_prebuilt_binary(openjpeg) - - if(WINDOWS) - # Windows has differently named release and debug openjpeg(d) libs. - set(OPENJPEG_LIBRARIES - debug openjpegd - optimized openjpeg) - else(WINDOWS) - set(OPENJPEG_LIBRARIES openjpeg) - endif(WINDOWS) - - set(OPENJPEG_INCLUDE_DIR ${LIBS_PREBUILT_DIR}/include/openjpeg) + + set(OPENJPEG_LIBRARIES openjp2) + set(OPENJPEG_INCLUDE_DIR ${LIBS_PREBUILT_DIR}/include/openjpeg) endif (USESYSTEMLIBS) -- cgit v1.2.3