With Qt5.15.1 and cmake.
Starting from a new blank qml project generated by qtCreator. I need to add a c file.
In CMakeLists.txt, I added the file like this:
add_executable(untitled1
main.cpp
mainwindow.cpp
mainwindow.h
mainwindow.ui
c_file.c
)
If I do a full build, here's the log file:
[ 20%] Automatic MOC and UIC for target untitled1
[ 20%] Built target untitled1_autogen
Scanning dependencies of target untitled1
[ 40%] Building CXX object CMakeFiles/untitled1.dir/untitled1_autogen/mocs_compilation.cpp.obj
[ 60%] Building CXX object CMakeFiles/untitled1.dir/main.cpp.obj
[ 80%] Building CXX object CMakeFiles/untitled1.dir/mainwindow.cpp.obj
[100%] Linking CXX executable untitled1.exe
[100%] Built target untitled1
As you can see, the c file is not compiled. What should I do?