I have a very simple working console application written in C++ linked with a light static library. It is just for testing purposes. Now that the coding part is done, I would like to know the process of actually deploying the program. I wrote a very basic CMakeLists.txt that create makefiles or VS projects to build the sources. I also have a program that calls the static library in order to make some google tests.
To me, the deployment of this application goes like this:
- to developers : the src directory with the CMakeLists.txt file (multi-platform distribution) with a README.txt and an INSTALL.txt
- to users : the executable and a README.txt
- git repo : everything mentioned above plus the sources for testing and the gtest external lib
A this point : considering the complexity of my application, am I doing it right?
Is there any reference that would formalize this deployment process so I can get better and go further ? Say I would like to add dynamic libraries that can be updated, external libraries like boost : how should I package this to deploy it in a professional way?
1
It sounds like the question is not about distribution. Distribution is about getting the application to others and includes things like which sites do you host it on, how do they download it and get updates. See How to sell/distribute my software? for more information. Similarly, if you want to market your app (let people know about it), look at https://softwareengineering.stackexchange.com/questions/27078/what-is-the-best-way-to-introduce-software-created-by-you for some starting points. It sounds like you are asking more about the form the application should take when giving to customers and other developers.
Starting with customers, things to consider include how technical your customers are and what operating system they are running on. If the customers are technical people running on *nix, a readme and an executable are probably adequate. If you are writing an iPhone app, clearly not. The question infers you are targeting a *nix or Windows environment so I would at least consider an installer.
As for separating parts into dynamic libraries, this helps if you want to reference an existing library, release the library on a different schedule or reuse it in other applications. It is also useful for automated unit tests. Unfortunately, customers really do not care about any of these, except for potential version conflicts known as “DLL hell” on Windows.
As for developers, follow the conventions of our target operating system and language. If you are targeting *nix, a makefile is great. If you are targeting Windows, a Visual Studio project is useful. If you are doing cross platform development, a lowest common denominator approach may be the most maintainable.
However, the single biggest thing you can do is document your code. Most developers can work their way through even a complicated build process as long as they know how. A README or equivalent is a must with detailed instructions for building it, known issues and your contact details (such as an E-mail address or website).
As for should you split the code to external libraries or not, developers really do not care much, either, so long as the libraries work, are well maintained and you are not infringing any license agreements. The developer time and effort saved is worth it.
4
The complexity of your application is not the main factor – your audience is what makes the difference. So this is not really a technical problem, more an organizational one. If you build an application
-
just for yourself, you obviously have no effort to deploy
-
for a colleague who wants to use it, working next room to you: you can install it once for him
-
for some other people in your company: you may write an installation doc, or write some installation scripts
-
for other developers in your company: just put it into your common source code repo, they can check out the sources by themselves from there (make sure they can easily rebuild the program)
-
for other developers outside of your company: you may have to make your program cross-platform
-
for other users world-wide: you may provide a full-blown installer for each target system you have in mind.
Also, the question what to do with “dynamic libraries” can only be answered depending on the audience. Users of your application are typically not interested in what libs you have used, they just want your application to “work”, so make sure the library version you have used at development time will be provided with your application (or at least can be easily installed). In contrast, other devs will most probably want to know which lib version to install/use to get your application compiled.
If you want something to read, google for “software deployment book”, you will find plenty of literature, mostly system dependent.