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.
cmake-3.15.5
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
Oh, I see, target_link_libraries needs Qt5::Svg added and then the headers get added. Thanks Tobias!