mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-12-28 11:21:12 +08:00
[glibmm] no absolute paths (#22337)
This commit is contained in:
parent
7de32f0237
commit
97f1cc1997
@ -1,149 +0,0 @@
|
||||
cmake_minimum_required(VERSION 3.9)
|
||||
project(glibmm)
|
||||
|
||||
set(CMAKE_CXX_STANDARD 17)
|
||||
|
||||
set(GLIBMM_DLL_SUFFIX 2)
|
||||
set(GLIBMM_LIB_SUFFIX 2.0)
|
||||
set(GLIBMM_EXTRA_LIB_SUFFIX 2.4)
|
||||
|
||||
find_path(GLIB_INCLUDE_DIR NAMES glib.h)
|
||||
find_library(GLIB_LIBRARY NAMES glib-2.0)
|
||||
find_library(GIO_LIBRARY NAMES gio-2.0)
|
||||
find_library(GOBJECT_LIBRARY NAMES gobject-2.0)
|
||||
find_library(GMODULE_LIBRARY NAMES gmodule-2.0)
|
||||
find_library(GTHREAD_LIBRARY NAMES gthread-2.0)
|
||||
find_program(GLIB_COMPILE_SCHEMAS NAMES glib-compile-schemas)
|
||||
find_library(PCRE_LIBRARY NAMES pcre)
|
||||
find_library(SIGC_LIBRARY NAMES sigc-2.0)
|
||||
find_library(FFI_LIBRARY NAMES ffi libffi)
|
||||
|
||||
include_directories(${GLIB_INCLUDE_DIR})
|
||||
link_libraries(
|
||||
${GIO_LIBRARY}
|
||||
${GOBJECT_LIBRARY}
|
||||
${GMODULE_LIBRARY}
|
||||
${GTHREAD_LIBRARY}
|
||||
${GLIB_LIBRARY}
|
||||
${PCRE_LIBRARY}
|
||||
${SIGC_LIBRARY}
|
||||
${FFI_LIBRARY}
|
||||
)
|
||||
|
||||
find_package(Intl REQUIRED)
|
||||
find_package(Iconv REQUIRED)
|
||||
link_libraries(${Intl_LIBRARIES} Iconv::Iconv)
|
||||
|
||||
if(APPLE)
|
||||
find_library(COREFOUNDATION_LIBRARY CoreFoundation)
|
||||
find_library(CORESERVICES_LIBRARY CoreServices)
|
||||
find_library(FOUNDATION_LIBRARY Foundation)
|
||||
link_libraries(${COREFOUNDATION_LIBRARY} ${CORESERVICES_LIBRARY} ${FOUNDATION_LIBRARY})
|
||||
endif()
|
||||
|
||||
# Activate workaround for exporting all symbols from Windows DLLs to mimic the
|
||||
# behavior on Linux, where dynamic libraries always export all symbols.
|
||||
# The same approach was already used by the upstream MSVC build (see MSVC_NMake/gendef/gendef.cc)
|
||||
if (WIN32)
|
||||
set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS TRUE)
|
||||
endif()
|
||||
|
||||
if(NOT BUILD_SHARED_LIBS)
|
||||
add_definitions(-DGLIBMM_STATIC_LIB -DGIOMM_STATIC_LIB)
|
||||
endif()
|
||||
|
||||
if(WIN32)
|
||||
add_compile_options(/FI${WARNINGS_HEADER} -DSIZEOF_WCHAR_T=2)
|
||||
else()
|
||||
set(THREADS_PREFER_PTHREAD_FLAG ON)
|
||||
find_package(Threads REQUIRED)
|
||||
link_libraries(Threads::Threads ${CMAKE_DL_LIBS})
|
||||
endif()
|
||||
|
||||
if(WIN32)
|
||||
configure_file(MSVC_Net2013/giomm/giommconfig.h ${CMAKE_BINARY_DIR}/config/gio/giommconfig.h COPYONLY)
|
||||
configure_file(MSVC_Net2013/glibmm/glibmmconfig.h ${CMAKE_BINARY_DIR}/config/glib/glibmmconfig.h COPYONLY)
|
||||
else()
|
||||
set(ENV{GLIB_COMPILE_SCHEMAS} "${GLIB_COMPILE_SCHEMAS}")
|
||||
set(ENV{GLIBMM_CFLAGS} -I${GLIB_INCLUDE_DIR})
|
||||
set(ENV{GLIBMM_LIBS} "${GLIB_LIBRARY}")
|
||||
set(ENV{GIOMM_CFLAGS} -I${GLIB_INCLUDE_DIR})
|
||||
set(ENV{GIOMM_LIBS} "${GIO_LIBRARY}")
|
||||
set(ENV{PKG_CONFIG} "echo")
|
||||
|
||||
file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/config)
|
||||
execute_process(
|
||||
COMMAND "${CMAKE_SOURCE_DIR}/configure"
|
||||
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/config
|
||||
RESULT_VARIABLE res
|
||||
)
|
||||
if(NOT res EQUAL 0)
|
||||
message(FATAL_ERROR "Configure failed.")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
file(GLOB GLIBMM_SOURCES glib/glibmm/*.cc)
|
||||
add_library(glibmm ${GLIBMM_SOURCES})
|
||||
target_compile_definitions(glibmm PRIVATE -DGLIBMM_BUILD)
|
||||
target_include_directories(glibmm PUBLIC glib ${CMAKE_BINARY_DIR}/config/glib)
|
||||
set_target_properties(glibmm PROPERTIES OUTPUT_NAME glibmm-${GLIBMM_DLL_SUFFIX} ARCHIVE_OUTPUT_NAME glibmm-${GLIBMM_LIB_SUFFIX})
|
||||
|
||||
set(GLIBMM_EXTRA_SOURCES tools/extra_defs_gen/generate_extra_defs.cc)
|
||||
add_library(glibmm_generate_extra_defs ${GLIBMM_EXTRA_SOURCES})
|
||||
target_include_directories(glibmm_generate_extra_defs PUBLIC glib ${CMAKE_BINARY_DIR}/config/glib)
|
||||
set_target_properties(glibmm_generate_extra_defs PROPERTIES
|
||||
OUTPUT_NAME glibmm_generate_extra_defs-${GLIBMM_EXTRA_LIB_SUFFIX}
|
||||
ARCHIVE_OUTPUT_NAME glibmm_generate_extra_defs-${GLIBMM_EXTRA_LIB_SUFFIX})
|
||||
|
||||
set(prefix ${CMAKE_INSTALL_PREFIX})
|
||||
set(exec_prefix ${CMAKE_INSTALL_PREFIX})
|
||||
set(libdir ${CMAKE_INSTALL_PREFIX}/lib)
|
||||
set(includedir ${CMAKE_INSTALL_PREFIX}/include)
|
||||
set(GLIBMM_API_VERSION 2.0)
|
||||
set(GLIBMM_MODULE_NAME glibmm)
|
||||
set(PACKAGE_VERSION 2.52.1)
|
||||
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/glib/glibmm.pc.in" "${CMAKE_CURRENT_BINARY_DIR}/glibmm.pc" @ONLY)
|
||||
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/glibmm.pc" DESTINATION lib/pkgconfig)
|
||||
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/glibmm.pc" DESTINATION lib/pkgconfig RENAME glibmm-2.4.pc)
|
||||
|
||||
file(GLOB GIOMM_SOURCES gio/giomm/*.cc)
|
||||
if(WIN32)
|
||||
list(FILTER GIOMM_SOURCES EXCLUDE REGEX "desktopappinfo.cc\$|/unix[^/]+.cc\$")
|
||||
endif()
|
||||
add_library(giomm ${GIOMM_SOURCES})
|
||||
target_compile_definitions(giomm PRIVATE -DGIOMM_BUILD)
|
||||
target_link_libraries(giomm PUBLIC glibmm)
|
||||
target_include_directories(giomm PUBLIC gio ${CMAKE_BINARY_DIR}/config/gio)
|
||||
|
||||
install(
|
||||
TARGETS glibmm giomm glibmm_generate_extra_defs
|
||||
RUNTIME DESTINATION bin
|
||||
ARCHIVE DESTINATION lib
|
||||
LIBRARY DESTINATION lib
|
||||
)
|
||||
|
||||
if(NOT DISABLE_INSTALL_HEADERS)
|
||||
install(
|
||||
FILES
|
||||
${CMAKE_BINARY_DIR}/config/gio/giommconfig.h
|
||||
gio/giomm.h
|
||||
${CMAKE_BINARY_DIR}/config/glib/glibmmconfig.h
|
||||
glib/glibmm.h
|
||||
DESTINATION include
|
||||
)
|
||||
install(
|
||||
DIRECTORY gio/giomm glib/glibmm
|
||||
DESTINATION include
|
||||
FILES_MATCHING PATTERN *.h
|
||||
)
|
||||
install(
|
||||
DIRECTORY tools/extra_defs_gen/
|
||||
DESTINATION include/glibmm_generate_extra_defs/
|
||||
FILES_MATCHING PATTERN *.h
|
||||
)
|
||||
endif()
|
||||
|
||||
if(NOT DISABLE_EXAMPLES)
|
||||
add_executable(options examples/options/main.cc)
|
||||
target_link_libraries(options PRIVATE giomm)
|
||||
endif()
|
@ -1,34 +0,0 @@
|
||||
#ifndef _MSC_VER
|
||||
#pragma error "This header is for Microsoft VC only."
|
||||
#endif /* _MSC_VER */
|
||||
|
||||
/* Make MSVC more pedantic, this is a recommended pragma list
|
||||
* from _Win32_Programming_ by Rector and Newcomer.
|
||||
*/
|
||||
#pragma warning(error:4002) /* too many actual parameters for macro */
|
||||
#pragma warning(error:4003) /* not enough actual parameters for macro */
|
||||
#pragma warning(1:4010) /* single-line comment contains line-continuation character */
|
||||
#pragma warning(error:4013) /* 'function' undefined; assuming extern returning int */
|
||||
#pragma warning(1:4016) /* no function return type; using int as default */
|
||||
#pragma warning(error:4020) /* too many actual parameters */
|
||||
#pragma warning(error:4021) /* too few actual parameters */
|
||||
#pragma warning(error:4027) /* function declared without formal parameter list */
|
||||
#pragma warning(error:4029) /* declared formal parameter list different from definition */
|
||||
#pragma warning(error:4033) /* 'function' must return a value */
|
||||
#pragma warning(error:4035) /* 'function' : no return value */
|
||||
#pragma warning(error:4045) /* array bounds overflow */
|
||||
#pragma warning(error:4047) /* different levels of indirection */
|
||||
#pragma warning(error:4049) /* terminating line number emission */
|
||||
#pragma warning(error:4053) /* An expression of type void was used as an operand */
|
||||
#pragma warning(error:4071) /* no function prototype given */
|
||||
#pragma warning(disable:4101) /* unreferenced local variable */
|
||||
#pragma warning(error:4150)
|
||||
|
||||
#pragma warning(disable:4244) /* No possible loss of data warnings */
|
||||
#pragma warning(disable:4305) /* No truncation from int to char warnings */
|
||||
|
||||
#pragma warning(error:4819) /* The file contains a character that cannot be represented in the current code page */
|
||||
|
||||
/* work around Microsoft's premature attempt to deprecate the C-Library */
|
||||
#define _CRT_SECURE_NO_WARNINGS
|
||||
#define _CRT_NONSTDC_NO_WARNINGS
|
@ -1,5 +1,4 @@
|
||||
# Glib uses winapi functions not available in WindowsStore
|
||||
vcpkg_fail_port_install(ON_TARGET "UWP")
|
||||
|
||||
vcpkg_download_distfile(ARCHIVE
|
||||
URLS "https://ftp.gnome.org/pub/GNOME/sources/glibmm/2.68/glibmm-2.68.1.tar.xz"
|
||||
@ -13,7 +12,7 @@ vcpkg_extract_source_archive_ex(
|
||||
)
|
||||
|
||||
vcpkg_configure_meson(
|
||||
SOURCE_PATH ${SOURCE_PATH}
|
||||
SOURCE_PATH "${SOURCE_PATH}"
|
||||
OPTIONS
|
||||
-Dbuild-examples=false
|
||||
-Dmsvc14x-parallel-installable=false
|
||||
@ -21,6 +20,8 @@ vcpkg_configure_meson(
|
||||
vcpkg_install_meson()
|
||||
vcpkg_copy_pdbs()
|
||||
|
||||
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/lib/glibmm-2.68/proc" "${CURRENT_PACKAGES_DIR}/lib/glibmm-2.68/proc")
|
||||
|
||||
vcpkg_fixup_pkgconfig()
|
||||
|
||||
# Handle copyright and readme
|
||||
|
@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "glibmm",
|
||||
"version": "2.68.1",
|
||||
"port-version": 1,
|
||||
"port-version": 2,
|
||||
"description": "This is glibmm, a C++ API for parts of glib that are useful for C++.",
|
||||
"homepage": "https://www.gtkmm.org.",
|
||||
"supports": "!uwp",
|
||||
|
@ -2482,7 +2482,7 @@
|
||||
},
|
||||
"glibmm": {
|
||||
"baseline": "2.68.1",
|
||||
"port-version": 1
|
||||
"port-version": 2
|
||||
},
|
||||
"glm": {
|
||||
"baseline": "0.9.9.8",
|
||||
|
@ -1,5 +1,10 @@
|
||||
{
|
||||
"versions": [
|
||||
{
|
||||
"git-tree": "dd76481f04a2d3747dcd2c5eef0333ce5c6d61e5",
|
||||
"version": "2.68.1",
|
||||
"port-version": 2
|
||||
},
|
||||
{
|
||||
"git-tree": "f0db0bb27bb35a57f5d72b56f5d080545dde76ba",
|
||||
"version": "2.68.1",
|
||||
|
Loading…
x
Reference in New Issue
Block a user