[CMake] How to deliver a source code package?

Dave Ohlsson dave.ohlsson at gmail.com
Thu Jun 23 02:28:59 EDT 2011


> CMake suppose you have CMake.

OK.

> Send us your CMakeLists.txt, there is something odd here.

I tried on another machine (Red Hat Linux) with a newer version of
CMake (2.8.4), but I get the same results.

This is what I did:

I downloaded Step6.tar.gz from
http://public.kitware.com/cgi-bin/viewcvs.cgi/Tests/Tutorial/Step6/?root=CMake

Then:

$ tar xzvf Step6.tar.gz
Step6/
Step6/CMakeLists.txt
Step6/License.txt
Step6/TutorialConfig.h.in
Step6/tutorial.cxx
Step6/MathFunctions/
Step6/MathFunctions/CMakeLists.txt
Step6/MathFunctions/MakeTable.cxx
Step6/MathFunctions/MathFunctions.h
Step6/MathFunctions/mysqrt.cxx
$ mkdir Step6.build
$ cd Step6.build
$ cmake ../Step6
$ cpack -C CPackSourceConfig.cmake
$ tar xzvf Tutorial-1.0.1-Linux.tar.gz
Tutorial-1.0.1-Linux/bin/Tutorial
Tutorial-1.0.1-Linux/bin/libMathFunctions.a
Tutorial-1.0.1-Linux/include/TutorialConfig.h
Tutorial-1.0.1-Linux/include/MathFunctions.h

> What happen if you do:
>
> $ make package_source

$ cd ..
$ rm -fr Step6
$ rm -fr Step6.build
$ tar xzvf Step6.tar.gz
Step6/
Step6/CMakeLists.txt
Step6/License.txt
Step6/TutorialConfig.h.in
Step6/tutorial.cxx
Step6/MathFunctions/
Step6/MathFunctions/CMakeLists.txt
Step6/MathFunctions/MakeTable.cxx
Step6/MathFunctions/MathFunctions.h
Step6/MathFunctions/mysqrt.cxx
$ mkdir Step6.build
$ cd Step6.build
$ cmake ../Step6
$ make package_source
$ tar xzvf Tutorial-1.0.1-Source.tar.gz
Tutorial-1.0.1-Source/CMakeLists.txt
Tutorial-1.0.1-Source/License.txt
Tutorial-1.0.1-Source/TutorialConfig.h.in
Tutorial-1.0.1-Source/tutorial.cxx
Tutorial-1.0.1-Source/MathFunctions/CMakeLists.txt
Tutorial-1.0.1-Source/MathFunctions/MakeTable.cxx
Tutorial-1.0.1-Source/MathFunctions/MathFunctions.h
Tutorial-1.0.1-Source/MathFunctions/mysqrt.cxx

This looks better.

Thanks!

-- dave


More information about the CMake mailing list