Differences between revisions 17 and 24 (spanning 7 versions)
Revision 17 as of 2011-04-13 20:20:34
Size: 12659
Comment:
Revision 24 as of 2016-04-27 11:59:57
Size: 12908
Editor: ip5657d226
Comment:
Deletions are marked like this. Additions are marked like this.
Line 3: Line 3:

== 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, installe the Freetype development package is enough.
Line 27: Line 32:
Now all down here needs to be done. But on Unix there is a ''configure'' script which you can run, to do the same, inclusive testing. Type ''configure -help'' to see some options. For example: Now all down here needs to be done. On Unix there is a ''configure'' script which you can run, to do the same, inclusive testing. Type ''configure -help'' to see some options. For example:
Line 30: Line 35:
/home/klaas/soft/svncheckout/trunk/wxArt2D/configure -g -v -prefix /home/klaas/soft/usr/local /home/klaas/soft/svncheckout/trunk/wxArt2D/configure -g -v --prefix /home/klaas/soft/usr/local
Line 115: Line 120:
Next run '''cmake-gui''' on windows click on the line "Where is the source installed" and browse to where you have installed wxArt2D. In our case ''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. ( e.g. C:/soft/svncheckout/buildart2d291deb/thirdparty/kbool ) 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'' )
Line 117: Line 122:
The next tells what to do from the commadline in a DOS BOX, these paths you can use in the cmake-gui tool directly also. 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.
Line 146: Line 151:
Best use cmake-gui since i gives you an idea what can be set. Best use ''cmake-gui'' since i gives you an idea what can be set.
Line 151: Line 156:

LD_LIBRARY_PATH=/usr/local/lib/wxart2d:$LD_LIBRARY_PATH export LD_LIBRARY_PATH
{{{
LD_LIBRARY_PATH=/usr/local/lib/wxart2d:$LD_LIBRARY_PATH
export LD_LIBRARY_PATH
}}}
Line 159: Line 166:
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
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
}}}
Line 170: Line 179:
{{{
Line 172: Line 181:

 
. /configure --enable-debug --disable-shared
. /configure --enable-debug --disable-shared
}}}
Line 181: Line 189:
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 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''
Line 184: Line 192:

cd /whereIswxArt2D/wxArt2D/ cd /whereIswxArt2D/buildwxArt2D cmake-gui ../wxArt2D
{{{
cd /whereIswxArt2D/wxArt2D/
cd /whereIswxArt2D/buildwxArt2D
cmake-gui ../wxArt2D
}}}
Line 191: Line 202:
{{{
Line 192: Line 204:
}}}
Line 200: Line 213:
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. 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.
Line 206: Line 219:
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

Now just type:

 .
cmake -G"MSYS Makefiles" /c/home/wxArt2D

or better: cd /c/home/buildwxArt2D cmake -G"MSYS Makefiles" ../wxArt2D within the directory where you want to build ( here /c/home/buildwxArt2D ) ( You can use '''cmake-gui''' to choose the o
ptions you want, e.g. samples )

After that type make.

wxArt2D has been set up in such a way, that installation is not necessary, but if needed, type make install
{{{
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.

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, installe 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/buildWx28StaticDebug and you at the same time a release build can go into /pathToTrunk/buildWx28StaticRelease.

All platforms

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

cd /home/klaas/soft/svncheckout
mkdir buildart2d291deb
cd buildart2d291deb

Now all down here needs to be done. On Unix there is a configure script which you can run, to do the same, inclusive testing. Type configure -help to see some options. For example:

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

If not using the configure script up here, all the next steps needs 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

Now configure using cmake or better cmake-gui to choose options, and build one by one. Do not install yet.

cd /home/klaas/soft/svncheckout/buildart2d291deb/thirdparty/agg-2.4
cmake-gui /home/klaas/soft/svncheckout/trunk/wxArt2D/thirdparty/agg-2.4
make
cd /home/klaas/soft/svncheckout/buildart2d291deb/thirdparty/kbool
cmake-gui /home/klaas/soft/svncheckout/trunk/wxArt2D/thirdparty/kbool
make
cd /home/klaas/soft/svncheckout/buildart2d291deb/packages/wxdocview
cmake-gui /home/klaas/soft/svncheckout/trunk/wxArt2D/packages/wxdocview
make
cd /home/klaas/soft/svncheckout/buildart2d291deb/packages/wxart2d
cmake-gui /home/klaas/soft/svncheckout/trunk/wxArt2D/packages/wxart2d
make

At last install all packages.

cd /home/klaas/soft/svncheckout/buildart2d291deb/thirdparty/agg-2.4
sudo make install
cd /home/klaas/soft/svncheckout/buildart2d291deb/thirdparty/kbool
sudo make install
cd /home/klaas/soft/svncheckout/buildart2d291deb/packages/wxdocview
sudo make install
cd /home/klaas/soft/svncheckout/buildart2d291deb/packages/wxart2d
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.

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. On Linux: ../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:

  • If you want debug --enable-debug
  • If you want static libraries --disable-shared

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)