Merge remote-tracking branch 'upstream/master' into tinyxml2

This commit is contained in:
jasjuang 2017-06-20 15:38:15 -07:00
commit f53585bedd
6 changed files with 120 additions and 17 deletions

View File

@ -1,3 +1,3 @@
Source: glm
Version: 0.9.8.1
Version: 0.9.8.4
Description: OpenGL Mathematics (GLM) https://glm.g-truc.net

View File

@ -1,20 +1,26 @@
#header-only library
include(vcpkg_common_functions)
set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/glm)
vcpkg_download_distfile(ARCHIVE
URLS "https://github.com/g-truc/glm/releases/download/0.9.8.1/glm-0.9.8.1.zip"
FILENAME "glm-0.9.8.1.zip"
SHA512 93223ea7a08d969331a6b93d598c0b59dfc09e86770661c444f81939bd175053d3f6b1211a4aa4e59d732df39b97fe491eb35d4ac2efb286a1cf68ed29bfa80a
)
vcpkg_extract_source_archive(${ARCHIVE})
# Remove glm/CMakeLists.txt
file(REMOVE ${SOURCE_PATH}/glm/CMakeLists.txt)
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO g-truc/glm
REF 0.9.8.4
SHA512 ff0e0651a695caebe9235882d14e09546d52b3cdf66cca8e2078f15b02a3fca4e47bd97d2807aa329f76aa633af3b4999501bd4d0b22ad44b00558d4917f39ed
HEAD_REF master
)
vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
)
vcpkg_install_cmake()
vcpkg_fixup_cmake_targets(CONFIG_PATH "lib/cmake/glm")
vcpkg_copy_pdbs()
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share)
# Put the license file where vcpkg expects it
file(COPY ${SOURCE_PATH}/copying.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/glm/)
file(RENAME ${CURRENT_PACKAGES_DIR}/share/glm/copying.txt ${CURRENT_PACKAGES_DIR}/share/glm/copyright)
# Copy the glm header files
file(GLOB HEADER_FILES ${SOURCE_PATH}/glm/*)
file(COPY ${HEADER_FILES} DESTINATION ${CURRENT_PACKAGES_DIR}/include/glm)

3
ports/utf8proc/CONTROL Normal file
View File

@ -0,0 +1,3 @@
Source: utf8proc
Version: 2.1.0
Description: Clean C library for processing UTF-8 Unicode data.

View File

@ -0,0 +1,48 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index be676ba..7a2b6d8 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -13,9 +13,9 @@ set(SO_MAJOR 2)
set(SO_MINOR 1)
set(SO_PATCH 0)
-add_definitions (
- -DUTF8PROC_EXPORTS
-)
+if(BUILD_SHARED_LIBS)
+ add_definitions(-DUTF8PROC_EXPORTS -DUTF8PROC_SHARED)
+endif()
if (NOT MSVC)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O2 -std=c99 -pedantic -Wall")
@@ -31,3 +31,10 @@ set_target_properties (utf8proc PROPERTIES
VERSION "${SO_MAJOR}.${SO_MINOR}.${SO_PATCH}"
SOVERSION ${SO_MAJOR}
)
+
+install(TARGETS utf8proc
+ RUNTIME DESTINATION bin
+ ARCHIVE DESTINATION lib
+ LIBRARY DESTINATION lib)
+
+install(FILES utf8proc.h DESTINATION include)
diff --git a/utf8proc.h b/utf8proc.h
index edf46d4..7b3f11a 100644
--- a/utf8proc.h
+++ b/utf8proc.h
@@ -120,13 +120,13 @@ typedef bool utf8proc_bool;
#endif
#include <limits.h>
-#ifdef _WIN32
+#if defined _WIN32 && defined UTF8PROC_SHARED
# ifdef UTF8PROC_EXPORTS
# define UTF8PROC_DLLEXPORT __declspec(dllexport)
# else
# define UTF8PROC_DLLEXPORT __declspec(dllimport)
# endif
-#elif __GNUC__ >= 4
+#elif __GNUC__ >= 4 && defined UTF8PROC_SHARED
# define UTF8PROC_DLLEXPORT __attribute__ ((visibility("default")))
#else
# define UTF8PROC_DLLEXPORT

View File

@ -0,0 +1,28 @@
include(vcpkg_common_functions)
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO JuliaLang/utf8proc
REF v2.1.0
SHA512 72b7f377fa6a62018d3eeab8723a27e25db3d1f794ae0bf21fff62ec1a7439bec52e7c93d2a00c218de6ff518097fb4a7a87c56e61ba8c98e689aa8f7171c812)
vcpkg_apply_patches(SOURCE_PATH ${SOURCE_PATH}
PATCHES ${CMAKE_CURRENT_LIST_DIR}/fix-buildsystem.patch)
vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
PREFER_NINJA)
vcpkg_install_cmake()
vcpkg_copy_pdbs()
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
file(READ ${CURRENT_PACKAGES_DIR}/include/utf8proc.h UTF8PROC_H)
if(VCPKG_LIBRARY_LINKAGE STREQUAL static)
string(REPLACE "defined UTF8PROC_SHARED" "0" UTF8PROC_H "${UTF8PROC_H}")
else()
string(REPLACE "defined UTF8PROC_SHARED" "1" UTF8PROC_H "${UTF8PROC_H}")
endif()
file(WRITE ${CURRENT_PACKAGES_DIR}/include/utf8proc.h "${UTF8PROC_H}")
file(COPY ${SOURCE_PATH}/LICENSE.md DESTINATION ${CURRENT_PACKAGES_DIR}/share/utf8proc)
file(RENAME ${CURRENT_PACKAGES_DIR}/share/utf8proc/LICENSE.md ${CURRENT_PACKAGES_DIR}/share/utf8proc/copyright)

View File

@ -76,8 +76,6 @@ function(vcpkg_fixup_cmake_targets)
"${RELEASE_SHARE}/*[Cc]onfig-release.cmake"
)
foreach(RELEASE_TARGET ${RELEASE_TARGETS})
get_filename_component(RELEASE_TARGET_NAME ${RELEASE_TARGET} NAME)
file(READ ${RELEASE_TARGET} _contents)
string(REGEX REPLACE "\\\${_IMPORT_PREFIX}/bin/([^ \"]+\\.exe)" "\${_IMPORT_PREFIX}/tools/${PORT}/\\1" _contents "${_contents}")
file(WRITE ${RELEASE_TARGET} "${_contents}")
@ -99,6 +97,26 @@ function(vcpkg_fixup_cmake_targets)
file(REMOVE ${DEBUG_TARGET})
endforeach()
file(GLOB MAIN_TARGETS "${RELEASE_SHARE}/*[Tt]argets.cmake")
foreach(MAIN_TARGET ${MAIN_TARGETS})
file(READ ${MAIN_TARGET} _contents)
string(REGEX REPLACE
"get_filename_component\\(_IMPORT_PREFIX \"\\\${CMAKE_CURRENT_LIST_FILE}\" PATH\\)(\nget_filename_component\\(_IMPORT_PREFIX \"\\\${_IMPORT_PREFIX}\" PATH\\))*"
"get_filename_component(_IMPORT_PREFIX \"\${CMAKE_CURRENT_LIST_FILE}\" PATH)\nget_filename_component(_IMPORT_PREFIX \"\${_IMPORT_PREFIX}\" PATH)\nget_filename_component(_IMPORT_PREFIX \"\${_IMPORT_PREFIX}\" PATH)"
_contents "${_contents}")
file(WRITE ${MAIN_TARGET} "${_contents}")
endforeach()
file(GLOB MAIN_CONFIGS "${RELEASE_SHARE}/*[Cc]onfig.cmake")
foreach(MAIN_CONFIG ${MAIN_CONFIGS})
file(READ ${MAIN_CONFIG} _contents)
string(REGEX REPLACE
"get_filename_component\\(PACKAGE_PREFIX_DIR \"\\\${CMAKE_CURRENT_LIST_DIR}/\\.\\./(\\.\\./)*\" ABSOLUTE\\)"
"get_filename_component(PACKAGE_PREFIX_DIR \"\${CMAKE_CURRENT_LIST_DIR}/../../\" ABSOLUTE)"
_contents "${_contents}")
file(WRITE ${MAIN_CONFIG} "${_contents}")
endforeach()
# Remove /debug/share/<port>/ if it's empty.
file(GLOB_RECURSE REMAINING_FILES "${DEBUG_SHARE}/*")
if(NOT REMAINING_FILES)