How to define initial build options with CMakeLists.txt
-
Hi,
I have a project using CMakeLists.txt that I've been historically building from the CLI, and I wanted to switch to QtCreator.I want all my cmake projects to build under
build/Windows.x64
and to install all the exe files inbin/Windows.x64
. For that, I was usingcd build/Windows.x64 && cmake -DCMAKE_INSTALL_PREFIX=C:\Path\To\MyProject\bin\Windows.x64 ../..
to configure that.Now, with QtCreator, I can define the build destination by using the GUI, and I will likely be able to pass CMAKE_INSTALL_PREFIX in the same way. However, these settings will be saved in my
CMakeLists.txt.user
, which I'm not supposed to commit, if I understand correctly.Is there a way to configure these options and commit them, so that my coworker has nothing to configure to get up and running with QtCreator?
-
No, and I don't see a reason why someone should tell me where and how I should name my build directory.
-
@Christian-Ehrlicher Thanks for your reply. Coming from plain CMake and being able to define the folder structure was very flexible, and allowed me to define a common structure for the company, in order to automate stuffs (I need the compiled binaries elsewhere in the solution).
I guess the philosophy of QtCreator is more like "I use the folder that I want, stick with it", and I should adapt my build system to those folders... -
@cube45 said in How to define initial build options with CMakeLists.txt:
in order to automate stuffs (I need the compiled binaries elsewhere in the solution).
Using binaries from build dirs is no good idea.
-
Using binaries from build dirs is no good idea.
How do you publish your app then?
I've always taken my exe that were compiled in my install prefix, but I can't specify that either without playing with the QtCreator UI -
@cube45 said in How to define initial build options with CMakeLists.txt:
How do you publish your app then?
'make install' is your friend.