Installation - CMake

Freetype NOT uses CMake

The Freetype you need to compile inside the thirdparty\freetype-2.4.2\builds\win32\vc2008 directory in case of windows, not build it using CMake and not in a seperate build tree. It has its own build system. For Linux, install the Freetype development package is enough.

Cmake ways

CMAKE_INSTALL_PREFIX

To install to a specific location, in Cmake you define this with setting CMAKE_INSTALL_PREFIX. This is the solution if you do not have root rights on Linux.

On windows this is default c:/Program Files/wxart2d and on Unix/Linux /usr/local In cmake-gui and/or ccmake you can set this in the advanced View.

CMAKE_VERBOSE_MAKEFILE

This sets makefile to show verbose compile and linked commands, ideal to copy paste as is, in order to find problems in linking etc.

Always try to build outside of the SVN tree which you checked out. First of all to not pollute the tree, which can interfere with subsequent build of other flavors of wxArt2D and/or its dependencies. If your wxArt2D is in /pathToTrunk/trunk/wxArt2D, put your debug build in something like /pathToTrunk/buildWxStaticDebug and you at the same time a release build can go into /pathToTrunk/buildWxStaticRelease.

All platforms

First create a build directory plus subdirectories (assuming klaas is the user):

cd /home/klaas/soft
mkdir buildart2ddeb
cd buildart2ddeb

Now all down here needs to be done.

Next steps need to be done by hand.

First directories are created in which the several packages will be build.

mkdir thirdparty
mkdir thirdparty/agg-2.4
mkdir thirdparty/kbool
mkdir packages
mkdir packages/wxdocview
mkdir packages/wxart2d

In wxArt2D those directories can also be found here pathTo/wxArt2D/build/unix/gcc_gtkud and pathTo/wxArt2D/build/unix/gcc_gtku. If you prefer, you can use those to build into.

Now configure using cmake or better cmake-gui to choose options, and build and install one by one. Make sure all the mentioned debug flags are set, since we are building the debug version here. The release version is done the same, but without the flag. If for instance debug flag is not set, release version is build, and a next step will fail. In cmake-gui with tthe Advanged switch, you can set CMAKE_VERBOSE_MAKEFILE, this often helps when building to see what is done exactly.

cd /home/klaas/soft/buildart2ddeb/thirdparty/agg-2.4
cmake-gui /home/klaas/soft/wxArt2D/thirdparty/agg-2.4
(set in cmake-gui agg_USE_DEBUG )
cd /home/klaas/soft/buildart2ddeb/thirdparty/agg-2.4
make
sudo make install

cd /home/klaas/soft/buildart2ddeb/thirdparty/kbool
cmake-gui /home/klaas/soft/wxArt2D/thirdparty/kbool
(set in cmake-gui kbool_USE_DEBUG )
cd /home/klaas/soft/buildart2ddeb/thirdparty/kbool
make
sudo make install

cd /home/klaas/soft/buildart2ddeb/packages/wxdocview
cmake-gui /home/klaas/soft/wxArt2D/packages/wxdocview
(set in cmake-gui wxWidgets_USE_DEBUG )
cd /home/klaas/soft/buildart2ddeb/packages/wxdocview
make
sudo make install

cd /home/klaas/soft/buildart2ddeb/packages/wxart2d
cmake-gui /home/klaas/soft/wxArt2D/packages/wxart2d
(set in cmake-gui wxWidgets_USE_DEBUG )
cd /home/klaas/soft/buildart2ddeb/packages/wxart2d
make
sudo make install

On windows same approach. But there you can get project files for each cmake configured project. If you choose the "NMAKE makefile generator" in cmake-gui, you can just type nmake, which will compile the package at hand.

configure

On Unix/Linux all the above is made into a script. This script generates the directories for you, check several things, and with options you can already set the most important CMake options. The script calls for each package CMake (cmake-gui or cmake), and after configuration with Cmake, it start the build step for that package.

Type configure -help to see some options.

On Linux for example:

../trunk/wxArt2D/configure -g -v --prefix /home/klaas/soft/usr/local 

On Windows the script is based on lua: ..\trunk\wxArt2D\bin\lua ..\trunk\wxArt2D\configure.lua -g -v 

Cmake on Windows

The cmake files used by wxArt2D always first look for the environment variable WXWIN, if it is set CMake will use it to to find the wxWidgets libraries. So Start/My Computer/ View System Information-> dialog system properties, choose tab advanced. OR on Windows XP click on the My Computer icon and use the Right Mouse to Edit Properties, This gives you a dialog called "System Properties" with several tabs. Here you choose the tab advanced. At the bottom you find a button Environment Variables, click it and add WXWIN either to the users or system variables. In my case it is set to: WXWIN e:/wxwin/wx262vc. If this variable is not set and you have only one version of wxWidgets installed, it will look in the registry for the place where wxWidgets library is installed. If you want to choose between different version of wxWidgets, just set the variable.

You can also open a DOS box and type the next:

set WXWIN=C:\whereIsYourWxWidgets\wxWidgets-2.8.8 
set WXLUA=C:\whereIsYourWxLua\wxLua --this one is optional
set WXSTEDIT=C:\whereIsYourWxStEdit\wxStEdit --this one is optional
set CMAKE=C:\whereIsYourCMake\CMake\bin 
set PATH=%CMAKE%;%PATH% 
cmake-gui.exe

You must start cmake-gui after setting these variables, else it will not know where the packages are.

First create the directories in your build directory:

cd C:/soft/svncheckout/trunk/wxArt2D
cd C:/soft/svncheckout
mkdir buildart2d291deb
cd buildart2d291deb
mkdir thirdparty
mkdir thirdparty/agg-2.4
mkdir thirdparty/kbool
mkdir packages
mkdir packages/wxdocview
mkdir packages/wxart2d

Next run cmake-gui on windows and click on the line "Where is the source installed" and browse to where you have installed wxArt2D and go to the right subpackage. Like for the kbool package goto C:/soft/svncheckout/trunk/wxArt2D/thirdparty/kbool, and on the line "Where to build binaries", you browse to a directory where you want the libraries to be build. ( here that is C:/soft/svncheckout/buildart2d291deb/thirdparty/kbool ) Again respect that there are several packages, which must be build in the right order. The next tells what to do from the commandline in a DOS BOX, these paths you can use in the cmake-gui tool directly also.

cd C:\soft\svncheckout\buildart2d291deb\thirdparty/agg-2.4
cmake-gui C:\soft\svncheckout\trunk\wxArt2D\thirdparty/agg-2.4
nmake
cd C:\soft\svncheckout\buildart2d291deb\thirdparty\kbool
cmake-gui C:\soft\svncheckout\trunk\wxArt2D\thirdparty\kbool
nmake
cd C:\soft\svncheckout\buildart2d291deb\packages\wxdocview
cmake-gui C:\soft\svncheckout\trunk\wxArt2D\packages\wxdocview
nmake
cd C:\soft\svncheckout\buildart2d291deb\packages\wxart2d
cmake-gui C:\soft\svncheckout\trunk\wxArt2D\packages\wxart2d
nmake

You can have several build directories if you want. Each one having its own specific settings. e.g. i have a build-debug and a build-debug-unicode etc., using cmake-gui you can modify the option for each build directory.

Choose in the "Build for line" the type of build you want to use. Now click the button configure twice, and check the path to where your wxWidgets distribution was installed. You can change them by hand if needed. Last click on Ok. Go into the directory you used for the build and type ( nmake for Visual C ). In case of generating project files, open those instead. ( for Vc it is called wxart2d.sln etc.)

Cmake on Unix

Compile wxWidgets the latest ( > 2.8.10 ) and make sure to use at least these options:

Make sure wx-config can be found, using the command which wx-config. If not extend the path to include the path to the place where wxWidgets was installed. The default place is /usr/local/bin/wx-config. In case you want to use the lua scripting language in wxArt2D, als install wxLua and wxStEdit. Set on the command line export WXLUA=/where is wxLua its code. Right, not only install, also the code is needed for wrapping!

Best use cmake-gui since i gives you an idea what can be set.

wxArt2D has been set up in such a way, that installation is not necessary, but if needed, type make install.

When using wxArt2D in your own program you need to set the following variable to find the libraries:

LD_LIBRARY_PATH=/usr/local/lib/wxart2d:$LD_LIBRARY_PATH 
export LD_LIBRARY_PATH

Cmake with Cygwin

Installation for Cygwin systems is similar to installation on unix, with some little differences. You must compile wxWidgets for Cygwin, and install it under Cygwin.

You must have the cmake distribution that is made for Cygwin, which you can find with the Cygwin setup.exe. Be sure to remove from the PATH (after running the cygwin shell) the path to the windows Cmake distribution, else all will be wrong. Same for the WXWIN variable set under DOS, do set it properly to the wxWidgets you compiled for Cygwin, and not to the one for windows itself. Do this before running cmake in the build directory you created next to wxArt2D its directory. Yes always build outside the distribution, in order to not mix things up. In principle one wxArt2D can be used for wxMSW and Cygwin and Mingw, as long as you build all of the outside the wxArt2D directory.

Check you have cmake-gui/ccmake/cmake by type which cmake, it needs to come from /usr/bin/cmake

wxWidgets uses expat internal, and wxArt2D uses that version too. But to bad, the expat header files are not installed by wxWidgets. In order to find the expat headers, make sure to set the WXWIN environment variable to where wxWidgets for Cygwin is installed. This will be used to find those headers.

WXWIN=/cygdrive/c/whereIsYourwxWidgets/wxWidgest2.8.8 
export WXWIN

Precompiled headers gave problems in cygwin so those are disabled, shared i could not manage too, due to import export issues.

Always remove this file if you did some trials before. rm configarg.cache

Now this is the line to configure wxWidgest ( debug mode ):

cd /cygdrive/c/whereIsYourwxWidgets/wxWidgets-2.6.X
. /configure --enable-debug --disable-shared

Followed of course by:

make make install

This will install wxWidgets in the /usr/local of your Cygwin installation.

Make sure wx-config can be found, using the command which wx-config. If not extend the path to include the path to the place where wxWidgets was installed. The default place is /usr/local/bin/wx-config. Now create a directory where you want to build wxArt2D, best outside the wxArt2D directory itself. e.g If you have /home/wxArt2D you create /home/buildwxArt2D

Now just type:

cd /whereIswxArt2D/wxArt2D/ 
cd /whereIswxArt2D/buildwxArt2D 
cmake-gui ../wxArt2D

This to set option etc.

OR

cmake ../wxArt2D

Now type make.

wxArt2D has been set up in such a way, that installation is not necessary, but if needed, type make install

Cmake with MinGW

Installation for MinGW systems is similar to installation on unix, with some little differences. There are two ways with MinGW see MinGW and MinGWMSys. The Unix way uses MSYS to configure, make and install wxWidgets.

Again make sure you compiled and installed wxWidgets properly for use in mingw, and do set the environment variable WXWIN to the wxWidgets distribution. For CMake itself you can use the standard windows executables. It is not like on Cygwin, where you need a special made set for Cygwin. Make sure the cmake executables can be found via the PATH. I just installed Cmake in /c/msys, making cmake.exe and cmake-gui.exe go into the /c/msys/bin directory, so they are always found.

wxWidgets uses expat internal, and wxArt2D uses that version too. But to bad, the expat header files are not installed by wxWidgets. In order to find the expat headers, make sure to set the WXWIN environment variable to where wxWidgets for MinGW is installed. This will be used to find those headers. Therefore using MSYS on the commandline do set WXWIN (so do NOT use the same setting as you did for wxMSW for instance ).

For more see MinGWMSys, in short:

WXWIN=/c/whereIsYourwxWidgets/wxWidgets-2.8.3 
export WXWIN

Make sure wx-config can be found, using the command which wx-config. If not extend the path to include the path to the place where wxWidgets was installed. The default place is /c/msys/local/bin/wx-config. Now create a directory where you want to build wxArt2D, best outside the wxArt2D directory itself. e.g If you have /c/home/wxArt2D you create /c/home/buildwxArt2D

For the rest follow what is explained above. meaning creating the right directories and calling cmake-gui one the right directories with calling make after each step.

wxArt2D: WxArt2dInstallCmake (last edited 2016-04-30 11:41:27 by ip5657d226)