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
Installation of gl2ps requires cmake. Install cmake product or build it from sources (refer to the cmake documentation for more details: http://www.cmake.org/cmake/help/install.html).
Enter the directory where source files of gl2ps are located (<GL2PS_SRC_DIR>).
cd <GL2PS_SRC_DIR>
Start cmake to perform configuration of the source directory.
cmake –DCMAKE_INSTALL_PREFIX=<GL2PS_INSTALL_DIR>
–DCMAKE_BUILD_TYPE=Release
If cmake command is finished successfully, perform building process.
make
If building is finished successfully, perform installation of gl2ps. All binary and other files of gl2ps product will be put into the directory specified by <GL2PS_INSTALL_DIR>.
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:
Comment line 106:
before: add_library(lib STATIC gl2ps.c gl2ps.h)
after: #add_librrary(lib STATIC gl2ps.c gl2ps.h)
Comment line 107:
before: set_target_properties(lib PROPERTIES OUTPUT_NAME gl2ps)
after: #set_target_properties(lib PROPERTIES OUTPUT_NAME gl2ps)
Change line 116:
before: install(TARGETS lib shared DESTINATION lib)
after: install(TARGETS shared DESTINATION lib)
Then, restart installation of the gl2ps from the cmake step.