Differences between revisions 3 and 4
Revision 3 as of 2008-08-05 18:45:35
Size: 6520
Editor: dslb-088-065-255-074
Comment:
Revision 4 as of 2008-08-06 13:45:33
Size: 8491
Comment:
Deletions are marked like this. Additions are marked like this.
Line 122: Line 122:

----

= wxAr2tD with wxLua and wxStEdit =

As scripting language within wxArt2D wxLua is currently available. wxLua itself needs wxStEdit, so you need to get wxLua and wxStEdit compiled for your system.
On windows make sure you have the floowing environment variables set, before starting CmakeSetup.exe to generate your project files.
First you build wxStEdit and Next wxLua, both in all flavors you need.

I assume the following are set:
SET WXSTEDIT=c:\soft\art2d\wxstedit
SET WXLUA=c:\soft\art2d\wxLua
SET WXWIN=c:\soft\wxWidgest-2.8.8

Just check on your MDOS command line with:
echo %WXLUA%
echo %WXSTEDIT%
echo %WXWIN%

cd %WXSTEDIT%\build
#for debug
nmake -f makefile.vc WX_DEBUG=1
#for release
nmake -f makefile.vc WX_DEBUG=0

cd %WXLUA%\build
#for debug
nmake -f makefile.vc BUILD=debug
#for release
nmake -f makefile.vc BUILD=release

This should give you all the libraries for wxLua and wxStEdit in debug and release mode.
Now you start CmakeSetup.exe and enable the option WXART2D_USE_LUA to be ON.
The project files wxArt2D.sln, now gets extra targets and samples using wxlua.

P.S. for the moment gdiplus.lib is not used by wxLua, and so WXART2d_USE_GDIPLUSDRAWER is only possible if you add by hand gdiplus.lib to the wxLua makefile.vc files. That is in %WXLUA%\apps\build\msw\makefile.vc, just add it where you see *.lib files.

On Unix you need to set the same variable on your shell command line.

I assume:
{{{
export WXSTEDIT=/home/myhome/art2d/wxstedit
export WXLUA=/home/myhome/art2d/wxLua
export WXWIN=/home/myhome/art2d/wxWidgest-2.8.8
}}}
Use: this to compile and install for wxstedit and wxlua.
{{{
./configure (right option see ./configure --help)
make
make install
}}}

Next configure wxArt2D and compile:
{{{
export WXART2D=/home/myhome/art2d/wxArt2D
cd $WXART2D
cd ..
mkdir buildArt2dWithWxLua
cd buildArt2dWithWxLua
ccmake ../wxArt2D
make
}}}













Download and Installation of wxArt2D

General Approach

The general approach to get the wxArt2D library and its demos running is:

  • Download tools and sources
  • Configure and build wxWidgets
  • Configure and build wxArt2D
  • Focus on your own application

Due to things being a little complex, it's not unusual to have some problem in between. You might want to take a look at the common issues.

In this documentation there might be a certain bias towards MS Windows (MSW) systems with Visual Studio. However, wxArt2D is known to work with Cygwin and natively on Linux as well. See Working platform and tool sets for more.

Download Tools and Sources

Being able to be built on different platforms, wxArt2D requires more than just its own sources.

  • Get wxWidgets, http://www.wxwidgets.org/

    • Latest released version is 2.8.8. From here on, it is assumed you use version 2.8.8, not an older version. The development branch 2.9.0 is not yet supported (there are incompatibilities), any volunteeers?
  • Get a CVS client, e.g. TortoiseCVS, http://www.tortoisecvs.org/

  • Get CMake, version 2.6 or newer, http://www.cmake.org/

    • wxArt2D uses CMake as its build system. It will generate makefiles & project-files using template files present in wxArt2d folders.

  • Get wxArt2D by CVS
    • Choose a home for your wxArt2D installation, on MSW e.g. D:\
    • From console run cvs -z3 -d:pserver:anonymous@wxart2d.cvs.sourceforge.net:/cvsroot/wxart2d co -P wxArt2D

    • Now you should have e.g. D:\wxArt2D.
    • No, there is no zip-file or msi-installer. Though wxart2d is well maintained, there are no releases, yet.
    • To get the latest wxArt2D sources, just rerun the cvs command anytime.
  • Features not provided by wxWidgets, but required by wxArt2D are embedded in wxArt2d\thirdparty folder to make the compile process easier (however you can still configure wxArt2d so that they are not used).

Now you have the tools and sources needed to build wxArt2D.

Configure and build wxWidgets

wxWidgets and wxArt2D need to be made with matching configurations. Especially, wxArt2D requires OpenGL support and the contributed scintilla library from wxWidgets.

  • For introduction and details on how to configure or build wxWidgets on your system at all, please refer to the extensive wxWidgets documentation (offline and online)
  • For wxArt2D, wxWidgets must be compiled with OpenGL support
    • For Visual Studio: set USE_OPENGL = 1 in %WXWIN%\build\msw\config.vc

    • If you prefer NMake, add USE_OPENGL=1 to your nmake command.

    • On Unix/Linux, use option --with-opengl in configure line.
  • If you intend to use e.g. static CRT, unicode, or wxWidgets using STL, be prepared for additional, matching changes in wxArt2D.
  • Build wxWidgets itself
  • Build wxWidgets contributions, stc (scintilla library) is required, LUA is optional
    • Configure and build them identically to wxWidgets itself (repeat the steps above).
    • stc is required for wxArt2D.
    • Optional is wxLua, which is used in some modules and samples of wxArt2D. So you can configure and compile wxArt2d without it. In case you have wxLua installed and compiled, wxArt2d's CMake configure script finds wxLua by setting the environment variable WXLUA on windows. When using wxLua, also wxStEdit is required, see wxCode project. WXSTEDIT should be set to its root, in order for CMake to find it.

Now you have a functional wxWidgets library, including some contribs. Ideally you have verified on some wxWidgets demo, that everything is running well.

Configure and build wxArt2D

The building process of wxArt2D relys on CMake generated makefiles resp. project files. See CMake for a more detailed explanation.

TDO

Generating wxArt2D Documentation

WxArt2D uses doxygen to generate API documentation straight from the source code. Doxygen again itself uses graphviz to generate graphs of classes.

Next to that Docbook is used to generate the general documentation. You will need to download the Docbookk XSL style sheets from here http://docbook.sourceforge.net/projects/xsl/ The dtd of docbook is in CVS itself. And the STSL processor you might use is located here http://saxon.sourceforge.net/, i use Instant Saxon 6.5.3

For the doxygen documentation there is the option BUILD_DOCUMENTATION in CmakeSetup.

Make sure doxygen and the graphviz its dot tool is in your path variable. You can also set DOT_PATH in doxygen.doxy.

For docbook, search for gendocbook.bat, hack its paths until it works ;-)

TDO

Focus on your own Application

Exploring wxArt2D

An overview of samples and the hierarchy of the modules can be found in readme.html.

Build your own wxArt2d-based project using CMake After you have build wxArt2D as explained above, you will find that the samples and all are included in its make and project files.

For your own project there are several options. The easiest is to use the myproject template which is automatically generated in your build directory. This template generates a CMakeLists.txt, which you should use to generate the project files. So use CMakeSetup on windows and ccmake or cmake on Unix to generate the makefile and project files for your own project. In our case the input to CmakeSetup is something like this: "Where is the source installed" c:/libraries/buildwxart2dhere "Where to build binaries" c:/whereEver

  • The default is a simple program, the CmakeLists.txt (see down here) should be edited to contain your own files.

You can place this CmakeLists.txt + /bin/FindwxArt2D.cmake wherever you want, FindwxArt2D itself searches for wxart2dconfig.cmake in your build directory. The line SET( WXART2D D:/notebook/wxartcvs/vcp ) can be edited later if you want to try different wxArt2D builds. Down here the file you will find in your build_wxart2d/myproject.

  • PROJECT( myapp ) #modify this!! SET( WXART2D D:/notebook/wxartcvs/vcp ) INCLUDE (${myapp_SOURCE_DIR}/bin/FindwxArt2D.cmake) INCLUDE_DIRECTORIES( ${myapp_SOURCE_DIR}/include ) ADD_EXECUTABLE( myappname WIN32
    • src/myfile1.cpp include/myfile1.h d:/notebook/wxwin/wx251vc/include/wx/msw/wx.rc
    )

One other option is to use wxart2dconfig Unix script in some way in your own makefiles.

TDO

Common Issues

TDO


wxAr2tD with wxLua and wxStEdit

As scripting language within wxArt2D wxLua is currently available. wxLua itself needs wxStEdit, so you need to get wxLua and wxStEdit compiled for your system. On windows make sure you have the floowing environment variables set, before starting CmakeSetup.exe to generate your project files. First you build wxStEdit and Next wxLua, both in all flavors you need.

I assume the following are set: SET WXSTEDIT=c:\soft\art2d\wxstedit SET WXLUA=c:\soft\art2d\wxLua SET WXWIN=c:\soft\wxWidgest-2.8.8

Just check on your MDOS command line with: echo %WXLUA% echo %WXSTEDIT% echo %WXWIN%

cd %WXSTEDIT%\build #for debug nmake -f makefile.vc WX_DEBUG=1 #for release nmake -f makefile.vc WX_DEBUG=0

cd %WXLUA%\build #for debug nmake -f makefile.vc BUILD=debug #for release nmake -f makefile.vc BUILD=release

This should give you all the libraries for wxLua and wxStEdit in debug and release mode. Now you start CmakeSetup.exe and enable the option WXART2D_USE_LUA to be ON. The project files wxArt2D.sln, now gets extra targets and samples using wxlua.

P.S. for the moment gdiplus.lib is not used by wxLua, and so WXART2d_USE_GDIPLUSDRAWER is only possible if you add by hand gdiplus.lib to the wxLua makefile.vc files. That is in %WXLUA%\apps\build\msw\makefile.vc, just add it where you see *.lib files.

On Unix you need to set the same variable on your shell command line.

I assume:

export WXSTEDIT=/home/myhome/art2d/wxstedit
export WXLUA=/home/myhome/art2d/wxLua
export WXWIN=/home/myhome/art2d/wxWidgest-2.8.8

Use: this to compile and install for wxstedit and wxlua.

./configure (right option see ./configure --help)
make
make install 

Next configure wxArt2D and compile:

export WXART2D=/home/myhome/art2d/wxArt2D
cd $WXART2D
cd ..
mkdir buildArt2dWithWxLua
cd buildArt2dWithWxLua
ccmake ../wxArt2D
make

wxArt2D: WxArt2dInstall (last edited 2016-04-30 06:23:23 by ip5657d226)