2016-11-28 00:24:23 +08:00
|
|
|
include(${CMAKE_TRIPLET_FILE})
|
|
|
|
include(vcpkg_common_functions)
|
|
|
|
set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/FreeImage)
|
|
|
|
vcpkg_download_distfile(ARCHIVE
|
2018-11-11 22:16:11 +08:00
|
|
|
URLS "http://downloads.sourceforge.net/freeimage/FreeImage3180.zip"
|
|
|
|
FILENAME "FreeImage3180.zip"
|
|
|
|
SHA512 9d9cc7e2d57552c3115e277aeb036e0455204d389026b17a3f513da5be1fd595421655488bb1ec2f76faebed66049119ca55e26e2a6d37024b3fb7ef36ad4818
|
2016-11-28 00:24:23 +08:00
|
|
|
)
|
|
|
|
vcpkg_extract_source_archive(${ARCHIVE})
|
|
|
|
|
|
|
|
|
|
|
|
file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH})
|
|
|
|
file(COPY ${CMAKE_CURRENT_LIST_DIR}/FreeImageConfig-static.h DESTINATION ${SOURCE_PATH})
|
|
|
|
file(COPY ${CMAKE_CURRENT_LIST_DIR}/FreeImageConfig-dynamic.h DESTINATION ${SOURCE_PATH})
|
|
|
|
|
|
|
|
# Copy some useful Find***.cmake modules
|
|
|
|
file(COPY ${CMAKE_CURRENT_LIST_DIR}/cmake DESTINATION ${SOURCE_PATH})
|
|
|
|
|
|
|
|
# This is not strictly necessary, but to make sure
|
|
|
|
# that no "internal" libraries are used by removing them
|
|
|
|
file(REMOVE_RECURSE ${SOURCE_PATH}/Source/LibJPEG)
|
|
|
|
file(REMOVE_RECURSE ${SOURCE_PATH}/Source/LibPNG)
|
|
|
|
file(REMOVE_RECURSE ${SOURCE_PATH}/Source/LibTIFF4)
|
|
|
|
file(REMOVE_RECURSE ${SOURCE_PATH}/Source/ZLib)
|
|
|
|
file(REMOVE_RECURSE ${SOURCE_PATH}/Source/LibOpenJPEG)
|
|
|
|
file(REMOVE_RECURSE ${SOURCE_PATH}/Source/LibJXR)
|
|
|
|
file(REMOVE_RECURSE ${SOURCE_PATH}/Source/LibWebP)
|
|
|
|
file(REMOVE_RECURSE ${SOURCE_PATH}/Source/LibRawLite)
|
2017-06-11 06:29:50 +08:00
|
|
|
file(REMOVE_RECURSE ${SOURCE_PATH}/Source/OpenEXR)
|
2016-11-28 00:24:23 +08:00
|
|
|
|
|
|
|
vcpkg_apply_patches(
|
|
|
|
SOURCE_PATH ${SOURCE_PATH}
|
|
|
|
PATCHES "${CMAKE_CURRENT_LIST_DIR}/disable-plugins-depending-on-internal-third-party-libraries.patch"
|
|
|
|
"${CMAKE_CURRENT_LIST_DIR}/use-external-jpeg.patch"
|
|
|
|
"${CMAKE_CURRENT_LIST_DIR}/use-external-jxrlib.patch"
|
|
|
|
"${CMAKE_CURRENT_LIST_DIR}/use-external-libtiff.patch"
|
|
|
|
"${CMAKE_CURRENT_LIST_DIR}/use-external-openjpeg.patch"
|
|
|
|
"${CMAKE_CURRENT_LIST_DIR}/use-external-png-zlib.patch"
|
|
|
|
"${CMAKE_CURRENT_LIST_DIR}/use-external-rawlib.patch"
|
|
|
|
"${CMAKE_CURRENT_LIST_DIR}/use-external-webp.patch"
|
2017-06-11 06:29:50 +08:00
|
|
|
"${CMAKE_CURRENT_LIST_DIR}/use-external-openexr.patch"
|
2016-11-28 00:24:23 +08:00
|
|
|
"${CMAKE_CURRENT_LIST_DIR}/use-freeimage-config-include.patch"
|
2018-11-11 22:19:42 +08:00
|
|
|
"${CMAKE_CURRENT_LIST_DIR}/fix-function-overload.patch"
|
2016-11-28 00:24:23 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
vcpkg_configure_cmake(
|
|
|
|
SOURCE_PATH ${SOURCE_PATH}
|
2017-04-01 00:03:37 +08:00
|
|
|
PREFER_NINJA
|
|
|
|
OPTIONS_DEBUG -DINSTALL_HEADERS=OFF
|
2016-11-28 00:24:23 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
vcpkg_install_cmake()
|
|
|
|
|
|
|
|
# Handle copyright
|
|
|
|
file(COPY ${SOURCE_PATH}/license-fi.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/freeimage)
|
|
|
|
file(RENAME ${CURRENT_PACKAGES_DIR}/share/freeimage/license-fi.txt ${CURRENT_PACKAGES_DIR}/share/freeimage/copyright)
|
2016-11-29 16:52:06 +08:00
|
|
|
|
|
|
|
vcpkg_copy_pdbs()
|