I think I know the answer to this question, but I want to be sure, and possibly get an explanation.
I am working with a project (C + Fortran) that was created from CmakeLists.txt like this:
cmake -G "CodeBlocks - MinGW Makefiles"
I thought I could add source code files to the project via 'Add files...', but when I build the project the added code is not found and the link fails. It seems that CB is using the previously created makefiles (the 'Custom makefile' box is ticked in Properties) and ignoring the displayed list of files. If I untick the Custom makefile box I get build errors, whether I choose GNU GCC or GNU Fortran as the compiler. There is always the option of adding the files in CmakeLists.txt - that works.
I know that when I create a project within CB, without using cmake, I can add files any time. With a cmake-generated project, is it always necessary to edit CmakeLists.txt and rerun cmake? If it was just a matter of adding the source files it would be a non-issue, but when many libraries and search paths have been added within CB the changes needed in the cmake file become much more complicated, in fact I'm not sure how to make them. Adding them again within CB after rerunning cmake can be rather tedious.
I'm really trying to get a clearer idea of what happens 'under the hood' of CB.
Thanks
Gib
Modify message