vcpkg/ports/jasper/portfile.cmake

48 lines
1.5 KiB
CMake
Raw Normal View History

2017-06-01 21:42:52 +08:00
include(vcpkg_common_functions)
2017-11-08 01:15:17 +08:00
2017-06-01 21:42:52 +08:00
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO mdadams/jasper
REF version-2.0.16
SHA512 b3bca227f833567c9061c4a29c0599784ed6a131b5cceddfd1696542d19add821eda445ce6d83782b454b266723b24d0f028cbc644a25c0e3a75304e615b34ee
2017-06-01 21:42:52 +08:00
HEAD_REF master)
2017-11-08 01:15:17 +08:00
vcpkg_apply_patches(
SOURCE_PATH ${SOURCE_PATH}
PATCHES
${CMAKE_CURRENT_LIST_DIR}/jasper-fix-uwp.patch
${CMAKE_CURRENT_LIST_DIR}/opengl-not-required.patch
2017-11-08 01:15:17 +08:00
)
if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic)
set(JAS_ENABLE_SHARED ON)
else()
set(JAS_ENABLE_SHARED OFF)
2017-06-01 21:42:52 +08:00
endif()
vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
PREFER_NINJA
OPTIONS
-DJAS_ENABLE_AUTOMATIC_DEPENDENCIES=OFF
-DJAS_ENABLE_LIBJPEG=ON
-DJAS_ENABLE_OPENGL=OFF # not needed for the library
-DJAS_ENABLE_DOC=OFF
2017-11-08 01:15:17 +08:00
-DJAS_ENABLE_PROGRAMS=OFF
-DJAS_ENABLE_SHARED=${JAS_ENABLE_SHARED}
OPTIONS_DEBUG
-DCMAKE_DEBUG_POSTFIX=d # Due to CMakes FindJasper
2017-11-08 01:15:17 +08:00
)
2017-06-01 21:42:52 +08:00
vcpkg_install_cmake()
2017-11-08 01:15:17 +08:00
vcpkg_copy_pdbs()
2017-06-01 21:42:52 +08:00
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
2017-11-08 01:15:17 +08:00
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/lib/pkgconfig)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/share)
2017-06-01 21:42:52 +08:00
file(COPY ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/jasper)
file(RENAME ${CURRENT_PACKAGES_DIR}/share/jasper/LICENSE ${CURRENT_PACKAGES_DIR}/share/jasper/copyright)