gl2ps 1.3.5

 

Windows

1. Download (http://www.cmake.org/cmake/resources/software.html) and install the cmake build system.

2. Add to CMakeLists.txt after line 113 :

set_target_properties(shared PROPERTIES COMPILE_FLAGS "-DGL2PSDLL -DGL2PSDLL_EXPORTS")

the following line:

add_definitions(-D_USE_MATH_DEFINES)

3. Launch cmake-gui.exe

4. Define a path for source files, where binaries will be built and then push the Configure button.

 

 

5. Select a compiler in the pop-up window.

 

 

The following window will appear.

 

 

6. Expand the ENABLE group and deselect ENABLE_PNG and ENABLE_ZLIB check boxes.

 

 

7. Expand the CMAKE group and define CMAKE_INSTALL_PREFIX (path where you want to install the build results).

 

 

8. Push the Configure button again and then the Generate button in order to generate the VS projects.

 

9. Open the gl2ps.sln project in VS and in Solution Explorer set INSTALL as the StartUp project and start building.

 

 

10. As a result you will get an installed gl2ps in the CMAKE_INSTALL_PREFIX path.

 

Linux

cd <GL2PS_SRC_DIR>

cmake –DCMAKE_INSTALL_PREFIX=<GL2PS_INSTALL_DIR>

      –DCMAKE_BUILD_TYPE=Release

make

make install

 

Remark:

On some platforms the building of gl2ps can fail. In that case, try to modify the file CMakeList.txt located in the gl2ps source directory as follows:

before: add_library(lib STATIC gl2ps.c gl2ps.h)

after: #add_librrary(lib STATIC gl2ps.c gl2ps.h)

before: set_target_properties(lib PROPERTIES OUTPUT_NAME gl2ps)

after: #set_target_properties(lib PROPERTIES OUTPUT_NAME gl2ps)

before: install(TARGETS lib shared DESTINATION lib)

after: install(TARGETS shared DESTINATION lib)

Then, restart installation of the gl2ps from the cmake step.