aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLily <47812810+LilyWangL@users.noreply.github.com>2020-09-12 03:58:59 +0800
committerGitHub <noreply@github.com>2020-09-11 12:58:59 -0700
commit28a5bd79ef600d50b01513a3d8ba4d0919515929 (patch)
tree83c40f8c8cb253a7c62a9a208ab378526f5ad21b
parent0ed3d5ef3ff602cc1ad8c8c05416b70738d264fa (diff)
downloadvcpkg-28a5bd79ef600d50b01513a3d8ba4d0919515929.tar.gz
vcpkg-28a5bd79ef600d50b01513a3d8ba4d0919515929.zip
[freeimage] Add freeimage-config.cmake (#12627)
* [freeimage] Add vcpkg-cmake-wrapper.cmake * [freeimage] Prefer creating config.cmake instead of vcpkg-cmake-wrapper Co-authored-by: Robert Schumacher <roschuma@microsoft.com>
-rw-r--r--ports/freeimage/CMakeLists.txt40
-rw-r--r--ports/freeimage/CONTROL2
-rw-r--r--ports/freeimage/portfile.cmake6
3 files changed, 30 insertions, 18 deletions
diff --git a/ports/freeimage/CMakeLists.txt b/ports/freeimage/CMakeLists.txt
index 2e73e9b26..345c5d4d9 100644
--- a/ports/freeimage/CMakeLists.txt
+++ b/ports/freeimage/CMakeLists.txt
@@ -96,7 +96,8 @@ target_include_directories(FreeImage PRIVATE ${REAL_SOURCE_DIR}
${WEBP_INCLUDE_DIRS}
${JXR_INCLUDE_DIRS}
${LibRaw_INCLUDE_DIRS}
- ${CMAKE_CURRENT_BINARY_DIR})
+ ${CMAKE_CURRENT_BINARY_DIR}
+ PUBLIC $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>)
target_link_libraries(FreeImage ${ZLIB_LIBRARIES}
@@ -126,24 +127,37 @@ endif()
target_include_directories(FreeImagePlus PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/Wrapper/FreeImagePlus
${CMAKE_CURRENT_BINARY_DIR}
- ${REAL_SOURCE_DIR})
+ ${REAL_SOURCE_DIR}
+ PUBLIC $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>)
target_link_libraries(FreeImagePlus PUBLIC FreeImage)
list(APPEND PUBLIC_HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/Wrapper/FreeImagePlus/FreeImagePlus.h)
-install(TARGETS FreeImage
+install(TARGETS FreeImage FreeImagePlus
+ EXPORT freeimage-targets
COMPONENT runtime
- RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" COMPONENT bin
- LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}" COMPONENT shlib
- ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}" COMPONENT lib)
-
-install(TARGETS FreeImagePlus
- COMPONENT runtime-cpp
- RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" COMPONENT bin
- LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}" COMPONENT shlib
- ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}" COMPONENT lib)
-
+ RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}"
+ LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}"
+ ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}")
+
+install(EXPORT freeimage-targets NAMESPACE freeimage:: DESTINATION share/freeimage)
+
+file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/freeimage-config.cmake"
+"include(CMakeFindDependencyMacro)
+find_dependency(ZLIB)
+find_dependency(PNG)
+find_dependency(JPEG)
+find_dependency(TIFF)
+find_dependency(OpenJPEG)
+find_dependency(WebP)
+find_dependency(JXR)
+find_dependency(LibRaw)
+find_dependency(OpenEXR)
+include(\"\${CMAKE_CURRENT_LIST_DIR}/freeimage-targets.cmake\")
+")
+
+install(FILES ${CMAKE_CURRENT_BINARY_DIR}/freeimage-config.cmake DESTINATION share/freeimage)
if(INSTALL_HEADERS)
install(FILES ${PUBLIC_HEADERS} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
endif()
diff --git a/ports/freeimage/CONTROL b/ports/freeimage/CONTROL
index 643c7b398..94c6b8969 100644
--- a/ports/freeimage/CONTROL
+++ b/ports/freeimage/CONTROL
@@ -1,6 +1,6 @@
Source: freeimage
Version: 3.18.0
-Port-Version: 13
+Port-Version: 15
Build-Depends: zlib, libpng, libjpeg-turbo, tiff, openjpeg, libwebp (!uwp), libraw, jxrlib, openexr
Homepage: https://sourceforge.net/projects/freeimage/
Description: Support library for graphics image formats
diff --git a/ports/freeimage/portfile.cmake b/ports/freeimage/portfile.cmake
index 37552202d..50e0148be 100644
--- a/ports/freeimage/portfile.cmake
+++ b/ports/freeimage/portfile.cmake
@@ -38,15 +38,13 @@ file(REMOVE_RECURSE ${SOURCE_PATH}/Source/OpenEXR)
vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
PREFER_NINJA
- OPTIONS
- -DVCPKG_ROOT_DIR=${VCPKG_ROOT_DIR}
- -DTARGET_TRIPLET=${TARGET_TRIPLET}
OPTIONS_DEBUG
-DINSTALL_HEADERS=OFF
)
vcpkg_install_cmake()
+vcpkg_fixup_cmake_targets()
vcpkg_copy_pdbs()
-file(INSTALL ${SOURCE_PATH}/license-fi.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)
+file(INSTALL ${SOURCE_PATH}/license-fi.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)