[CMake] Question about distribution questions

Eric Noulard eric.noulard at gmail.com
Fri Sep 21 07:23:58 EDT 2007


2007/9/21, Joachim Ziegler <ziegler at mpi-sb.mpg.de>:
> Hello list,
>
> I am new to cmake and I have just read the FAQ
>
> http://www.cmake.org/Wiki/CMake_FAQ#Distribution_questions
>
> I have also studied the CPack documentation, but I am still wondering
> the following:
>
>  > CMake doesn't create a "make dist" target.
>
> Does this simply mean that there is no target with this name (but some
> other way to do it),

CMake _ALONE_ does not create package, CPack does.
When CPack is used (i.e. INCLUDE(CPack) in your CMakeLists.txt)
you get 2 more targets:

package
package_source

package is for building binary package
package_source is for building source package (more like autotools make dist)

(note that if you don't know which makefile target is generated by CMake
 you may try

 make help

 which gives you the available target)

>
> If not so: How can I make a package consisting of files a.h, a.cpp, b.h,
> b.cpp, main.cpp (which compile well on my machine with cmake) that can
> be unpacked and compiled on my customer's machine?

Write you CMakeLists.txt
make it work for:
  1 -  compiling your project (i.e. no error when calling 'make')
  2 -  installing your project (i.e. no error when calling 'make install')

after that you should include
INCLUDE(CPack) in your CMakeLists.txt (the one where there is PROJECT)

then run

  3 - make package_source

you will end-up with a file like
 <packagename>-Source.tar.gz you may give to your customers.

The customer should do:

1 - unpack i.e. tar zxvf <packagename>.tar.gz
     which creates
2 - create a build tree
     run cmake
3 - make
4 - make install

We did add a paragraph on this in our TSP Programming Tutorial:
http://download.savannah.nongnu.org/releases/tsp/documentations/tsp_programming_tutorial-1.0.pdf

look at

2.3.2 TSP source installation for Unix

> Concerning this topic, I find the documentation of CPack quite confusing.

We lack documentation for CPack.
I lack time to write one :=)

I may write a CMake+CPack primer if I found time.
I may review yours if you write one :=)

-- 
Erk


More information about the CMake mailing list