This commit is contained in:
codicodi 2017-01-11 21:20:53 +01:00
parent b966acc5c2
commit 275a59dd9d
7 changed files with 483 additions and 0 deletions

161
ports/glib/CMakeLists.txt Normal file
View File

@ -0,0 +1,161 @@
cmake_minimum_required(VERSION 3.0)
project(glib)
set(GLIB_VERSION 2.50.2)
set(GLIB_DLL_SUFFIX 2)
set(GLIB_LIB_SUFFIX 2.0)
if(CMAKE_BUILD_TYPE STREQUAL Debug)
add_definitions(-DG_ENABLE_DEBUG)
endif()
if(BUILD_SHARED_LIBS)
set(GLIB_EXPORT_MACRO DLL_EXPORT)
endif()
set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake)
# find dependencies
# zlib
find_package(ZLIB REQUIRED)
# pcre
find_path(PCRE_INCLUDE_DIR pcre.h)
if(CMAKE_BUILD_TYPE STREQUAL Debug)
set(PCRE_SUFFIX d)
endif()
find_library(PCRE_LIBRARY pcre${PCRE_SUFFIX})
# libiconv
find_path(ICONV_INCLUDE_DIR iconv.h)
find_library(ICONV_LIBRARY NAMES iconv libiconv)
# libffi
find_path(FFI_INCLUDE_DIR ffi.h)
find_library(FFI_LIBRARY NAMES ffi libffi)
# libintl(gettext)
find_path(LIBINTL_INCLUDE_DIR libintl.h)
find_library(LIBINTL_LIBRARY NAMES intl libintl)
#prepare config files
configure_file(config.h.win32 ${CMAKE_SOURCE_DIR}/config.h COPYONLY)
configure_file(glib/glibconfig.h.win32 ${CMAKE_SOURCE_DIR}/glib/glibconfig.h COPYONLY)
configure_file(gmodule/gmoduleconf.h.win32 ${CMAKE_SOURCE_DIR}/gmodule/gmoduleconf.h COPYONLY)
configure_file(gio/gnetworking.h.win32 ${CMAKE_SOURCE_DIR}/gio/gnetworking.h COPYONLY)
add_definitions(-DHAVE_CONFIG_H)
include_directories(. ./glib)
# This macro purposely doesn't find nodes with sources that have additional properties set
# Most of such files in glib are PCRE sources which we don't use anyway
macro(extract_vcproj_sources VC_PROJECT OUT_VAR)
file(READ ${VC_PROJECT} ${VC_PROJECT}-CONTENTS)
STRING(REPLACE "\n" ";" ${VC_PROJECT}-CONTENTS "${${VC_PROJECT}-CONTENTS}") # split by lines
foreach(LINE ${${VC_PROJECT}-CONTENTS})
if(LINE MATCHES "<ClCompile Include=\\\".*\\\" />")
string(REPLACE "<ClCompile Include=\"..\\..\\..\\" "" LINE ${LINE})
string(REPLACE "\" />" "" LINE ${LINE})
string(STRIP ${LINE} LINE)
file(TO_CMAKE_PATH ${LINE} LINE)
list(APPEND ${OUT_VAR} ${LINE})
endif()
endforeach()
endmacro()
# main module
extract_vcproj_sources(build/win32/vs14/glib.vcxproj GLIB_SOURCES)
list(APPEND GLIB_SOURCES glib/libcharset/localcharset.c) # modified internal version with prefixed symbols
add_library(glib ${GLIB_SOURCES})
target_compile_definitions(glib PRIVATE USE_SYSTEM_PCRE ${GLIB_EXPORT_MACRO} GLIB_COMPILATION G_LOG_DOMAIN="GLib" LIBDIR)
target_link_libraries(glib ws2_32 winmm ${PCRE_LIBRARY} ${ICONV_LIBRARY} ${LIBINTL_LIBRARY})
target_include_directories(glib PRIVATE ${PCRE_INCLUDE_DIR} ${ICONV_INCLUDE_DIR})
target_include_directories(glib PUBLIC ${LIBINTL_INCLUDE_DIR})
list(APPEND GLIB_TARGETS glib)
# gthread
add_library(gthread gthread/gthread-impl.c)
target_compile_definitions(gthread PRIVATE G_LOG_DOMAIN="GThread")
target_link_libraries(gthread glib ${LIBINTL_LIBRARY})
target_include_directories(gthread PRIVATE ${LIBINTL_INCLUDE_DIR})
list(APPEND GLIB_TARGETS gthread)
# gobject
extract_vcproj_sources(build/win32/vs14/gobject.vcxproj GOBJECT_SOURCES)
add_library(gobject ${GOBJECT_SOURCES})
target_compile_definitions(gobject PRIVATE GOBJECT_COMPILATION ${GLIB_EXPORT_MACRO} G_LOG_DOMAIN="GLib-GObject")
target_link_libraries(gobject gthread glib ${FFI_LIBRARY})
target_include_directories(gobject PRIVATE ${FFI_INCLUDE_DIR})
list(APPEND GLIB_TARGETS gobject)
# gmodule
add_library(gmodule gmodule/gmodule.c)
target_compile_definitions(gmodule PRIVATE G_LOG_DOMAIN="GModule")
target_link_libraries(gmodule glib ${LIBINTL_LIBRARY})
target_include_directories(gmodule PRIVATE ${LIBINTL_INCLUDE_DIR})
list(APPEND GLIB_TARGETS gmodule)
# gio
extract_vcproj_sources(build/win32/vs14/gio.vcxproj GIO_SOURCES)
add_library(gio ${GIO_SOURCES})
target_compile_definitions(gio PRIVATE GIO_COMPILATION ${GLIB_EXPORT_MACRO} G_LOG_DOMAIN="GLib-GIO")
target_link_libraries(gio glib gmodule gobject ws2_32 shlwapi dnsapi iphlpapi ${ZLIB_LIBRARIES})
target_include_directories(gio PRIVATE ./gio ./gmodule ${ZLIB_INCLUDE_DIRS})
list(APPEND GLIB_TARGETS gio)
foreach(GTARGET ${GLIB_TARGETS})
set_target_properties(${GTARGET} PROPERTIES
OUTPUT_NAME ${GTARGET}-${GLIB_DLL_SUFFIX}
ARCHIVE_OUTPUT_NAME ${GTARGET}-${GLIB_LIB_SUFFIX})
endforeach()
macro(add_glib_tool TOOL_NAME)
add_executable(${TOOL_NAME} ${ARGN})
target_link_libraries(${TOOL_NAME} glib)
target_compile_definitions(${TOOL_NAME} PRIVATE GLIB_COMPILATION)
list(APPEND GLIB_TOOLS ${TOOL_NAME})
endmacro()
macro(add_gio_tool TOOL_NAME)
add_executable(${TOOL_NAME} ${ARGN})
target_link_libraries(${TOOL_NAME} glib gio gobject gmodule)
target_include_directories(${TOOL_NAME} PRIVATE ./gmodule ./gio)
target_compile_definitions(${TOOL_NAME} PRIVATE GIO_COMPILATION)
list(APPEND GLIB_TOOLS ${TOOL_NAME})
endmacro()
if(NOT GLIB_SKIP_TOOLS)
configure_file(gobject/glib-mkenums.in ${CMAKE_SOURCE_DIR}/gobject/glib-mkenums @ONLY) # uses GLIB_VERSION
install(FILES gobject/glib-mkenums DESTINATION tools)
add_gio_tool(gdbus gio/gdbus-tool.c)
add_gio_tool(gio-querymodules gio/gio-querymodules.c)
file(GLOB GIO_TOOL_SOURCES gio/gio-tool*.c)
add_gio_tool(gio-tool ${GIO_TOOL_SOURCES})
set_target_properties(gio-tool PROPERTIES OUTPUT_NAME gio)
add_gio_tool(glib-compile-resources gio/glib-compile-resources.c gio/gvdb/gvdb-builder.c)
add_gio_tool(glib-compile-schemas gio/glib-compile-schemas.c gio/gvdb/gvdb-builder.c)
add_gio_tool(gresource gio/gresource-tool.c)
add_gio_tool(gsettings gio/gsettings-tool.c)
if(CMAKE_SIZEOF_VOID_P EQUAL 4)
set(WIN win32)
else()
set(WIN win64)
endif()
add_glib_tool(glib-genmarshal gobject/glib-genmarshal.c)
add_glib_tool(gspawn-${WIN}-helper WIN32 glib/gspawn-win32-helper.c)
add_glib_tool(gspawn-${WIN}-helper-console glib/gspawn-win32-helper-console.c)
install(TARGETS ${GLIB_TOOLS} RUNTIME DESTINATION tools)
endif()
install(TARGETS ${GLIB_TARGETS} RUNTIME DESTINATION bin ARCHIVE DESTINATION lib LIBRARY DESTINATION lib)
if(NOT GLIB_SKIP_HEADERS)
include(install_headers)
endif()
message(STATUS "Link-time dependencies:")
message(STATUS " " ${ZLIB_LIBRARIES})
message(STATUS " " ${PCRE_LIBRARY})
message(STATUS " " ${ICONV_LIBRARY})
message(STATUS " " ${FFI_LIBRARY})
message(STATUS " " ${LIBINTL_LIBRARY})

4
ports/glib/CONTROL Normal file
View File

@ -0,0 +1,4 @@
Source: glib
Version: 2.50.2
Description: Portable, general-purpose utility library.
Build-Depends: zlib, pcre, libffi, gettext, libiconv

View File

@ -0,0 +1,255 @@
# generated from glib-install.props
install(FILES glib/glib.h DESTINATION include)
install(FILES glib/glibconfig.h DESTINATION include)
install(FILES glib/glib.h DESTINATION include)
install(FILES glib/glib-object.h DESTINATION include)
install(FILES glib/deprecated/gallocator.h DESTINATION include/glib/deprecated)
install(FILES glib/deprecated/gcache.h DESTINATION include/glib/deprecated)
install(FILES glib/deprecated/gcompletion.h DESTINATION include/glib/deprecated)
install(FILES glib/deprecated/gmain.h DESTINATION include/glib/deprecated)
install(FILES glib/deprecated/grel.h DESTINATION include/glib/deprecated)
install(FILES glib/deprecated/gthread.h DESTINATION include/glib/deprecated)
install(FILES glib/glib-autocleanups.h DESTINATION include/glib)
install(FILES glib/galloca.h DESTINATION include/glib)
install(FILES glib/garray.h DESTINATION include/glib)
install(FILES glib/gasyncqueue.h DESTINATION include/glib)
install(FILES glib/gatomic.h DESTINATION include/glib)
install(FILES glib/gbacktrace.h DESTINATION include/glib)
install(FILES glib/gbase64.h DESTINATION include/glib)
install(FILES glib/gbitlock.h DESTINATION include/glib)
install(FILES glib/gbookmarkfile.h DESTINATION include/glib)
install(FILES glib/gbytes.h DESTINATION include/glib)
install(FILES glib/gcharset.h DESTINATION include/glib)
install(FILES glib/gchecksum.h DESTINATION include/glib)
install(FILES glib/gconvert.h DESTINATION include/glib)
install(FILES glib/gdataset.h DESTINATION include/glib)
install(FILES glib/gdate.h DESTINATION include/glib)
install(FILES glib/gdatetime.h DESTINATION include/glib)
install(FILES glib/gdir.h DESTINATION include/glib)
install(FILES glib/genviron.h DESTINATION include/glib)
install(FILES glib/gerror.h DESTINATION include/glib)
install(FILES glib/gfileutils.h DESTINATION include/glib)
install(FILES glib/ggettext.h DESTINATION include/glib)
install(FILES glib/ghash.h DESTINATION include/glib)
install(FILES glib/ghmac.h DESTINATION include/glib)
install(FILES glib/ghook.h DESTINATION include/glib)
install(FILES glib/ghostutils.h DESTINATION include/glib)
install(FILES glib/gi18n.h DESTINATION include/glib)
install(FILES glib/gi18n-lib.h DESTINATION include/glib)
install(FILES glib/giochannel.h DESTINATION include/glib)
install(FILES glib/gkeyfile.h DESTINATION include/glib)
install(FILES glib/glist.h DESTINATION include/glib)
install(FILES glib/gmacros.h DESTINATION include/glib)
install(FILES glib/gmain.h DESTINATION include/glib)
install(FILES glib/gmappedfile.h DESTINATION include/glib)
install(FILES glib/gmarkup.h DESTINATION include/glib)
install(FILES glib/gmem.h DESTINATION include/glib)
install(FILES glib/gmessages.h DESTINATION include/glib)
install(FILES glib/gnode.h DESTINATION include/glib)
install(FILES glib/goption.h DESTINATION include/glib)
install(FILES glib/gpattern.h DESTINATION include/glib)
install(FILES glib/gpoll.h DESTINATION include/glib)
install(FILES glib/gprimes.h DESTINATION include/glib)
install(FILES glib/gqsort.h DESTINATION include/glib)
install(FILES glib/gquark.h DESTINATION include/glib)
install(FILES glib/gqueue.h DESTINATION include/glib)
install(FILES glib/grand.h DESTINATION include/glib)
install(FILES glib/gregex.h DESTINATION include/glib)
install(FILES glib/gscanner.h DESTINATION include/glib)
install(FILES glib/gsequence.h DESTINATION include/glib)
install(FILES glib/gshell.h DESTINATION include/glib)
install(FILES glib/gslice.h DESTINATION include/glib)
install(FILES glib/gslist.h DESTINATION include/glib)
install(FILES glib/gspawn.h DESTINATION include/glib)
install(FILES glib/gstdio.h DESTINATION include/glib)
install(FILES glib/gstrfuncs.h DESTINATION include/glib)
install(FILES glib/gtestutils.h DESTINATION include/glib)
install(FILES glib/gstring.h DESTINATION include/glib)
install(FILES glib/gstringchunk.h DESTINATION include/glib)
install(FILES glib/gthread.h DESTINATION include/glib)
install(FILES glib/gthreadpool.h DESTINATION include/glib)
install(FILES glib/gtimer.h DESTINATION include/glib)
install(FILES glib/gtimezone.h DESTINATION include/glib)
install(FILES glib/gtrashstack.h DESTINATION include/glib)
install(FILES glib/gtree.h DESTINATION include/glib)
install(FILES glib/gtypes.h DESTINATION include/glib)
install(FILES glib/gunicode.h DESTINATION include/glib)
install(FILES glib/gurifuncs.h DESTINATION include/glib)
install(FILES glib/gutils.h DESTINATION include/glib)
install(FILES glib/gvarianttype.h DESTINATION include/glib)
install(FILES glib/gvariant.h DESTINATION include/glib)
install(FILES glib/gversion.h DESTINATION include/glib)
install(FILES glib/gversionmacros.h DESTINATION include/glib)
install(FILES glib/gwin32.h DESTINATION include/glib)
install(FILES glib/gprintf.h DESTINATION include/glib)
install(FILES gmodule/gmodule.h DESTINATION include)
install(FILES gobject/gobject-autocleanups.h DESTINATION include/gobject)
install(FILES gobject/glib-types.h DESTINATION include/gobject)
install(FILES gobject/gbinding.h DESTINATION include/gobject)
install(FILES gobject/gboxed.h DESTINATION include/gobject)
install(FILES gobject/gclosure.h DESTINATION include/gobject)
install(FILES gobject/genums.h DESTINATION include/gobject)
install(FILES gobject/gmarshal.h DESTINATION include/gobject)
install(FILES gobject/gobject.h DESTINATION include/gobject)
install(FILES gobject/gparam.h DESTINATION include/gobject)
install(FILES gobject/gparamspecs.h DESTINATION include/gobject)
install(FILES gobject/gsignal.h DESTINATION include/gobject)
install(FILES gobject/gsourceclosure.h DESTINATION include/gobject)
install(FILES gobject/gtype.h DESTINATION include/gobject)
install(FILES gobject/gtypemodule.h DESTINATION include/gobject)
install(FILES gobject/gtypeplugin.h DESTINATION include/gobject)
install(FILES gobject/gvalue.h DESTINATION include/gobject)
install(FILES gobject/gvaluearray.h DESTINATION include/gobject)
install(FILES gobject/gvaluecollector.h DESTINATION include/gobject)
install(FILES gobject/gvaluetypes.h DESTINATION include/gobject)
install(FILES gobject/gobjectnotifyqueue.c DESTINATION include/gobject)
install(FILES gio/gappinfo.h DESTINATION include/gio)
install(FILES gio/gasyncinitable.h DESTINATION include/gio)
install(FILES gio/gasyncresult.h DESTINATION include/gio)
install(FILES gio/gbufferedinputstream.h DESTINATION include/gio)
install(FILES gio/gbufferedoutputstream.h DESTINATION include/gio)
install(FILES gio/gbytesicon.h DESTINATION include/gio)
install(FILES gio/gcancellable.h DESTINATION include/gio)
install(FILES gio/gcontenttype.h DESTINATION include/gio)
install(FILES gio/gcharsetconverter.h DESTINATION include/gio)
install(FILES gio/gconverter.h DESTINATION include/gio)
install(FILES gio/gconverterinputstream.h DESTINATION include/gio)
install(FILES gio/gconverteroutputstream.h DESTINATION include/gio)
install(FILES gio/gdatagrambased.h DESTINATION include/gio)
install(FILES gio/gdatainputstream.h DESTINATION include/gio)
install(FILES gio/gdataoutputstream.h DESTINATION include/gio)
install(FILES gio/gdrive.h DESTINATION include/gio)
install(FILES gio/gemblem.h DESTINATION include/gio)
install(FILES gio/gemblemedicon.h DESTINATION include/gio)
install(FILES gio/gfile.h DESTINATION include/gio)
install(FILES gio/gfileattribute.h DESTINATION include/gio)
install(FILES gio/gfileenumerator.h DESTINATION include/gio)
install(FILES gio/gfileicon.h DESTINATION include/gio)
install(FILES gio/gfileinfo.h DESTINATION include/gio)
install(FILES gio/gfileinputstream.h DESTINATION include/gio)
install(FILES gio/gfilemonitor.h DESTINATION include/gio)
install(FILES gio/gfilenamecompleter.h DESTINATION include/gio)
install(FILES gio/gfileoutputstream.h DESTINATION include/gio)
install(FILES gio/gfileiostream.h DESTINATION include/gio)
install(FILES gio/gfilterinputstream.h DESTINATION include/gio)
install(FILES gio/gfilteroutputstream.h DESTINATION include/gio)
install(FILES gio/gicon.h DESTINATION include/gio)
install(FILES gio/ginetaddress.h DESTINATION include/gio)
install(FILES gio/ginetaddressmask.h DESTINATION include/gio)
install(FILES gio/ginetsocketaddress.h DESTINATION include/gio)
install(FILES gio/ginputstream.h DESTINATION include/gio)
install(FILES gio/ginitable.h DESTINATION include/gio)
install(FILES gio/gio.h DESTINATION include/gio)
install(FILES gio/gio-autocleanups.h DESTINATION include/gio)
install(FILES gio/giotypes.h DESTINATION include/gio)
install(FILES gio/gioenums.h DESTINATION include/gio)
install(FILES gio/gioerror.h DESTINATION include/gio)
install(FILES gio/giomodule.h DESTINATION include/gio)
install(FILES gio/gioscheduler.h DESTINATION include/gio)
install(FILES gio/giostream.h DESTINATION include/gio)
install(FILES gio/gloadableicon.h DESTINATION include/gio)
install(FILES gio/gmount.h DESTINATION include/gio)
install(FILES gio/gmemoryinputstream.h DESTINATION include/gio)
install(FILES gio/gmemoryoutputstream.h DESTINATION include/gio)
install(FILES gio/gmountoperation.h DESTINATION include/gio)
install(FILES gio/gnativevolumemonitor.h DESTINATION include/gio)
install(FILES gio/gnetworkaddress.h DESTINATION include/gio)
install(FILES gio/gnetworkmonitor.h DESTINATION include/gio)
install(FILES gio/gnetworkservice.h DESTINATION include/gio)
install(FILES gio/goutputstream.h DESTINATION include/gio)
install(FILES gio/gpermission.h DESTINATION include/gio)
install(FILES gio/gpollableinputstream.h DESTINATION include/gio)
install(FILES gio/gpollableoutputstream.h DESTINATION include/gio)
install(FILES gio/gpollableutils.h DESTINATION include/gio)
install(FILES gio/gproxyaddress.h DESTINATION include/gio)
install(FILES gio/gproxy.h DESTINATION include/gio)
install(FILES gio/gproxyaddressenumerator.h DESTINATION include/gio)
install(FILES gio/gproxyresolver.h DESTINATION include/gio)
install(FILES gio/gresolver.h DESTINATION include/gio)
install(FILES gio/gresource.h DESTINATION include/gio)
install(FILES gio/gseekable.h DESTINATION include/gio)
install(FILES gio/gsimpleasyncresult.h DESTINATION include/gio)
install(FILES gio/gsimpleiostream.h DESTINATION include/gio)
install(FILES gio/gsimplepermission.h DESTINATION include/gio)
install(FILES gio/gsocket.h DESTINATION include/gio)
install(FILES gio/gsocketaddress.h DESTINATION include/gio)
install(FILES gio/gsocketaddressenumerator.h DESTINATION include/gio)
install(FILES gio/gsocketclient.h DESTINATION include/gio)
install(FILES gio/gsocketconnectable.h DESTINATION include/gio)
install(FILES gio/gsocketconnection.h DESTINATION include/gio)
install(FILES gio/gsocketcontrolmessage.h DESTINATION include/gio)
install(FILES gio/gsocketlistener.h DESTINATION include/gio)
install(FILES gio/gsocketservice.h DESTINATION include/gio)
install(FILES gio/gsrvtarget.h DESTINATION include/gio)
install(FILES gio/gsimpleproxyresolver.h DESTINATION include/gio)
install(FILES gio/gtask.h DESTINATION include/gio)
install(FILES gio/gsubprocess.h DESTINATION include/gio)
install(FILES gio/gsubprocesslauncher.h DESTINATION include/gio)
install(FILES gio/gtcpconnection.h DESTINATION include/gio)
install(FILES gio/gtcpwrapperconnection.h DESTINATION include/gio)
install(FILES gio/gthreadedsocketservice.h DESTINATION include/gio)
install(FILES gio/gthemedicon.h DESTINATION include/gio)
install(FILES gio/gtlsbackend.h DESTINATION include/gio)
install(FILES gio/gtlscertificate.h DESTINATION include/gio)
install(FILES gio/gtlsclientconnection.h DESTINATION include/gio)
install(FILES gio/gtlsconnection.h DESTINATION include/gio)
install(FILES gio/gtlsdatabase.h DESTINATION include/gio)
install(FILES gio/gtlsfiledatabase.h DESTINATION include/gio)
install(FILES gio/gtlsinteraction.h DESTINATION include/gio)
install(FILES gio/gtlspassword.h DESTINATION include/gio)
install(FILES gio/gtlsserverconnection.h DESTINATION include/gio)
install(FILES gio/gdtlsconnection.h DESTINATION include/gio)
install(FILES gio/gdtlsclientconnection.h DESTINATION include/gio)
install(FILES gio/gdtlsserverconnection.h DESTINATION include/gio)
install(FILES gio/gvfs.h DESTINATION include/gio)
install(FILES gio/gvolume.h DESTINATION include/gio)
install(FILES gio/gvolumemonitor.h DESTINATION include/gio)
install(FILES gio/gzlibcompressor.h DESTINATION include/gio)
install(FILES gio/gzlibdecompressor.h DESTINATION include/gio)
install(FILES gio/glistmodel.h DESTINATION include/gio)
install(FILES gio/gliststore.h DESTINATION include/gio)
install(FILES gio/gapplication.h DESTINATION include/gio)
install(FILES gio/gapplicationcommandline.h DESTINATION include/gio)
install(FILES gio/gactiongroup.h DESTINATION include/gio)
install(FILES gio/gactionmap.h DESTINATION include/gio)
install(FILES gio/gsimpleactiongroup.h DESTINATION include/gio)
install(FILES gio/gremoteactiongroup.h DESTINATION include/gio)
install(FILES gio/gactiongroupexporter.h DESTINATION include/gio)
install(FILES gio/gdbusactiongroup.h DESTINATION include/gio)
install(FILES gio/gaction.h DESTINATION include/gio)
install(FILES gio/gpropertyaction.h DESTINATION include/gio)
install(FILES gio/gsimpleaction.h DESTINATION include/gio)
install(FILES gio/gmenumodel.h DESTINATION include/gio)
install(FILES gio/gmenu.h DESTINATION include/gio)
install(FILES gio/gmenuexporter.h DESTINATION include/gio)
install(FILES gio/gdbusmenumodel.h DESTINATION include/gio)
install(FILES gio/gnotification.h DESTINATION include/gio)
install(FILES gio/gsettingsbackend.h DESTINATION include/gio)
install(FILES gio/gsettingsschema.h DESTINATION include/gio)
install(FILES gio/gsettings.h DESTINATION include/gio)
install(FILES gio/gdbusauthobserver.h DESTINATION include/gio)
install(FILES gio/gcredentials.h DESTINATION include/gio)
install(FILES gio/gdbusutils.h DESTINATION include/gio)
install(FILES gio/gdbuserror.h DESTINATION include/gio)
install(FILES gio/gdbusaddress.h DESTINATION include/gio)
install(FILES gio/gdbusconnection.h DESTINATION include/gio)
install(FILES gio/gdbusmessage.h DESTINATION include/gio)
install(FILES gio/gdbusnameowning.h DESTINATION include/gio)
install(FILES gio/gdbusnamewatching.h DESTINATION include/gio)
install(FILES gio/gdbusproxy.h DESTINATION include/gio)
install(FILES gio/gdbusintrospection.h DESTINATION include/gio)
install(FILES gio/gdbusmethodinvocation.h DESTINATION include/gio)
install(FILES gio/gdbusserver.h DESTINATION include/gio)
install(FILES gio/gdbusinterface.h DESTINATION include/gio)
install(FILES gio/gdbusinterfaceskeleton.h DESTINATION include/gio)
install(FILES gio/gdbusobject.h DESTINATION include/gio)
install(FILES gio/gdbusobjectskeleton.h DESTINATION include/gio)
install(FILES gio/gdbusobjectproxy.h DESTINATION include/gio)
install(FILES gio/gdbusobjectmanager.h DESTINATION include/gio)
install(FILES gio/gdbusobjectmanagerclient.h DESTINATION include/gio)
install(FILES gio/gdbusobjectmanagerserver.h DESTINATION include/gio)
install(FILES gio/gtestdbus.h DESTINATION include/gio)
install(FILES gio/gioenumtypes.h DESTINATION include/gio)
install(FILES gio/gnetworking.h DESTINATION include/gio)
install(FILES gio/gwin32inputstream.h DESTINATION include/gio)
install(FILES gio/gwin32outputstream.h DESTINATION include/gio)

32
ports/glib/portfile.cmake Normal file
View File

@ -0,0 +1,32 @@
include(vcpkg_common_functions)
set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/glib-2.50.2)
vcpkg_download_distfile(ARCHIVE
URLS "https://ftp.gnome.org/pub/gnome/sources/glib/2.50/glib-2.50.2.tar.xz"
FILENAME "glib-2.50.2.tar.xz"
SHA512 63d7b5ece8d7d15b10e06ef10a8e0a4446f30a8d9c97daa3352ec00dfef622728bd42ed24cbf67e553166a0f9e29a3e3d024d1d085b9804fd67608db438b6771)
vcpkg_extract_source_archive(${ARCHIVE})
vcpkg_apply_patches(
SOURCE_PATH ${SOURCE_PATH}
PATCHES
${CMAKE_CURRENT_LIST_DIR}/use-libiconv-on-windows.patch)
file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH})
file(COPY ${CMAKE_CURRENT_LIST_DIR}/cmake DESTINATION ${SOURCE_PATH})
file(REMOVE_RECURSE ${SOURCE_PATH}/glib/pcre)
file(REMOVE ${SOURCE_PATH}/glib/win_iconv.c)
vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
OPTIONS_DEBUG
-DGLIB_SKIP_HEADERS=ON
-DGLIB_SKIP_TOOLS=ON)
vcpkg_install_cmake()
vcpkg_copy_pdbs()
vcpkg_copy_tool_dependencies()
file(COPY ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/glib)
file(RENAME ${CURRENT_PACKAGES_DIR}/share/glib/COPYING ${CURRENT_PACKAGES_DIR}/share/glib/copyright)

View File

@ -0,0 +1,14 @@
diff --git a/glib/gconvert.c b/glib/gconvert.c
index 3deac78..134ded9 100644
--- a/glib/gconvert.c
+++ b/glib/gconvert.c
@@ -30,7 +30,8 @@
#include <stdlib.h>
#ifdef G_OS_WIN32
-#include "win_iconv.c"
+#define USE_LIBICONV_GNU
+#include <iconv.h>
#endif
#ifdef G_PLATFORM_WIN32

View File

@ -11,3 +11,4 @@ include(vcpkg_configure_cmake)
include(vcpkg_configure_qmake)
include(vcpkg_apply_patches)
include(vcpkg_copy_pdbs)
include(vcpkg_copy_tool_dependencies)

View File

@ -0,0 +1,16 @@
# Copy dlls for all tools in ${CURRENT_PACKAGES_DIR}/tools
function(vcpkg_copy_tool_dependencies)
macro(search_for_dependencies PATH_TO_SEARCH)
file(GLOB TOOLS ${CURRENT_PACKAGES_DIR}/tools/*.exe ${CURRENT_PACKAGES_DIR}/tools/*.dll)
foreach(TOOL ${TOOLS})
execute_process(COMMAND powershell -noprofile -executionpolicy UnRestricted -nologo
-file ${VCPKG_ROOT_DIR}/scripts/buildsystems/msbuild/applocal.ps1
-targetBinary ${TOOL}
-installedDir ${PATH_TO_SEARCH}
OUTPUT_VARIABLE OUT)
endforeach()
endmacro()
search_for_dependencies(${CURRENT_PACKAGES_DIR}/bin)
search_for_dependencies(${CURRENT_INSTALLED_DIR}/bin)
endfunction()