2017-09-03 22:32:34 +08:00
|
|
|
cmake_minimum_required(VERSION 3.8.0)
|
|
|
|
project(lodepng)
|
|
|
|
|
2021-12-07 13:51:01 +08:00
|
|
|
add_library(lodepng lodepng.cpp)
|
2020-03-28 11:04:02 +08:00
|
|
|
target_include_directories(lodepng PUBLIC
|
|
|
|
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
|
|
|
|
)
|
2017-09-03 22:32:34 +08:00
|
|
|
|
2020-03-28 11:04:02 +08:00
|
|
|
file(WRITE "${CMAKE_BINARY_DIR}/lodepng-config.cmake" "include(\"\${CMAKE_CURRENT_LIST_DIR}/lodepng-targets.cmake\")")
|
|
|
|
install(FILES "${CMAKE_BINARY_DIR}/lodepng-config.cmake" DESTINATION "share/lodepng/")
|
2017-09-03 22:32:34 +08:00
|
|
|
|
2020-03-28 11:04:02 +08:00
|
|
|
install(TARGETS lodepng EXPORT lodepng-targets)
|
2017-09-03 22:32:34 +08:00
|
|
|
|
2020-03-28 11:04:02 +08:00
|
|
|
install(EXPORT lodepng-targets DESTINATION share/lodepng/)
|
2017-09-03 22:32:34 +08:00
|
|
|
|
2021-12-07 13:51:01 +08:00
|
|
|
add_library(lodepng-c lodepng.c)
|
|
|
|
target_include_directories(lodepng-c PUBLIC
|
|
|
|
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
|
|
|
|
)
|
|
|
|
|
|
|
|
file(WRITE "${CMAKE_BINARY_DIR}/lodepng-c-config.cmake" "include(\"\${CMAKE_CURRENT_LIST_DIR}/lodepng-c-targets.cmake\")")
|
|
|
|
install(FILES "${CMAKE_BINARY_DIR}/lodepng-c-config.cmake" DESTINATION "share/lodepng-c/")
|
|
|
|
|
|
|
|
install(TARGETS lodepng-c EXPORT lodepng-c-targets)
|
|
|
|
|
|
|
|
install(EXPORT lodepng-c-targets DESTINATION share/lodepng-c/)
|
2017-09-03 22:32:34 +08:00
|
|
|
|
|
|
|
if(NOT DISABLE_INSTALL_HEADERS)
|
2021-12-07 13:51:01 +08:00
|
|
|
install(FILES lodepng.h DESTINATION include)
|
2017-09-03 22:32:34 +08:00
|
|
|
endif()
|