# Debian-authored CMakeLists.txt for the FreeImagePlus wrapper.
#
# FreeImageRe's own CMake build has no equivalent of this at all -- the
# Wrapper/ directory doesn't exist upstream any more. This file, and the
# source tree next to it, is this package porting the old FreeImage 3.18
# Wrapper/FreeImagePlus onto FreeImageRe's headers/library -- verified to
# compile, link and run correctly; the changes are listed in PORTING.txt.
#
# Wired in via a patch adding `add_subdirectory(Wrapper/FreeImagePlus)`
# to the top-level CMakeLists.txt, after `add_subdirectory(Source)`.

project(FreeImagePlus)

file(GLOB freeimageplus_sources src/*.cpp)

add_library(FreeImagePlus SHARED ${freeimageplus_sources})

target_include_directories(FreeImagePlus
    PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}
    PRIVATE ${FREEIMAGE_INCLUDE_DIR}
)
target_link_libraries(FreeImagePlus PUBLIC FreeImage)
set_target_properties(FreeImagePlus PROPERTIES PUBLIC_HEADER "FreeImagePlus.h")
# See Source/CMakeLists.txt for why this doesn't reuse libfreeimageplus.so.3.
set_target_properties(FreeImagePlus PROPERTIES OUTPUT_NAME "freeimageplus" VERSION 4.0.0 SOVERSION 4)

install(TARGETS FreeImagePlus)
