Turnkey distribution of Qt Creator Projects and Libraries?
I am trying to set up a group of Qt Creator projects, with several custom libraries shared between them. All of these use C++11 and Boost and are managed in Git repositories.
Currently I am using CMake and symbolic links. So the existing directory structure looks roughly like:
projects/ libraryOne/ include/ libraryOne/ ; Parent in -I paths, then #include "libraryOne/foo.h" src/ libraryTwo/ include/ libraryTwo/ src/ libraryOne/ ; symbolic link libraryThree/ include/ libraryThree/ src/ libraryTwo/ ; symbolic link applicationOne/ CMakeLists.txt libraryOne/ ; symbolic link libraryTwo/ ; symbolic link libraryThree/ ; symbolic link build/ applicationTwo/ CMakeLists.txt libraryOne/ ; symbolic link libraryTwo/ ; symbolic link libraryThree/ ; symbolic link build/ applicationThree/ CMakeLists.txt libraryOne/ ; symbolic link libraryTwo/ ; symbolic link libraryThree/ ; symbolic link build/
To build a given application, I go into the build/ subdirectory of that app and run cmake .. so it will generate the makefiles from CMakeLists.txt (so it will put all the intermediaries and build products underneath build/). Then I run make.
This is how this particular setup evolved, and it's rather clunky. I want to remove the CMake dependency and make it trivial for someone who has Qt Creator to git clone my individual source repositories, one or more of the applications, load a .pro file, then press Build and have it work.
- No need to create symbolic links
- Adding and removing files should be doable in the GUI without need to edit a makefile
- Loading an application into the editor should make the libraries available to edit as well, and the build dependencies should be taken care of automatically
- In Debug mode, you should be able to set a breakpoint in any of the libraries and the environment can stop on it
- Put the object files and executables in a directory that isn't a subdirectory of the source code
I'm wondering if there is a "clean" example of something like this...are there any good examples to follow in the Qt Creator universe? Too ambitious to expect .pro files to automatically handle this kind of thing cross platform?
The .pro files will in fact handle it for you. I have answered how to do it in another question.