2024-06-14 11:05:54 +03:00
|
|
|
cmake_minimum_required(VERSION 3.26)
|
|
|
|
|
|
|
|
project(libimage CXX)
|
|
|
|
|
|
|
|
set(LIBIMAGE_SOURCES
|
|
|
|
Image.cpp
|
|
|
|
Netbpm.cpp
|
2024-06-17 18:04:18 +03:00
|
|
|
PNG.cpp
|
2024-06-14 11:05:54 +03:00
|
|
|
)
|
|
|
|
|
|
|
|
add_custom_target(libimage-headers
|
|
|
|
COMMAND ${CMAKE_COMMAND} -E copy_directory_if_different ${CMAKE_CURRENT_SOURCE_DIR}/include/ ${BANAN_INCLUDE}/
|
|
|
|
DEPENDS sysroot
|
|
|
|
)
|
|
|
|
|
|
|
|
add_library(libimage ${LIBIMAGE_SOURCES})
|
|
|
|
add_dependencies(libimage headers libc-install)
|
|
|
|
target_link_libraries(libimage PUBLIC libc)
|
2024-06-17 23:03:52 +03:00
|
|
|
target_compile_options(libimage PRIVATE -O3)
|
2024-06-14 11:05:54 +03:00
|
|
|
|
|
|
|
add_custom_target(libimage-install
|
|
|
|
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_CURRENT_BINARY_DIR}/libimage.a ${BANAN_LIB}/
|
|
|
|
DEPENDS libimage
|
|
|
|
BYPRODUCTS ${BANAN_LIB}/libimage.a
|
|
|
|
)
|
|
|
|
|
|
|
|
set(CMAKE_STATIC_LIBRARY_PREFIX "")
|