Answer the question
In order to leave comments, you need to log in
How to automate the assembly of program dependencies?
I am developing a program in C++. To build the program, I use Visual Studio 2013 (2017) as well as CMake (I have not completely switched to CMake yet). Some modules of the program are cross-platform.
The program depends on a dozen or so libraries. Now I collect them manually every time. For me, this is a headache.
Moreover, the libraries are assembled in different ways, some using CMake, others (like boost) using their build system, others use the Makefile, the fourth ones are generally supplied as bare sources. Some require generally msys2 for assembly.
I think how to simplify this process and automate. I want a person to be able to download my project, run the command, and the dependencies are assembled and copied to the correct folder. What do you advise? How is it solved in other projects?
Answer the question
In order to leave comments, you need to log in
Look towards any dependency manager like Conan or vcpkg. Conan definitely has CMake integration. Just keep in mind that you still have to write a lot of things by hand. Dependency management is a pain in the ass in C++. the language is very old. Usually all companies have their own bikes for this.
With the help of the CMake + Conan bundle, it's really possible to get what you want.
The next step is to create an installer for the already compiled program, which will install the program on the user's computer. It's actually even worse here :) But that's another question.
How is it solved in other projects?
Take the same make, we are all used to the fact that makefiles contain some kind of autogenerated epic code, which no one has fully understood for a long time, but in general this is a good system for automatic file version control and dependency-based assembly.
When you write
целевой_файл:используемые файлы
командная строка для сборки целевого файла
you're actually describing a process where make checks the versions of the used files along the dependency chains automatically and runs the appropriate commands. Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question