﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	severity	resolution	keywords	cc
19206	Fix building Gwenview with kImageAnnotator-0.7.0	Douglas R. Reno	Douglas R. Reno	"When I was building Gwenview earlier, I encountered the following error:

{{{
CMake Warning at CMakeLists.txt:169 (find_package):
  By not providing ""FindkImageAnnotator.cmake"" in CMAKE_MODULE_PATH this
  project has asked CMake to find a package configuration file provided by
  ""kImageAnnotator"", but CMake did not find one.

  Could not find a package configuration file provided by ""kImageAnnotator""
  with any of the following names:

    kImageAnnotatorConfig.cmake
    kimageannotator-config.cmake

  Add the installation prefix of ""kImageAnnotator"" to CMAKE_PREFIX_PATH or
  set ""kImageAnnotator_DIR"" to a directory containing one of the above files.
  If ""kImageAnnotator"" provides a separate development package or SDK, be
  sure it has been installed.


-- libjpeg version: 62
}}}

I went hunting upstream a bit and I came across this issue: [https://invent.kde.org/graphics/gwenview/-/merge_requests/245], though this is for Qt6 (and trying to port it to the Qt5 version didn't turn out well).

Looking a bit further I was able to find a pull request at kImageAnnotator where this was changed originally: [https://github.com/ksnip/kImageAnnotator/pull/329] - where the Qt5 and Qt6 builds became coinstallable.

I found KDE's official flatpak build for Gwenview, where it was mentioned that Arch has a fix: [https://github.com/flathub/org.kde.gwenview/pull/122]

Arch's fix is to create symlinks from files in /usr/lib/cmake/kImageAnnotator-Qt5 to /usr/lib/cmake/kImageAnnotator. Since the next version of Gwenview (24.02) will be Qt6/KDE6 based we probably will need to do the same thing.

Here's what I had to do to make it build:

- sudo mkdir -pv /usr/lib/cmake/kImageAnnotator
- sudo ln -sfv /usr/lib/cmake/kImageAnnotator-Qt5/kImageAnnotator-Qt5Config.cmake /usr/lib/cmake/kImageAnnotator/kImageAnnotatorConfig.cmake
- sudo ln -sfv /usr/lib/cmake/kImageAnnotator-Qt5/kImageAnnotator-Qt5Config-version.cmake /usr/lib/cmake/kImageAnnotator/kImageAnnotatorConfig-version.cmake
- sudo ln -sfv /usr/lib/cmake/kImageAnnotator-Qt5/kImageAnnotator-Qt5Config-version.cmake /usr/lib/cmake/kImageAnnotator/kImageAnnotatorConfig-version.cmake
- sudo ln -sfv /usr/lib/cmake/kImageAnnotator-Qt5/kImageAnnotator-Qt5Config-version.cmake /usr/lib/cmake/kImageAnnotator/kImageAnnotatorConfig-version.cmake
- sudo ln -sfv /usr/lib/cmake/kImageAnnotator-Qt5/kImageAnnotator-targets* /usr/lib/cmake/kImageAnnotator/

This is identical to Arch's fix at [https://gitlab.archlinux.org/archlinux/packaging/packages/kimageannotator/-/commit/2c10232b81bfbf726e835fee8d04425dddd663d0]"	defect	closed	normal	12.1	BOOK	git	medium	fixed		
