Bug 242749 - devel/cmake: Qt component Svg headers aren't added to include paths
Summary: devel/cmake: Qt component Svg headers aren't added to include paths
Status: Closed Works As Intended
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: freebsd-kde (group)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-12-20 23:25 UTC by Yuri Victorovich
Modified: 2019-12-21 06:33 UTC (History)
2 users (show)

See Also:
tcberner: maintainer-feedback+


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Yuri Victorovich freebsd_committer freebsd_triage 2019-12-20 23:25:27 UTC
I have
> find_package(Qt5 COMPONENTS Core Gui Widgets Svg REQUIRED)
in CMakeLists.txt

It uses this line to compile:
> /usr/bin/c++  -DQT_CORE_LIB -DQT_GUI_LIB -DQT_NO_DEBUG -DQT_WIDGETS_LIB -I/home/yuri/nn-insight/nn-insight_autogen/include -isystem /usr/local/include/qt5 -isystem /usr/local/include/qt5/QtWidgets -isystem /usr/local/include/qt5/QtGui -isystem /usr/local/include -isystem /usr/local/include/qt5/QtCore -isystem /usr/local/lib/qt5/mkspecs/freebsd-clang  -std=c++2a   -fPIC -o CMakeFiles/nn-insight.dir/svg-graphics-generator.cpp.o -c /home/yuri/nn-insight/svg-graphics-generator.cpp

This include statement
> #include <QSvgGenerator>
fails
> /home/yuri/nn-insight/svg-graphics-generator.cpp:4:10: fatal error: 'QSvgGenerator' file not found
> #include <QSvgGenerator>
         ^~~~~~~~~~~~~~~
because cmake failed to include /usr/local/include/qt5/QtSvg despite Svg being in the find_package line.
Comment 1 Yuri Victorovich freebsd_committer freebsd_triage 2019-12-20 23:26:04 UTC
cmake-3.15.5
Comment 2 Tobias C. Berner freebsd_committer freebsd_triage 2019-12-21 06:26:29 UTC
Hi Yuri

find_package does not setup any environment, it just defines some variables to add  to the environment.


How is the target setup? Do you use Qt5::Svg to depend on Svg there?


mfg Tobiasu
Comment 3 Yuri Victorovich freebsd_committer freebsd_triage 2019-12-21 06:33:37 UTC
Oh, I see, target_link_libraries needs Qt5::Svg added and then the headers get added.

Thanks Tobias!