Clean up CMake scripts
[glpng.git] / CMakeLists.txt
blob6bd9d50ae2df322be8f4c2e303b72505d893836e
1 cmake_minimum_required(VERSION 2.8.5 FATAL_ERROR)
3 project(glpng C)
4 include(GNUInstallDirs)
6 set(SONAME_VERSION 1)
7 set(MINOR_VERSION 45)
8 set(VERSION ${SONAME_VERSION}.${MINOR_VERSION})
10 set(BUILD_STATIC_LIBS ON CACHE BOOL "Set to ON to build static libraries")
12 find_package(ZLIB REQUIRED)
13 find_package(PNG REQUIRED)
14 find_package(OpenGL REQUIRED)
16 add_subdirectory(src)
17 configure_file(FindGLPNG.cmake.in FindGLPNG.cmake @ONLY)
19 install(FILES include/GL/glpng.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/GL/)
20 install(FILES glpng.htm DESTINATION ${CMAKE_INSTALL_DOCDIR})
21 install(FILES ${CMAKE_CURRENT_BINARY_DIR}/FindGLPNG.cmake DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/cmake/Modules)