|
Packit |
575503 |
CMake is a build automation system
|
|
Packit |
575503 |
http://en.wikipedia.org/wiki/Cmake
|
|
Packit |
575503 |
|
|
Packit |
575503 |
We try to use it as a replacement for the established GNU build system.
|
|
Packit |
575503 |
This attempt is currently only experimental. If you wonder why anyone
|
|
Packit |
575503 |
should do this, read
|
|
Packit |
575503 |
|
|
Packit |
575503 |
Why the KDE project switched to CMake -- and how
|
|
Packit |
575503 |
http://lwn.net/Articles/188693/
|
|
Packit |
575503 |
Escape from GNU Autohell!
|
|
Packit |
575503 |
http://www.shlomifish.org/open-source/anti/autohell
|
|
Packit |
575503 |
|
|
Packit |
575503 |
- How can I get GNU Awk compiled with CMake as fast as possible ?
|
|
Packit |
575503 |
git clone git://git.savannah.gnu.org/gawk.git
|
|
Packit |
575503 |
cd gawk
|
|
Packit |
575503 |
git checkout cmake
|
|
Packit |
575503 |
mkdir build
|
|
Packit |
575503 |
cd build
|
|
Packit |
575503 |
cmake ..
|
|
Packit |
575503 |
make
|
|
Packit |
575503 |
./gawk --version
|
|
Packit |
575503 |
make test
|
|
Packit |
575503 |
Notice that this git-checkout allows you to read the source code,
|
|
Packit |
575503 |
track the cmake branch and get updates. You will not be able to
|
|
Packit |
575503 |
commit anything.
|
|
Packit |
575503 |
|
|
Packit |
575503 |
- How can I use git to contribute source code ?
|
|
Packit |
575503 |
You need an account at Savannah. Read this to understand the first steps:
|
|
Packit |
575503 |
http://savannah.gnu.org/maintenance/UsingGit
|
|
Packit |
575503 |
README.git
|
|
Packit |
575503 |
Use your account there to register your public ssh key at Savannah.
|
|
Packit |
575503 |
Then you are ready to checkout. Remember that (when cloning) you are
|
|
Packit |
575503 |
setting up your own local repository and make sure you configure it
|
|
Packit |
575503 |
properly.
|
|
Packit |
575503 |
git clone ssh://my_account_name@git.sv.gnu.org/srv/git/gawk.git
|
|
Packit |
575503 |
git config --global user.name "first-name last-name"
|
|
Packit |
575503 |
git config --global user.email First.Last@email.com
|
|
Packit |
575503 |
git config --global color.ui auto
|
|
Packit |
575503 |
|
|
Packit |
575503 |
- What is the current status of the cmake branch ?
|
|
Packit |
575503 |
It has just begun, pre-alpha, unclear if it will ever be taken up
|
|
Packit |
575503 |
by the maintainer. We want to study if using CMake with such a
|
|
Packit |
575503 |
basic tool like gawk is feasible and if it easier to use than
|
|
Packit |
575503 |
the GNU build system.
|
|
Packit |
575503 |
|
|
Packit |
575503 |
- Where can I find a tutorial on CMake basics ?
|
|
Packit |
575503 |
Use the "official tutorial":
|
|
Packit |
575503 |
http://www.cmake.org/cmake/help/cmake_tutorial.html
|
|
Packit |
575503 |
|
|
Packit |
575503 |
- Where is the reference of all commands and variables ?
|
|
Packit |
575503 |
Depending on the CMake version you use, select one of these:
|
|
Packit |
575503 |
http://www.cmake.org/cmake/help/v2.8.10/cmake.html
|
|
Packit |
575503 |
|
|
Packit |
575503 |
- How can I cross-compile ?
|
|
Packit |
575503 |
Proceed in the same way as explained above for native compilation,
|
|
Packit |
575503 |
but use a different build directory. When using CMake, do this:
|
|
Packit |
575503 |
cmake -DCMAKE_TOOLCHAIN_FILE=../cmake/Toolchain_mingw32.cmake ..
|
|
Packit |
575503 |
Write a new Toolchain file for your cross-compiler and use it.
|
|
Packit |
575503 |
|
|
Packit |
575503 |
- How can I build an installable file ?
|
|
Packit |
575503 |
By default, installable files will not be generated.
|
|
Packit |
575503 |
But if you instruct CMake about the kind of installable file you want,
|
|
Packit |
575503 |
then some kinds of files can be generated.
|
|
Packit |
575503 |
The exact kind of installable file depends on your operating system.
|
|
Packit |
575503 |
Possible kinds are TGZ (.tar.gz file), RPM (.rpm file), and DEB (.deb file).
|
|
Packit |
575503 |
cmake -DCPACK_GENERATOR=DEB ..
|
|
Packit |
575503 |
make package
|
|
Packit |
575503 |
|
|
Packit |
575503 |
- Can I build an executable that runs on any Win32 platform ?
|
|
Packit |
575503 |
Yes, there are two ways of doing this.
|
|
Packit |
575503 |
In both cases you need a MinGW compiler and the NSIS package builder
|
|
Packit |
575503 |
installed on the host that shall do the build.
|
|
Packit |
575503 |
http://sourceforge.net/projects/mingw
|
|
Packit |
575503 |
http://sourceforge.net/projects/nsis
|
|
Packit |
575503 |
When installed properly, the NSIS tool can even build an installer file
|
|
Packit |
575503 |
(a single .exe file that unpacks, registers and installs the gawk executable
|
|
Packit |
575503 |
and several other files).
|
|
Packit |
575503 |
1. way: native build on a Win32 platform
|
|
Packit |
575503 |
http://www.cmake.org/cmake/help/runningcmake.html
|
|
Packit |
575503 |
After clicking "Configure" select the MinGW option with the default native compiler
|
|
Packit |
575503 |
In the build directory, the command "mingw32-make" will build the gawk.exe
|
|
Packit |
575503 |
The command "mingw32-make package" will build installer file
|
|
Packit |
575503 |
2. way: build with cross-compiler on a Linux platform like Ubuntu 12.04 LTS
|
|
Packit |
575503 |
Proceed as describe above for cross-compilers.
|
|
Packit |
575503 |
The command "make ; make package" will build gawk.exe and the installer file
|
|
Packit |
575503 |
|
|
Packit |
575503 |
- How can I run test cases ?
|
|
Packit |
575503 |
You can run all the test cases that are defined in test/Makefile.am.
|
|
Packit |
575503 |
These test case scripts were not changed, but the way they are invoked has
|
|
Packit |
575503 |
been adapted to CMake habits.
|
|
Packit |
575503 |
See http://cmake.org/Wiki/CMake/Testing_With_CTest#Simple_Testing
|
|
Packit |
575503 |
cmake ..
|
|
Packit |
575503 |
make
|
|
Packit |
575503 |
make test # run all test cases
|
|
Packit |
575503 |
ctest -N # list all test cases but don't run them
|
|
Packit |
575503 |
ctest -R BASIC # run all test cases belonging to group BASIC
|
|
Packit |
575503 |
ctest -R MPFR # run all test cases belonging to group MPFR
|
|
Packit |
575503 |
ctest -E SHLIB.filefunc # run all tests, except the SHLIB.filefunc test case
|
|
Packit |
575503 |
Remember that running test cases is possible only after a native build.
|
|
Packit |
575503 |
|