Including header breaks project
-
<Bar>
is qt module I had to built from source.In
Foo.h
I include<Bar>
. The project compiles.In
Baz.h
I includeFoo.h
. The project breaks.Foo.h
andBaz.h
are part of the sameqt_add_qml_module()
CMakeLists.txt
qt_add_qml_module(${PROJECT_NAME} STATIC URI core.app VERSION 1.0 RESOURCE_PREFIX core/imports SOURCES src/plc/Bar.cpp src/plc/Bar.h src/plc/Foo.cpp src/plc/Foo.h DEPENDENCIES QtQuick ) ... target_link_libraries(${PROJECT_NAME} PRIVATE Qt${QT_VERSION_MAJOR}::Core Qt${QT_VERSION_MAJOR}::Quick Qt${QT_VERSION_MAJOR}::Bar )
Care to help?
-
@Christian-Ehrlicher I should've clarified that.
In
Foo.h
I include<Bar>
. The<Bar>
is found because it is provided by a qt module.In
Baz.h
I includeFoo.h
. The<Bar>
is NOT found anymore. Telling me it's not found inFoo.h
.Since this is a qt module, I do not have to provide an includepath via
target_include_directories()
. Just to see if it would've worked -> it did not. Not even explicitly telling cmake where to find the header workedEdit: Sleeping makes wonders!
Baz.h
is included in a different target which did not link against the specific qt module. -
-
@Christian-Ehrlicher I should've clarified that.
In
Foo.h
I include<Bar>
. The<Bar>
is found because it is provided by a qt module.In
Baz.h
I includeFoo.h
. The<Bar>
is NOT found anymore. Telling me it's not found inFoo.h
.Since this is a qt module, I do not have to provide an includepath via
target_include_directories()
. Just to see if it would've worked -> it did not. Not even explicitly telling cmake where to find the header workedEdit: Sleeping makes wonders!
Baz.h
is included in a different target which did not link against the specific qt module. -