Merge pull request #421 from Agadoul/master

lcms port
This commit is contained in:
Robert Schumacher 2017-02-01 19:17:11 -08:00 committed by GitHub
commit 1888c7294f
4 changed files with 108 additions and 0 deletions

59
ports/lcms/CMakeLists.txt Normal file
View File

@ -0,0 +1,59 @@
cmake_minimum_required(VERSION 3.5)
project(lcms)
set(SRCS
"src/cmstypes.c"
"src/cmsvirt.c"
"src/cmswtpnt.c"
"src/cmsxform.c"
"src/lcms2.def"
"src/lcms2_internal.h"
"src/cmsalpha.c"
"src/cmscam02.c"
"src/cmscgats.c"
"src/cmscnvrt.c"
"src/cmserr.c"
"src/cmsgamma.c"
"src/cmsgmt.c"
"src/cmshalf.c"
"src/cmsintrp.c"
"src/cmsio0.c"
"src/cmsio1.c"
"src/cmslut.c"
"src/cmsmd5.c"
"src/cmsmtrx.c"
"src/cmsnamed.c"
"src/cmsopt.c"
"src/cmspack.c"
"src/cmspcs.c"
"src/cmsplugin.c"
"src/cmsps2.c"
"src/cmssamp.c"
"src/cmssm.c"
)
add_definitions(-DUNICODE -D_UNICODE)
string(REPLACE "/utf-8" "" CMAKE_C_FLAGS "${CMAKE_C_FLAGS}")
include_directories(
"./include"
)
add_library(lcms ${SRCS})
if(NOT SKIP_INSTALL_HEADERS )
install(FILES
"./include/lcms2.h"
"./include/lcms2_plugin.h"
DESTINATION include
)
endif(NOT SKIP_INSTALL_HEADERS )
install(TARGETS lcms EXPORT lcms_EXPORT
RUNTIME DESTINATION bin
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib
)

4
ports/lcms/CONTROL Normal file
View File

@ -0,0 +1,4 @@
Source: lcms
Version: 2.8
Build-Depends:
Description: Little CMS.

35
ports/lcms/portfile.cmake Normal file
View File

@ -0,0 +1,35 @@
include(vcpkg_common_functions)
set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/lcms2-2.8)
vcpkg_download_distfile(ARCHIVE
URLS "https://sourceforge.net/projects/lcms/files/lcms/2.8/lcms2-2.8.tar.gz/download"
FILENAME "lcms2-2.8.tar.gz"
SHA512 a9478885b4892c79314a2ef9ab560e6655ac8f2d17abae0805e8b871138bb190e21f0e5c805398449f9dad528dc50baaf9e3cce8b8158eb8ff74179be5733f8f
)
vcpkg_extract_source_archive(${ARCHIVE})
message(STATUS ${SOURCE_PATH})
file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH})
set(USE_SHARED_LIBRARY OFF)
if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic)
set(USE_SHARED_LIBRARY ON)
endif()
vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
OPTIONS_DEBUG
-DSKIP_INSTALL_HEADERS=ON
)
vcpkg_install_cmake()
file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/lcms RENAME copyright)
vcpkg_copy_pdbs()
#patch header files to fix import/export issues
if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic)
vcpkg_apply_patches(
SOURCE_PATH ${CURRENT_PACKAGES_DIR}/include
PATCHES "${CMAKE_CURRENT_LIST_DIR}/shared.patch")
endif(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic)

10
ports/lcms/shared.patch Normal file
View File

@ -0,0 +1,10 @@
--- lcms2.h Wed Jul 20 08:46:01 2016
+++ lcms2.h Mon Jan 30 15:01:12 2017
@@ -212,6 +212,7 @@
#endif // CMS_USE_BIG_ENDIAN
+#define CMS_DLL_BUILD
// Calling convention -- this is hardly platform and compiler dependent
#ifdef CMS_IS_WINDOWS_