From 39160b692fd051f2638f1a6e1df38eb616b6d6cb Mon Sep 17 00:00:00 2001
From: Bernd Waibel <waebbl-gentoo@posteo.net>
Date: Sun, 30 Oct 2022 16:09:43 +0100
Subject: [PATCH] find libjpeg-turbo library

Signed-off-by: Bernd Waibel <waebbl-gentoo@posteo.net>
--- a/libsrc/visualization/CMakeLists.txt
+++ b/libsrc/visualization/CMakeLists.txt
@@ -7,7 +7,7 @@ target_sources(nggui PRIVATE
     vssolution.cpp
     visualpkg.cpp
 )
-target_link_libraries( nggui PUBLIC "$<BUILD_INTERFACE:netgen_python>" ${MPI_CXX_LIBRARIES} ${OPENGL_LIBRARIES} )
+target_link_libraries( nggui PUBLIC "$<BUILD_INTERFACE:netgen_python>" ${MPI_CXX_LIBRARIES} ${OPENGL_LIBRARIES} ${JPEG_LIBRARIES} )
 
 install(FILES
   meshdoc.hpp mvdraw.hpp visual_api.hpp
--- a/nglib/CMakeLists.txt
+++ b/nglib/CMakeLists.txt
@@ -7,6 +7,11 @@ endif(USE_OCC)
 
 target_link_libraries(nglib PUBLIC ngcore)
 
+if(TARGET JPEG::JPEG)
+    get_target_property(JPEG_LIBRARIES JPEG::JPEG IMPORTED_LOCATION_RELEASE)
+else()
+    set(JPEG_LIBRARIES ${JPEG_LIBRARY_RELEASE})
+endif()
 target_link_libraries( nglib PRIVATE ${MPI_CXX_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT} ${JPEG_LIBRARIES} ${MKL_LIBRARIES} ${ZLIB_LIBRARIES} ${OCC_LIBRARIES} netgen_cgns )
 
 install(TARGETS nglib netgen_cgns ${NG_INSTALL_DIR})
-- 
2.38.1

