cmake. add_subdirectory shows error "No such file or directory"
Unsolved
Qt Creator and other tools
-
Hello!
I want to move from the qmake to the cmake, that will my first experience with the cmake.
I need to add some subdirectory contains the CMakeLists (similar *.pri using the qmake).add_subdirectory(drc)
Inside the internal CMakeLists i added next:
cmake_minimum_required(VERSION 3.5) project(DRC) add_executable(DRC drcwidget.cpp drcwidget.h )
drcwidget uses QWidget. Finaly i got build error:
drc/drcwidget.h:4:10: fatal error: QWidget: No such file or directory
Why doesn't drc/CMakeLists.txt see QWidget included in main CMakeLists.txt?
-
When you use a Qt library you also have to link against it. See e.g. the documentation for QWidget class - the first table.