cPNG/CMakeLists.txt

41 lines
897 B
CMake
Raw Normal View History

#cPNG source files
2022-05-03 23:24:25 +02:00
cmake_minimum_required(VERSION 3.16)
project(cPNG VERSION 1.5.30 LANGUAGES C)
find_package(cZlib 1.2.5 REQUIRED)
2022-05-03 23:24:25 +02:00
set(SOURCES
2022-08-22 20:49:35 +02:00
png.c
pngerror.c
pngget.c
pngmem.c
pngpread.c
pngread.c
pngrio.c
pngrtran.c
pngrutil.c
pngset.c
pngtrans.c
pngwio.c
pngwrite.c
pngwtran.c
pngwutil.c
2022-05-03 23:24:25 +02:00
)
# Target name is "cPNG", output file is "libcPNG.a" (by default)
2022-08-22 20:49:35 +02:00
add_library(cPNG STATIC ${SOURCES})
target_compile_options(cPNG PRIVATE -Os -std=c11)
target_link_libraries(cPNG PRIVATE cZlib::cZlib)
2022-08-22 20:49:35 +02:00
# After building, install the target (that is, cPNG.a) in the compiler
install(TARGETS cPNG
DESTINATION "${FXSDK_LIB}")
2022-08-22 20:49:35 +02:00
# Install png.h from the build dir
install(FILES png.h pngconf.h pnglibconf.h
2022-08-22 20:49:35 +02:00
DESTINATION "${FXSDK_INCLUDE}")
2022-08-22 20:49:35 +02:00
# Install FindcPNG.cmake so that users can do find_package(LibcPNG)
install(FILES cmake/FindcPNG.cmake
2022-05-03 23:24:25 +02:00
DESTINATION "${FXSDK_CMAKE_MODULE_PATH}")