initial commit of xlnt port

This commit is contained in:
Thomas Fussell 2016-12-04 00:30:37 +01:00
parent a710f67e52
commit 937c246ac2
2 changed files with 52 additions and 0 deletions

3
ports/xlnt/CONTROL Normal file
View File

@ -0,0 +1,3 @@
Source: xlnt
Version: 0.9.1
Description: Cross-platform user-friendly xlsx library for C++14

49
ports/xlnt/portfile.cmake Normal file
View File

@ -0,0 +1,49 @@
if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic)
set(STATIC "OFF")
else()
set(STATIC "ON")
endif()
include(vcpkg_common_functions)
find_program(GIT git)
set(GIT_URL "https://github.com/tfussell/xlnt.git")
set(GIT_REV "f33e8870123042b8420f87b82673c11014f6babd")
if(NOT EXISTS "${DOWNLOADS}/xlnt.git")
message(STATUS "Cloning")
vcpkg_execute_required_process(
COMMAND ${GIT} clone --bare ${GIT_URL} ${DOWNLOADS}/xlnt.git
WORKING_DIRECTORY ${DOWNLOADS}
LOGNAME clone
)
endif()
message(STATUS "Cloning done")
if(NOT EXISTS "${CURRENT_BUILDTREES_DIR}/src/.git")
message(STATUS "Adding worktree")
vcpkg_execute_required_process(
COMMAND ${GIT} worktree add -f --detach ${CURRENT_BUILDTREES_DIR}/src ${GIT_REV}
WORKING_DIRECTORY ${DOWNLOADS}/xlnt.git
LOGNAME worktree
)
message(STATUS "Updating sumbodules")
vcpkg_execute_required_process(
COMMAND ${GIT} submodule update --init --remote
WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/src
LOGNAME submodule
)
endif()
message(STATUS "Adding worktree and updating sumbodules done")
vcpkg_configure_cmake(
SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src
OPTIONS -DTESTS=OFF -DSAMPLES=OFF -DBENCHMARKS=OFF -DSTATIC=${STATIC}
)
vcpkg_install_cmake()
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
file(INSTALL ${CURRENT_BUILDTREES_DIR}/src/LICENCE.md DESTINATION ${CURRENT_PACKAGES_DIR}/share/xlnt RENAME copyright)
vcpkg_copy_pdbs()