• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1cmake_minimum_required(VERSION 3.1)
2cmake_policy(VERSION 3.1)
3
4project(PNGMINUS C)
5
6option(PNGMINUS_USE_STATIC_LIBRARIES "Use the static library builds" ON)
7
8# libpng
9add_subdirectory(../.. libpng)
10include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../..)
11include_directories(${CMAKE_CURRENT_BINARY_DIR}/libpng)
12if(PNGMINUS_USE_STATIC_LIBRARIES)
13  set(PNGMINUS_PNG_LIBRARY png_static)
14else()
15  set(PNGMINUS_PNG_LIBRARY png)
16endif()
17
18# png2pnm
19add_executable(png2pnm png2pnm.c)
20target_link_libraries(png2pnm ${PNGMINUS_PNG_LIBRARY})
21
22# pnm2png
23add_executable(pnm2png pnm2png.c)
24target_link_libraries(pnm2png ${PNGMINUS_PNG_LIBRARY})
25