Commit 15b5df83 authored by dickelbeck's avatar dickelbeck

CMAKE howto

parent 315850fa
How to build kicad:
kicad do not use configure (Use of Cmake is in progress)
it is compiled with make.
kicad needs wxWidgets (the multi platform G.U.I.)
How to build kicad using CMAKE.
19-Dec-2007
Kicad needs wxWidgets, the multi platform G.U.I.
Perform these steps in sequence. (Platform specific details are given in
sections below.)
1) If windows, then install "msys" and "mingw".
2) If windows, then install "opengl".
3) If linux, then install "mesa".
4) Make sure g++ and "make" are in your path.
5) Install wxWidgets [and build it if on windows].
6) Install CMAKE
7) Install the kicad source tree.
8) Use cmake to build the kicad makefiles.
9) Use make to build and install kicad.
10) Making a "Debug" build.
===== Step Details ====================================================
1) If windows, then install "msys" and "mingw".
Skip this step if on a Unix box. Get msys and mingw here:
http://mingw.org/
msys sets up a development environment that allows the bash shell to run.
mingw are a set of tools that run on windows or under msys. You will need
at least the following mingw packages: make, gcc, g++, binutils, autoconf, and
automake.
-----------------------------------------------------------------------------
2) If windows, then install "opengl". Google around for how to this. It
might already be installed.
-----------------------------------------------------------------------------
3) If linux, install "mesa". Use your package manager to install the development
libaries.
-----------------------------------------------------------------------------
4) Make sure g++ and "make" are in your path.
If windows, then try running g++ and make from within your msys bash shell.
-----------------------------------------------------------------------------
5) Install wxWidgets [and build it if on windows].
If on linux, use your package manager to install shared object libraries and the
development versions of the wxWidgets packages which include the C++ headers. An
alternative is to build static libaries from source. Verify that wx-config is in
your path by running it from a command prompt. Linux users then go to next step.
If on windows, download
http://prdownloads.sourceforge.net/wxwindows/wxMSW-2.8.7.zip or a newer version.
Start msys so you have a bash shell. Decide where your wxWidgets build directory
will be. It must be where you can access it from within the msys environment,
such as home/<user>. Edit your msys/1.0/etc/fstab file if needed to provide
access to this build directory from msys. Unzip the wmMWS zip file into this
build directory. Change directories into there, and then
rm *.cache
./configure --enable-unicode=yes --enable-shared=no --enable-monolithic --with-msw --with-opengl
make
make install
I think the default is to install into /usr/local/wxMSW-2.8.7. You can probably
pass --prefix=<wxInstallDir> to configure above to change where "make install"
puts everything. We will refer to <wxInstallDir> again below. Without the
--prefix=<wxInstallDir> passed to configure, <wxInstallDir> will likely be
/usr/local/wxMSW-2.8.7
Also note that if you want you can build a "debug" version of the wxWidgets
library at this point, instead of the release version, or in addition to the
the release version.
Verify that wx-config is in your path. Modify your PATH environment variable
if need be so you can run wx-config from a command prompt. You may have to
restart your msys shell, depending on how you modify your PATH.
-----------------------------------------------------------------------------
6) Install CMAKE.
If windows, download the installation binary for windows from cmake.org.
Install that and choose to add cmake to your path during installation. You
will have to restart and command shells for the new path to take effect.
Verify that cmake is in your path by trying to run it from a command prompt.
If linux, use your package manager to install cmake. You should get cmake 2.4.7
or later. If only an older one is available in your package repository, build
2.4.7 from source. Verify that cmake is in your path by trying to run it from a
command prompt.
-----------------------------------------------------------------------------
7) Install the kicad source tree.
You can use the subversion repository or a tar file for this. See the wiki.
-----------------------------------------------------------------------------
8) Use cmake to create the kicad makefiles.
If windows, go into your msys shell. Linux and windows users both then make
two "out of source" build directories:
cd <kicadSource>
mkdir release
mkdir debug
cd release
On either cmake command line shown below, you can optionally include
-DCMAKE_INSTALL_PREFIX=<finallInstallDir>
before the final .. argument.
If windows, run the following command:
cmake -G "MSYS Makefiles" -DCMAKE_BUILD_TYPE=Release -DwxWidgets_ROOT_DIR=<wxInstallDir> ..
If linux, run instead the following command:
cmake -DCMAKE_BUILD_TYPE=Release ../
Take a look at CMakeCache.txt, and in particular CMAKE_INSTALL_PREFIX, which
gives the final install directory. If not what you want, edit it with a text
editor and re-run the same cmake command again, but with no
-DCMAKE_INSTALL_PREFIX given on the command line.
-----------------------------------------------------------------------------
9) Use make to build and install kicad.
You compile Kicad here. You will only need to do step 8) again when one of the
CMakeLists.txt files change. If windows, you must be in your msys shell.
On either platform then:
cd <kicadSource>/release
make
[sudo] make install
You are now done unless you want to make a Debug build.
-----------------------------------------------------------------------------
10) Making a "Debug" build.
cd <kicadSource>/debug
On either cmake command line shown below, you can optionally include
-DCMAKE_INSTALL_PREFIX=<finallInstallDir> before the final .. argument. Although
normally you do not install the Debug binaries, you can debug them where they
were built.
If windows, run the following command:
cmake -G "MSYS Makefiles" -DCMAKE_BUILD_TYPE=Debug -DwxWidgets_ROOT_DIR=<wxInstallDir> ..
If linux, run instead the following command:
cmake -DCMAKE_BUILD_TYPE=Debug ../
Edit CMakeCache.txt, and look for the line that defines wxWidgets_CONFIG_EXECUTABLE:
wxWidgets_CONFIG_EXECUTABLE:FILEPATH=E:/usr/local/bin/wx-config
If you have debug libaries for wxWidgets, which should be the case if you installed
them in linux or if you built them on windows, then add "--debug" to the end of
the wx-config command, for example:
wxWidgets_CONFIG_EXECUTABLE:FILEPATH=E:/usr/local/bin/wx-config --debug
Re-run the same cmake command again as given above for your respective platform.
Make the Debug binaries:
make
Note that it is easy to build only a specific binary such as pcbnew alone:
make pcbnew
-----------------------------------------------------------------------------
End of CMAKE related building.
============= OLD STUFF NOT PERTINENT TO CMAKE ==============================
unzip sources in a working directory.
This will create the directory "kicad-dev".
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment