https://bugs.kde.org/show_bug.cgi?id=358192

            Bug ID: 358192
           Summary: karbon-pdf2svg and krita-jpegimport/export use/link to
                    first libjpeg found, should use jpeg defined by
                    JPEG_LIBRARY and JPEG_INCLUDE_DIR
           Product: calligracommon
           Version: unspecified
          Platform: Fink Packages
                OS: OS X
            Status: UNCONFIRMED
          Severity: normal
          Priority: NOR
         Component: general
          Assignee: calligra-bugs-n...@kde.org
          Reporter: niederstras...@gmail.com

During cmake configure, cmake finds a jpeg library and saves the library path
to JPEG_LIBRARY and the include directory path to JPEG_INCLUDE_DIR.  However,
when compiling the modules calligra_filter_pdf2svg.so, kritajpegexport.so, and
kritajpegimport.so, it does not add the include path to the compiler command.
And during linking , it uses the generic 'jpeg' instead.

It should be possible to add -DJPEG_INCLUDE_DIR -DJPEG_LIBRARY during the
configure step and the build should use those in the appropriate locations.

Reproducible: Always




Possible patch.  It makes sure that the desired JPEG_INCLUDE_DIR is known the
compiler, and that the correct JPEG_LIBRARY is used.

diff -ruN calligra-2.9.10-orig/filters/karbon/pdf/CMakeLists.txt
calligra-2.9.10/filters/karbon/pdf/CMakeLists.txt
--- calligra-2.9.10-orig/filters/karbon/pdf/CMakeLists.txt    2015-12-08
13:09:15.000000000 -0600
+++ calligra-2.9.10/filters/karbon/pdf/CMakeLists.txt    2016-01-18
16:56:54.000000000 -0600
@@ -10,7 +10,8 @@

 target_link_libraries(calligra_filter_pdf2svg komain ${POPPLER_LIBRARY}
${POPPLER_CORE_LIBRARY})
 if(JPEG_FOUND)
-    target_link_libraries(calligra_filter_pdf2svg jpeg)
+    include_directories( ${JPEG_INCLUDE_DIR} )
+    target_link_libraries(calligra_filter_pdf2svg ${JPEG_LIBRARY})
 endif()
 if(OPENJPEG_FOUND)
     target_link_libraries(calligra_filter_pdf2svg ${OPENJPEG_LIBRARIES})
diff -ruN calligra-2.9.10-orig/krita/plugins/formats/jpeg/CMakeLists.txt
calligra-2.9.10/krita/plugins/formats/jpeg/CMakeLists.txt
--- calligra-2.9.10-orig/krita/plugins/formats/jpeg/CMakeLists.txt   
2015-12-08 13:09:17.000000000 -0600
+++ calligra-2.9.10/krita/plugins/formats/jpeg/CMakeLists.txt    2016-01-16
16:50:50.000000000 -0600
@@ -4,6 +4,10 @@

 include_directories(${ICCJPEG_SOURCE_DIR})

+if(JPEG_FOUND)
+    include_directories( ${JPEG_INCLUDE_DIR} )
+endif()
+
 if(LCMS2_FOUND)
     include_directories( ${LCMS2_INCLUDE_DIR}
${CMAKE_SOURCE_DIR}/krita/image/metadata ${EXIV2_INCLUDE_DIR})
 else()
@@ -25,9 +29,9 @@
 kde4_add_plugin(kritajpegimport ${kritajpegimport_PART_SRCS})

 if(LCMS2_FOUND)
-    target_link_libraries(kritajpegimport kritaui ${KDE4_KIO_LIBS} jpeg
${LCMS2_LIBRARIES} ${EXIV2_LIBRARIES} )
+    target_link_libraries(kritajpegimport kritaui ${KDE4_KIO_LIBS}
${JPEG_LIBRARY} ${LCMS2_LIBRARIES} ${EXIV2_LIBRARIES} )
 else()
-    target_link_libraries(kritajpegimport kritaui ${KDE4_KIO_LIBS} jpeg
${LCMS_LIBRARIES} ${EXIV2_LIBRARIES} )
+    target_link_libraries(kritajpegimport kritaui ${KDE4_KIO_LIBS}
${JPEG_LIBRARY} ${LCMS_LIBRARIES} ${EXIV2_LIBRARIES} )
 endif()

 install(TARGETS kritajpegimport  DESTINATION ${PLUGIN_INSTALL_DIR})
@@ -44,9 +48,9 @@
 kde4_add_plugin(kritajpegexport ${kritajpegexport_PART_SRCS})

 if(LCMS2_FOUND)
-    target_link_libraries(kritajpegexport kritaui  ${KDE4_KIO_LIBS} jpeg
${LCMS2_LIBRARIES} ${EXIV2_LIBRARIES} )
+    target_link_libraries(kritajpegexport kritaui  ${KDE4_KIO_LIBS}
${JPEG_LIBRARY} ${LCMS2_LIBRARIES} ${EXIV2_LIBRARIES} )
 else()
-    target_link_libraries(kritajpegexport kritaui  ${KDE4_KIO_LIBS} jpeg
${LCMS_LIBRARIES} ${EXIV2_LIBRARIES} )
+    target_link_libraries(kritajpegexport kritaui  ${KDE4_KIO_LIBS}
${JPEG_LIBRARY} ${LCMS_LIBRARIES} ${EXIV2_LIBRARIES} )
 endif()

 install(TARGETS kritajpegexport  DESTINATION ${PLUGIN_INSTALL_DIR})
diff -ruN calligra-2.9.10-orig/krita/plugins/formats/jpeg/tests/CMakeLists.txt
calligra-2.9.10/krita/plugins/formats/jpeg/tests/CMakeLists.txt
--- calligra-2.9.10-orig/krita/plugins/formats/jpeg/tests/CMakeLists.txt   
2015-12-08 13:09:17.000000000 -0600
+++ calligra-2.9.10/krita/plugins/formats/jpeg/tests/CMakeLists.txt   
2016-01-16 15:30:12.000000000 -0600
@@ -1,6 +1,10 @@
 set( EXECUTABLE_OUTPUT_PATH ${CMAKE_CURRENT_BINARY_DIR} )
 include_directories(     ${CMAKE_SOURCE_DIR}/krita/sdk/tests )

+if(JPEG_FOUND)
+    include_directories( ${JPEG_INCLUDE_DIR} )
+endif()
+
 macro_add_unittest_definitions()

 ########### next target ###############

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to