How to add existing files to a CMake project?
-
@idlefrog said in How to add exiting files to a CMake project?:
Or should we always manually edit our CMakeLists.txt files?
You have to add them manually. Adding them automatically isn't really possible since the list of sources can be gathered from everywhere.
-
@idlefrog said in How to add exiting files to a CMake project?:
Or should we always manually edit our CMakeLists.txt files?
You have to add them manually. Adding them automatically isn't really possible since the list of sources can be gathered from everywhere.
@Christian-Ehrlicher Thank you for the help & quick response!
Now I've just got to understand why (after converting to cmake) I get the dreaded 'undefined reference to vtable for ...'
I did think just run 'cmake'... but no change...any ideas?
Sorry.. am a CMake beginner! -
@Christian-Ehrlicher Thank you for the help & quick response!
Now I've just got to understand why (after converting to cmake) I get the dreaded 'undefined reference to vtable for ...'
I did think just run 'cmake'... but no change...any ideas?
Sorry.. am a CMake beginner!@idlefrog Did you set AUTOMOC as suggested here: https://cmake.org/cmake/help/latest/prop_tgt/AUTOMOC.html ?
-
@idlefrog Did you set AUTOMOC as suggested here: https://cmake.org/cmake/help/latest/prop_tgt/AUTOMOC.html ?
-
Having converted to CMake. Does QtCreator allow you to add existing files to 'Sources'? This option is always greyed out from the project view context menu.
Or should we always manually edit our CMakeLists.txt files?[QtCreator 4.15]
Qt Creator 11 will add the source files to the
CMakeLists.txt
. See below an example of a Widgets application: