mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-12-26 01:30:55 +08:00
[lcms] Update to v2.16 (#42187)
This commit is contained in:
parent
8b987d26e7
commit
4fbfcffceb
@ -1,55 +0,0 @@
|
||||
cmake_minimum_required(VERSION 3.5)
|
||||
|
||||
project(little-cms)
|
||||
|
||||
file(GLOB SRCS src/*.c)
|
||||
|
||||
add_library(lcms2 ${SRCS} src/lcms2.def)
|
||||
|
||||
if(BUILD_SHARED_LIBS)
|
||||
target_compile_definitions(lcms2 PRIVATE CMS_DLL_BUILD)
|
||||
target_compile_definitions(lcms2 PUBLIC CMS_DLL)
|
||||
endif()
|
||||
target_compile_definitions(lcms2 PRIVATE UNICODE _UNICODE)
|
||||
target_compile_definitions(lcms2 PUBLIC CMS_NO_REGISTER_KEYWORD)
|
||||
|
||||
target_include_directories(lcms2 PUBLIC $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include> $<INSTALL_INTERFACE:include>)
|
||||
set_target_properties(lcms2 PROPERTIES PUBLIC_HEADER "${CMAKE_CURRENT_LIST_DIR}/include/lcms2.h;${CMAKE_CURRENT_LIST_DIR}/include/lcms2_plugin.h")
|
||||
|
||||
# Generate pkg-config file
|
||||
SET(PACKAGE "lcms2")
|
||||
# Read VERSION from file configure
|
||||
file(READ "${CMAKE_CURRENT_LIST_DIR}/configure" lcms2_configure)
|
||||
string(REGEX MATCH "PACKAGE_VERSION='(([0-9]+)\\.([0-9]+))'" _ ${lcms2_configure})
|
||||
set(VERSION "${CMAKE_MATCH_1}")
|
||||
SET(prefix "${CMAKE_INSTALL_PREFIX}")
|
||||
SET(exec_prefix "\${prefix}")
|
||||
SET(libdir "\${exec_prefix}/${CMAKE_INSTALL_LIBDIR}")
|
||||
SET(includedir "\${prefix}/include")
|
||||
CONFIGURE_FILE(lcms2.pc.in "${PROJECT_BINARY_DIR}/lcms2.pc" @ONLY)
|
||||
|
||||
install(TARGETS lcms2
|
||||
EXPORT lcms2Config
|
||||
RUNTIME DESTINATION "bin"
|
||||
LIBRARY DESTINATION "lib"
|
||||
ARCHIVE DESTINATION "lib"
|
||||
PUBLIC_HEADER DESTINATION "include"
|
||||
)
|
||||
|
||||
INSTALL(FILES ${PROJECT_BINARY_DIR}/lcms2.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
|
||||
|
||||
install(EXPORT lcms2Config
|
||||
DESTINATION "share/lcms2"
|
||||
NAMESPACE lcms2::
|
||||
)
|
||||
|
||||
# Backwards compatibility for previous vcpkg users
|
||||
add_library(lcms INTERFACE)
|
||||
target_link_libraries(lcms INTERFACE lcms2)
|
||||
|
||||
|
||||
install(TARGETS lcms EXPORT lcms-targets)
|
||||
install(EXPORT lcms-targets
|
||||
DESTINATION "share/lcms"
|
||||
NAMESPACE lcms::
|
||||
)
|
@ -1,12 +1,12 @@
|
||||
diff --git a/include/lcms2.h b/include/lcms2.h
|
||||
index fd4ac7c..a99bdd2 100644
|
||||
index 7c72047..6306027 100644
|
||||
--- a/include/lcms2.h
|
||||
+++ b/include/lcms2.h
|
||||
@@ -227,6 +227,7 @@ typedef int cmsBool;
|
||||
@@ -230,6 +230,7 @@ typedef int cmsBool;
|
||||
|
||||
|
||||
// Calling convention -- this is hardly platform and compiler dependent
|
||||
+#define CMS_DLL
|
||||
#ifdef CMS_IS_WINDOWS_
|
||||
#if defined(CMS_IS_WINDOWS_) && !defined(__GNUC__)
|
||||
# if defined(CMS_DLL) || defined(CMS_DLL_BUILD)
|
||||
# ifdef __BORLANDC__
|
||||
|
11
ports/lcms/lcms-config.cmake
Normal file
11
ports/lcms/lcms-config.cmake
Normal file
@ -0,0 +1,11 @@
|
||||
if(NOT TARGET lcms::lcms)
|
||||
include(CMakeFindDependencyMacro)
|
||||
find_dependency(lcms2 CONFIG)
|
||||
|
||||
# Create imported target lcms::lcms
|
||||
add_library(lcms::lcms INTERFACE IMPORTED)
|
||||
|
||||
set_target_properties(lcms::lcms PROPERTIES
|
||||
INTERFACE_LINK_LIBRARIES "lcms2::lcms2"
|
||||
)
|
||||
endif()
|
25
ports/lcms/lcms2-config.cmake
Normal file
25
ports/lcms/lcms2-config.cmake
Normal file
@ -0,0 +1,25 @@
|
||||
if(NOT TARGET lcms2::lcms2)
|
||||
get_filename_component(_IMPORT_PREFIX "${CMAKE_CURRENT_LIST_FILE}" PATH)
|
||||
get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH)
|
||||
get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH)
|
||||
|
||||
add_library(lcms2::lcms2 UNKNOWN IMPORTED)
|
||||
|
||||
set_target_properties(lcms2::lcms2 PROPERTIES
|
||||
INTERFACE_INCLUDE_DIRECTORIES "${_IMPORT_PREFIX}/include"
|
||||
)
|
||||
|
||||
find_library(LCMS2_LIBRARY_DEBUG NAMES lcms2 PATHS "${_IMPORT_PREFIX}/debug" PATH_SUFFIXES lib NO_DEFAULT_PATH)
|
||||
if(EXISTS "${LCMS2_LIBRARY_DEBUG}")
|
||||
set_property(TARGET lcms2::lcms2 APPEND PROPERTY IMPORTED_CONFIGURATIONS "Debug")
|
||||
set_target_properties(lcms2::lcms2 PROPERTIES IMPORTED_LOCATION_DEBUG "${LCMS2_LIBRARY_DEBUG}")
|
||||
endif()
|
||||
|
||||
find_library(LCMS2_LIBRARY_RELEASE NAMES lcms2 PATHS "${_IMPORT_PREFIX}/" PATH_SUFFIXES lib NO_DEFAULT_PATH)
|
||||
if(EXISTS "${LCMS2_LIBRARY_RELEASE}")
|
||||
set_property(TARGET lcms2::lcms2 APPEND PROPERTY IMPORTED_CONFIGURATIONS "Release")
|
||||
set_target_properties(lcms2::lcms2 PROPERTIES IMPORTED_LOCATION_RELEASE "${LCMS2_LIBRARY_RELEASE}")
|
||||
endif()
|
||||
|
||||
unset(_IMPORT_PREFIX)
|
||||
endif()
|
@ -1,36 +1,61 @@
|
||||
vcpkg_minimum_required(VERSION 2022-10-12) # for ${VERSION}
|
||||
|
||||
if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic)
|
||||
set(SHARED_LIBRARY_PATCH "fix-shared-library.patch")
|
||||
endif()
|
||||
|
||||
vcpkg_download_distfile(ADD_MISSING_EXPORT_PATCH
|
||||
URLS https://github.com/mm2/Little-CMS/commit/f7b3c637c20508655f8b49935a4b556d52937b69.diff?full_index=1
|
||||
FILENAME Add-missing-export.patch
|
||||
SHA512 4a78f55c07fe5cef5fb9174d466672371283301df89e2825fc47d9fd4c526b291dce11d3896401a3284f4e2093e285c9e5ccbe0011e132576d189e70f66a1325
|
||||
)
|
||||
|
||||
vcpkg_from_github(
|
||||
OUT_SOURCE_PATH SOURCE_PATH
|
||||
REPO mm2/Little-CMS
|
||||
REF "lcms${VERSION}"
|
||||
SHA512 fc45f2ce0bf752313369786b65b92443ef6d9ed7e264e22cfe2a4732b370f6bb6e5573b646d0e8edf1b0bf9b9bc5137c98aed5929ba75acdf157d2764bd838fa
|
||||
SHA512 c0d857123a0168cb76b5944a20c9e3de1cbe74e2b509fb72a54f74543e9c173474f09d50c495b0a0a295a3c2b47c5fa54a330d057e1a59b5a7e36d3f5a7f81b2
|
||||
HEAD_REF master
|
||||
PATCHES
|
||||
remove_library_directive.patch
|
||||
${SHARED_LIBRARY_PATCH}
|
||||
remove-register.patch
|
||||
${ADD_MISSING_EXPORT_PATCH}
|
||||
)
|
||||
|
||||
file(COPY "${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt" DESTINATION "${SOURCE_PATH}")
|
||||
if("fastfloat" IN_LIST FEATURES)
|
||||
list(APPEND OPTIONS -Dfastfloat=true)
|
||||
else()
|
||||
list(APPEND OPTIONS -Dfastfloat=false)
|
||||
endif()
|
||||
if("threaded" IN_LIST FEATURES)
|
||||
list(APPEND OPTIONS -Dthreaded=true)
|
||||
else()
|
||||
list(APPEND OPTIONS -Dthreaded=false)
|
||||
endif()
|
||||
if("tools" IN_LIST FEATURES)
|
||||
list(APPEND OPTIONS -Dutils=true)
|
||||
else()
|
||||
list(APPEND OPTIONS -Dutils=false)
|
||||
endif()
|
||||
|
||||
vcpkg_cmake_configure(SOURCE_PATH "${SOURCE_PATH}")
|
||||
vcpkg_cmake_install()
|
||||
|
||||
vcpkg_copy_pdbs()
|
||||
vcpkg_cmake_config_fixup(PACKAGE_NAME lcms2)
|
||||
vcpkg_cmake_config_fixup() # provides old PACKAGE_NAME lcms
|
||||
vcpkg_configure_meson(
|
||||
SOURCE_PATH "${SOURCE_PATH}"
|
||||
OPTIONS
|
||||
${OPTIONS}
|
||||
-Dsamples=false
|
||||
)
|
||||
vcpkg_install_meson()
|
||||
vcpkg_fixup_pkgconfig()
|
||||
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
|
||||
file(WRITE "${CURRENT_PACKAGES_DIR}/share/lcms/lcms-config.cmake" [[
|
||||
include(CMakeFindDependencyMacro)
|
||||
find_dependency(lcms2 CONFIG)
|
||||
include(${CMAKE_CURRENT_LIST_DIR}/lcms-targets.cmake)
|
||||
]])
|
||||
|
||||
file(INSTALL "${SOURCE_PATH}/COPYING" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
|
||||
if("tools" IN_LIST FEATURES)
|
||||
vcpkg_copy_tools(
|
||||
TOOL_NAMES jpgicc linkicc psicc tificc transicc
|
||||
AUTO_CLEAN
|
||||
)
|
||||
endif()
|
||||
|
||||
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/share/man")
|
||||
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")
|
||||
|
||||
file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/lcms-config.cmake" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")
|
||||
file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/lcms2-config.cmake" DESTINATION "${CURRENT_PACKAGES_DIR}/share/lcms2")
|
||||
file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")
|
||||
|
||||
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE")
|
||||
|
@ -1,13 +0,0 @@
|
||||
diff --git a/include/lcms2.h b/include/lcms2.h
|
||||
index fd4ac7c..b5532a9 100644
|
||||
--- a/include/lcms2.h
|
||||
+++ b/include/lcms2.h
|
||||
@@ -152,7 +152,7 @@ typedef double cmsFloat64Number;
|
||||
#endif
|
||||
|
||||
// Handle "register" keyword
|
||||
-#if defined(CMS_NO_REGISTER_KEYWORD)
|
||||
+#if __cplusplus >= 201703L || defined(CMS_NO_REGISTER_KEYWORD)
|
||||
# define CMSREGISTER
|
||||
#else
|
||||
# define CMSREGISTER register
|
@ -1,10 +0,0 @@
|
||||
diff --git a/src/lcms2.def b/src/lcms2.def
|
||||
index f3e4779..9bf2a4f 100644
|
||||
--- a/src/lcms2.def
|
||||
+++ b/src/lcms2.def
|
||||
@@ -1,5 +1,3 @@
|
||||
-LIBRARY LCMS2.DLL
|
||||
-
|
||||
EXPORTS
|
||||
|
||||
_cms15Fixed16toDouble = _cms15Fixed16toDouble
|
@ -1,17 +1,34 @@
|
||||
{
|
||||
"name": "lcms",
|
||||
"version": "2.14",
|
||||
"version": "2.16",
|
||||
"description": "Little CMS.",
|
||||
"homepage": "https://github.com/mm2/Little-CMS",
|
||||
"license": "MIT",
|
||||
"dependencies": [
|
||||
{
|
||||
"name": "vcpkg-cmake",
|
||||
"host": true
|
||||
},
|
||||
{
|
||||
"name": "vcpkg-cmake-config",
|
||||
"name": "vcpkg-tool-meson",
|
||||
"host": true
|
||||
}
|
||||
]
|
||||
],
|
||||
"features": {
|
||||
"fastfloat": {
|
||||
"description": "Build the fast float plugin",
|
||||
"supports": "!(x86 & windows)",
|
||||
"license": "GPL-3.0-or-later"
|
||||
},
|
||||
"threaded": {
|
||||
"description": "Build the multi threaded plugin",
|
||||
"license": "GPL-3.0-or-later"
|
||||
},
|
||||
"tools": {
|
||||
"description": "Build the utilities",
|
||||
"dependencies": [
|
||||
"libjpeg-turbo",
|
||||
{
|
||||
"name": "tiff",
|
||||
"default-features": false
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -4221,7 +4221,7 @@
|
||||
"port-version": 6
|
||||
},
|
||||
"lcms": {
|
||||
"baseline": "2.14",
|
||||
"baseline": "2.16",
|
||||
"port-version": 0
|
||||
},
|
||||
"leaf": {
|
||||
|
@ -1,5 +1,10 @@
|
||||
{
|
||||
"versions": [
|
||||
{
|
||||
"git-tree": "781f8c60a57e793ac8b9800b3b7cfa6e46f75b44",
|
||||
"version": "2.16",
|
||||
"port-version": 0
|
||||
},
|
||||
{
|
||||
"git-tree": "d5fb3c46f4b60d45e67444591a83d80c08100871",
|
||||
"version": "2.14",
|
||||
|
Loading…
x
Reference in New Issue
Block a user