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