cmake is even easier than would I could ever hope for. At the moment what I ask myself is, how can I create one (or multiple) CMakeLists.txt
file(s) such that the following project structure works:
my workspace
src
project1
project2
build
project1
project2
More concretely, I have the following two constraints that should determine both my project structure and my CMakeLists.txt
file:
1) I use git and would like to commit only CMakeLists.txt
and my source files, build should only by generated for each particular user who would like to work on this project via an IDE of his desire
2) If someone clones my repository, he will be able to run cmake that builds the directories as described above (/my workspace/build/project1
and /my workspace/build/project2
) for the IDE that he/she desires, such that he can work on this project
3) The src
directories should be clean such that anyone who works on the project can do this with his/her desired IDE, change src files and maybe CMakeLists.txt
and afterwards commits what he/she has done, so that everyone else can checkout again and work with it in the same way
Huge advantage for collaboration in that way! However, cmake
seems to build everything just into the directory where cmake
is called from.
Now, for the questions:
a) In order to create my desired directories with the corresponding builds, is there any other way than to call cmake
from newly build /my workspace/build/project1
and /my workspace/build/project2
folders?
b) Do you prefer a different directory structure to collaborate?
c) If yes to b), where do you put your CMakeLists.txt
file(s), from where do you call cmake
from and what is the general process for building?
d) QT creates moc files which seems to work fine. Do you commit them in any way or are they just put into the build directories for everyone who checks out and you make sure that they can be used?