[libxlsxwriter] Add new port (#6460)

* [libxlsxwriter] Add new port

* [libxlsxwriter]Re-generate patch file and fix build error in linux.
This commit is contained in:
NancyLi1013 2019-05-23 21:58:54 -07:00 committed by Phil Christensen
parent 9d623319c6
commit b565987e5c
4 changed files with 92 additions and 0 deletions

View File

@ -0,0 +1,41 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index fe566fe..e76ed46 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -306,31 +306,11 @@ endif()
include(GNUInstallDirs)
-if(MSVC)
- if(CMAKE_CL_64)
- set(MSVC_FOLDER_PREFIX x64)
- else()
- set(MSVC_FOLDER_PREFIX Win32)
- endif()
-
- install(TARGETS ${PROJECT_NAME}
- LIBRARY DESTINATION "lib/${MSVC_FOLDER_PREFIX}/\${CMAKE_INSTALL_CONFIG_NAME}"
- ARCHIVE DESTINATION "lib/${MSVC_FOLDER_PREFIX}/\${CMAKE_INSTALL_CONFIG_NAME}"
- RUNTIME DESTINATION "bin/${MSVC_FOLDER_PREFIX}/\${CMAKE_INSTALL_CONFIG_NAME}"
- )
- if (NOT BUILD_SHARED_LIBS)
- install(FILES ${CMAKE_BINARY_DIR}/${PROJECT_NAME}.pdb
- DESTINATION "lib/${MSVC_FOLDER_PREFIX}/\${CMAKE_INSTALL_CONFIG_NAME}"
- )
- endif()
-
-else(MSVC)
- install(TARGETS ${PROJECT_NAME}
- LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
- ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
- RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
- )
-endif(MSVC)
+install(TARGETS ${PROJECT_NAME}
+ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
+ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
+ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
+)
install(FILES include/xlsxwriter.h DESTINATION include)
install(DIRECTORY include/xlsxwriter
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}

View File

@ -0,0 +1,14 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index e76ed46..32ffa04 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -211,6 +211,9 @@ target_sources(${PROJECT_NAME}
)
target_link_libraries(${PROJECT_NAME} LINK_PUBLIC ${ZLIB_LIBRARIES} ${MINIZIP_LIBRARIES})
target_compile_definitions(${PROJECT_NAME} PRIVATE ${LXW_PRIVATE_COMPILE_DEFINITIONS})
+if (WINDOWSSTORE)
+ target_compile_definitions(${PROJECT_NAME} PRIVATE -DIOWIN32_USING_WINRT_API)
+endif()
target_include_directories(${PROJECT_NAME}
PRIVATE ${LXW_PRIVATE_INCLUDE_DIRS}
PUBLIC include include/xlsxwriter

View File

@ -0,0 +1,4 @@
Source: libxlsxwriter
Version: 0.8.6-1
Description: Libxlsxwriter is a C library that can be used to write text, numbers, formulas and hyperlinks to multiple worksheets in an Excel 2007+ XLSX file.
Build-Depends: zlib

View File

@ -0,0 +1,33 @@
include(vcpkg_common_functions)
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO jmcnamara/libxlsxwriter
REF RELEASE_0.8.6
SHA512 60822dc5f87531edc97cf774e234f25229a605d4430061c24b95c387318e6e05dde1b0f2f433cea14c6f84ee901c1dffe0d174bfd7e2a8459f59bcee900097db
HEAD_REF master
PATCHES
0001-fix-build-error.patch
0002-fix-uwp-build.patch
)
if (VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore")
set(USE_WINDOWSSTORE ON)
else()
set(USE_WINDOWSSTORE OFF)
endif()
vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
PREFER_NINJA
OPTIONS -DWINDOWSSTORE=${USE_WINDOWSSTORE}
)
vcpkg_install_cmake()
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
vcpkg_copy_pdbs()
file(COPY ${SOURCE_PATH}/License.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT}/)
file(RENAME ${CURRENT_PACKAGES_DIR}/share/${PORT}/License.txt ${CURRENT_PACKAGES_DIR}/share/${PORT}/copyright)