Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

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 distribution 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?

share|improve this question
    
Ýou mean "deployment", not "distribution", I guess? You should change your question title and tags accordingly, if that's the case. Or are you talking about distributing your application as open source for free? Then you should add an "open-source" tag. –  Doc Brown Sep 5 '12 at 9:36
    
Thanks a lot ! I edited the question. –  vanna Sep 5 '12 at 11:31
add comment

2 Answers

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.

share|improve this answer
add comment

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 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.

share|improve this answer
    
Thanks for the answer. My question is certainly too broad. I just want to improve myself and it is really hard to find any accurate information about simple C++ program cross-platform deployment. It is just like everything is tacit for the developer community. I can find tons of tutorials for the coding part but nothing about how to deploy a set of source files. –  vanna Sep 4 '12 at 23:44
1  
@vanna I agree that many things seem to be assumed but it sounds like you have a great, open mindset so you'll get there. One thing I didn't say is have a look at similar apps and copy what they do. –  akton Sep 4 '12 at 23:47
    
+1 for copying existing patterns. But as patterns clearly exist I suspect the existence of guidelines ;) –  vanna Sep 4 '12 at 23:50
    
I would say a installer no matter the platform. Even if that installer is a simple script. Software, even on a Linux environment, is going more user friendly, and could be argued they pioneered the user friendly software with central repos for the largest flavors. –  TomJ Sep 5 '12 at 12:03
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.