summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--indra/cmake/OpenJPEG.cmake10
-rw-r--r--indra/llimagej2coj/llimagej2coj.cpp6
2 files changed, 11 insertions, 5 deletions
diff --git a/indra/cmake/OpenJPEG.cmake b/indra/cmake/OpenJPEG.cmake
index 87c59ad5ae..6de03113ed 100644
--- a/indra/cmake/OpenJPEG.cmake
+++ b/indra/cmake/OpenJPEG.cmake
@@ -4,17 +4,17 @@ include(Prebuilt)
include_guard()
add_library( ll::openjpeg INTERFACE IMPORTED )
-if (NOT (USE_AUTOBUILD_3P OR USE_CONAN))
+if (NOT USESYSTEMLIBS)
+use_system_binary(openjpeg)
+use_prebuilt_binary(openjpeg)
+elseif (NOT LINUX)
include(FindPkgConfig)
pkg_check_modules(Openjpeg REQUIRED libopenjp2)
target_include_directories(ll::openjpeg SYSTEM INTERFACE ${Openjpeg_INCLUDE_DIRS})
target_link_directories(ll::openjpeg INTERFACE ${Openjpeg_LIBRARY_DIRS})
target_link_libraries(ll::openjpeg INTERFACE ${Openjpeg_LIBRARIES})
return ()
-endif ()
-
-use_system_binary(openjpeg)
-use_prebuilt_binary(openjpeg)
+endif (NOT USESYSTEMLIBS)
target_link_libraries(ll::openjpeg INTERFACE openjp2 )
target_include_directories( ll::openjpeg SYSTEM INTERFACE ${LIBS_PREBUILT_DIR}/include)
diff --git a/indra/llimagej2coj/llimagej2coj.cpp b/indra/llimagej2coj/llimagej2coj.cpp
index 26043b2d8b..67cd9d572d 100644
--- a/indra/llimagej2coj/llimagej2coj.cpp
+++ b/indra/llimagej2coj/llimagej2coj.cpp
@@ -28,9 +28,15 @@
#include "llimagej2coj.h"
// this is defined so that we get static linking.
+#if LL_LINUX || !LL_USESYSTEMLIBS
#include "openjpeg/openjpeg.h"
#include "openjpeg/event.h"
#include "openjpeg/cio.h"
+#else
+#include <openjpeg-2.5/openjpeg.h>
+#include <openjpeg-2.5/event.h>
+#include <openjpeg-2.5/cio.h>
+#endif
#define MAX_ENCODED_DISCARD_LEVELS 5