Including header breaks project
-
<Bar>is qt module I had to built from source.In
Foo.hI include<Bar>. The project compiles.In
Baz.hI includeFoo.h. The project breaks.Foo.handBaz.hare 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.hI include<Bar>. The<Bar>is found because it is provided by a qt module.In
Baz.hI 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.his included in a different target which did not link against the specific qt module. -
<Bar>is qt module I had to built from source.In
Foo.hI include<Bar>. The project compiles.In
Baz.hI includeFoo.h. The project breaks.Foo.handBaz.hare 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.hI include<Bar>. The<Bar>is found because it is provided by a qt module.In
Baz.hI 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.his included in a different target which did not link against the specific qt module. -
R Redman has marked this topic as solved on