From b65005b241c58763b239fa9151f42e286b692813 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christophe=20Gu=C3=A9bert?= Date: Wed, 7 Dec 2016 12:30:12 +0100 Subject: [PATCH] Add CharLS. --- ports/charls/0001_cmake.patch | 12 ++++++++++++ ports/charls/CONTROL | 3 +++ ports/charls/portfile.cmake | 27 +++++++++++++++++++++++++++ 3 files changed, 42 insertions(+) create mode 100644 ports/charls/0001_cmake.patch create mode 100644 ports/charls/CONTROL create mode 100644 ports/charls/portfile.cmake diff --git a/ports/charls/0001_cmake.patch b/ports/charls/0001_cmake.patch new file mode 100644 index 000000000..7f50a98e6 --- /dev/null +++ b/ports/charls/0001_cmake.patch @@ -0,0 +1,12 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 1aa40a8..1051997 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -33,6 +33,7 @@ option (BUILD_TESTING "Build tests" ON) + if (WIN32) + if (BUILD_SHARED_LIBS) + add_definitions(-D CHARLS_DLL) ++ set_source_files_properties(src/interface.cpp PROPERTIES COMPILE_FLAGS -DCHARLS_DLL_BUILD) + else() + add_definitions(-D CHARLS_STATIC) + endif() diff --git a/ports/charls/CONTROL b/ports/charls/CONTROL new file mode 100644 index 000000000..8be1a5027 --- /dev/null +++ b/ports/charls/CONTROL @@ -0,0 +1,3 @@ +Source: charls +Version: 2.0.0 +Description: CharLS, a C++ JPEG-LS library implementation. \ No newline at end of file diff --git a/ports/charls/portfile.cmake b/ports/charls/portfile.cmake new file mode 100644 index 000000000..69726f1c3 --- /dev/null +++ b/ports/charls/portfile.cmake @@ -0,0 +1,27 @@ +include(vcpkg_common_functions) +set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/charls-2.0.0) +vcpkg_download_distfile(ARCHIVE_FILE + URLS "https://github.com/team-charls/charls/archive/2.0.0.tar.gz" + FILENAME "charls-2.0.0.tar.gz" + SHA512 0a2862fad6d65b941c81f5f838db1fdc6a4625887281ddbf27e21be9084f607d27c8a27d246d6252e08358b2ed4aa0c2b7407048ca559fb40e94313ca72487dd +) +vcpkg_extract_source_archive(${ARCHIVE_FILE}) + +vcpkg_apply_patches( + SOURCE_PATH ${SOURCE_PATH} + PATCHES + ${CMAKE_CURRENT_LIST_DIR}/0001_cmake.patch +) + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + OPTIONS + -DBUILD_TESTING=OFF +) + +vcpkg_install_cmake() + +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) +file(INSTALL ${SOURCE_PATH}/License.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/charls RENAME copyright) + +vcpkg_copy_pdbs() \ No newline at end of file