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
1. Install or build cmake products from source files.
2. Update of gl2ps source files:
3. Comment line 106 and 107
#add_library(lib STATIC gl2ps.c gl2ps.h)
#set_target_properties(lib PROPERTIES OUTPUT_NAME gl2ps)
4. Correct line 116
Please, replace the string
install(TARGETS lib shared DESTINATION lib)
with
install(TARGETS shared DESTINATION lib)
5. Start ccmake in GUI mode with a path to the source of gl2ps as an argument
ccmake /dn40/gl2ps-1.3.5-source
6. Press [c] to make the initial configuration
7. Define CMAKE_INSTALL_PREFIX, EXECUTABLE_OUTPUT_PATH and LIBRARY_OUTPUT_PATH to a location where are you going to install the gl2ps products.

8. Press [c] to make the final configuration
9. Press [g] to make generation of Makefile files and exit.
make
make install
10. As a result you will obtain an installed gl2ps in the CMAKE_INSTALL_PREFIX path.