2017-06-08 18:32:20 +08:00
|
|
|
vcpkg_from_github(
|
|
|
|
OUT_SOURCE_PATH SOURCE_PATH
|
|
|
|
REPO wxWidgets/wxWidgets
|
2023-02-16 01:46:42 +08:00
|
|
|
REF "v${VERSION}"
|
2024-05-18 03:11:49 +08:00
|
|
|
SHA512 6d92635f88fc7b0ee52ef996f87d79d9af34428e2cb4469134b74514135b87b42acbc515c0d2d1e1ff5265b8383c9783ce58655bd410fa9215cfc7a8d528aa87
|
2017-06-08 18:32:20 +08:00
|
|
|
HEAD_REF master
|
2020-08-01 02:30:41 +08:00
|
|
|
PATCHES
|
2022-04-19 01:56:00 +08:00
|
|
|
install-layout.patch
|
|
|
|
relocatable-wx-config.patch
|
2022-05-07 05:57:49 +08:00
|
|
|
nanosvg-ext-depend.patch
|
|
|
|
fix-libs-export.patch
|
2022-05-26 04:55:25 +08:00
|
|
|
fix-pcre2.patch
|
2022-07-28 02:51:32 +08:00
|
|
|
gtk3-link-libraries.patch
|
2022-10-09 12:26:00 +08:00
|
|
|
sdl2.patch
|
2017-05-30 22:00:52 +08:00
|
|
|
)
|
|
|
|
|
2022-05-07 05:57:49 +08:00
|
|
|
vcpkg_check_features(
|
|
|
|
OUT_FEATURE_OPTIONS FEATURE_OPTIONS
|
|
|
|
FEATURES
|
2022-08-04 01:26:21 +08:00
|
|
|
fonts wxUSE_PRIVATE_FONTS
|
2022-10-09 12:26:00 +08:00
|
|
|
media wxUSE_MEDIACTRL
|
|
|
|
sound wxUSE_SOUND
|
|
|
|
webview wxUSE_WEBVIEW
|
2022-08-20 04:39:16 +08:00
|
|
|
webview wxUSE_WEBVIEW_EDGE
|
2022-05-07 05:57:49 +08:00
|
|
|
)
|
|
|
|
|
2022-07-12 05:06:54 +08:00
|
|
|
set(OPTIONS_RELEASE "")
|
|
|
|
if(NOT "debug-support" IN_LIST FEATURES)
|
|
|
|
list(APPEND OPTIONS_RELEASE "-DwxBUILD_DEBUG_LEVEL=0")
|
|
|
|
endif()
|
|
|
|
|
2022-04-19 01:56:00 +08:00
|
|
|
set(OPTIONS "")
|
|
|
|
if(VCPKG_TARGET_IS_WINDOWS AND (VCPKG_TARGET_ARCHITECTURE STREQUAL "arm64" OR VCPKG_TARGET_ARCHITECTURE STREQUAL "arm"))
|
|
|
|
list(APPEND OPTIONS
|
2019-08-24 00:17:51 +08:00
|
|
|
-DwxUSE_STACKWALKER=OFF
|
|
|
|
)
|
|
|
|
endif()
|
|
|
|
|
2022-04-19 01:56:00 +08:00
|
|
|
if(VCPKG_TARGET_IS_WINDOWS OR VCPKG_TARGET_IS_OSX)
|
|
|
|
list(APPEND OPTIONS -DwxUSE_WEBREQUEST_CURL=OFF)
|
|
|
|
else()
|
|
|
|
list(APPEND OPTIONS -DwxUSE_WEBREQUEST_CURL=ON)
|
|
|
|
endif()
|
|
|
|
|
2022-07-28 02:51:32 +08:00
|
|
|
vcpkg_find_acquire_program(PKGCONFIG)
|
2022-04-01 02:11:30 +08:00
|
|
|
|
2021-08-19 23:59:43 +08:00
|
|
|
# This may be set to ON by users in a custom triplet.
|
2021-12-09 07:58:38 +08:00
|
|
|
# The use of 'wxUSE_STL' and 'WXWIDGETS_USE_STD_CONTAINERS' (ON or OFF) are not API compatible
|
|
|
|
# which is why they must be set in a custom triplet rather than a port feature.
|
2021-08-19 23:59:43 +08:00
|
|
|
if(NOT DEFINED WXWIDGETS_USE_STL)
|
|
|
|
set(WXWIDGETS_USE_STL OFF)
|
|
|
|
endif()
|
|
|
|
|
2021-12-09 07:58:38 +08:00
|
|
|
if(NOT DEFINED WXWIDGETS_USE_STD_CONTAINERS)
|
|
|
|
set(WXWIDGETS_USE_STD_CONTAINERS OFF)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
vcpkg_cmake_configure(
|
2022-04-01 02:11:30 +08:00
|
|
|
SOURCE_PATH "${SOURCE_PATH}"
|
2018-02-24 17:29:13 +08:00
|
|
|
OPTIONS
|
2022-05-07 05:57:49 +08:00
|
|
|
${FEATURE_OPTIONS}
|
|
|
|
-DwxUSE_REGEX=sys
|
2018-02-24 17:29:13 +08:00
|
|
|
-DwxUSE_ZLIB=sys
|
|
|
|
-DwxUSE_EXPAT=sys
|
|
|
|
-DwxUSE_LIBJPEG=sys
|
|
|
|
-DwxUSE_LIBPNG=sys
|
|
|
|
-DwxUSE_LIBTIFF=sys
|
2022-07-12 05:06:54 +08:00
|
|
|
-DwxUSE_NANOSVG=sys
|
2022-12-30 15:32:38 +08:00
|
|
|
-DwxUSE_GLCANVAS=ON
|
2022-10-09 12:26:00 +08:00
|
|
|
-DwxUSE_LIBGNOMEVFS=OFF
|
|
|
|
-DwxUSE_LIBNOTIFY=OFF
|
|
|
|
-DwxUSE_SECRETSTORE=OFF
|
2021-08-19 23:59:43 +08:00
|
|
|
-DwxUSE_STL=${WXWIDGETS_USE_STL}
|
2021-12-09 07:58:38 +08:00
|
|
|
-DwxUSE_STD_CONTAINERS=${WXWIDGETS_USE_STD_CONTAINERS}
|
2022-10-09 12:26:00 +08:00
|
|
|
-DwxUSE_UIACTIONSIMULATOR=OFF
|
|
|
|
-DCMAKE_DISABLE_FIND_PACKAGE_GSPELL=ON
|
|
|
|
-DCMAKE_DISABLE_FIND_PACKAGE_MSPACK=ON
|
2019-01-09 07:35:20 +08:00
|
|
|
${OPTIONS}
|
2022-05-26 04:55:25 +08:00
|
|
|
"-DPKG_CONFIG_EXECUTABLE=${PKGCONFIG}"
|
|
|
|
# The minimum cmake version requirement for Cotire is 2.8.12.
|
|
|
|
# however, we need to declare that the minimum cmake version requirement is at least 3.1 to use CMAKE_PREFIX_PATH as the path to find .pc.
|
|
|
|
-DPKG_CONFIG_USE_CMAKE_PREFIX_PATH=ON
|
2022-06-17 06:21:18 +08:00
|
|
|
OPTIONS_RELEASE
|
2022-07-12 05:06:54 +08:00
|
|
|
${OPTIONS_RELEASE}
|
2022-10-09 12:26:00 +08:00
|
|
|
MAYBE_UNUSED_VARIABLES
|
|
|
|
CMAKE_DISABLE_FIND_PACKAGE_GSPELL
|
|
|
|
CMAKE_DISABLE_FIND_PACKAGE_MSPACK
|
2018-02-24 17:29:13 +08:00
|
|
|
)
|
2017-05-30 22:00:52 +08:00
|
|
|
|
2021-12-09 07:58:38 +08:00
|
|
|
vcpkg_cmake_install()
|
2022-07-28 02:51:32 +08:00
|
|
|
vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/wxWidgets)
|
2017-05-30 22:00:52 +08:00
|
|
|
|
2022-07-12 05:06:54 +08:00
|
|
|
# The CMake export is not ready for use: It lacks a config file.
|
|
|
|
file(REMOVE_RECURSE
|
|
|
|
${CURRENT_PACKAGES_DIR}/lib/cmake
|
|
|
|
${CURRENT_PACKAGES_DIR}/debug/lib/cmake
|
|
|
|
)
|
|
|
|
|
2022-04-19 01:56:00 +08:00
|
|
|
set(tools wxrc)
|
2022-10-09 12:26:00 +08:00
|
|
|
if(NOT VCPKG_TARGET_IS_WINDOWS)
|
2022-07-28 02:51:32 +08:00
|
|
|
list(APPEND tools wxrc-3.2)
|
2022-04-19 01:56:00 +08:00
|
|
|
file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/tools/${PORT}")
|
|
|
|
file(RENAME "${CURRENT_PACKAGES_DIR}/bin/wx-config" "${CURRENT_PACKAGES_DIR}/tools/${PORT}/wx-config")
|
|
|
|
if(NOT VCPKG_BUILD_TYPE)
|
|
|
|
file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/tools/${PORT}/debug")
|
|
|
|
file(RENAME "${CURRENT_PACKAGES_DIR}/debug/bin/wx-config" "${CURRENT_PACKAGES_DIR}/tools/${PORT}/debug/wx-config")
|
2022-04-01 02:11:30 +08:00
|
|
|
endif()
|
2017-05-30 22:00:52 +08:00
|
|
|
endif()
|
2022-04-19 01:56:00 +08:00
|
|
|
vcpkg_copy_tools(TOOL_NAMES ${tools} AUTO_CLEAN)
|
2021-02-09 10:30:48 +08:00
|
|
|
|
2020-08-15 00:52:50 +08:00
|
|
|
# do the copy pdbs now after the dlls got moved to the expected /bin folder above
|
|
|
|
vcpkg_copy_pdbs()
|
|
|
|
|
2022-04-01 02:11:30 +08:00
|
|
|
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/include/msvc")
|
|
|
|
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
|
|
|
|
file(GLOB_RECURSE INCLUDES "${CURRENT_PACKAGES_DIR}/include/*.h")
|
|
|
|
if(EXISTS "${CURRENT_PACKAGES_DIR}/lib/mswu/wx/setup.h")
|
|
|
|
list(APPEND INCLUDES "${CURRENT_PACKAGES_DIR}/lib/mswu/wx/setup.h")
|
2021-02-11 16:00:18 +08:00
|
|
|
endif()
|
2022-04-01 02:11:30 +08:00
|
|
|
if(EXISTS "${CURRENT_PACKAGES_DIR}/debug/lib/mswud/wx/setup.h")
|
|
|
|
list(APPEND INCLUDES "${CURRENT_PACKAGES_DIR}/debug/lib/mswud/wx/setup.h")
|
2021-02-11 16:00:18 +08:00
|
|
|
endif()
|
2021-02-09 10:30:48 +08:00
|
|
|
foreach(INC IN LISTS INCLUDES)
|
|
|
|
file(READ "${INC}" _contents)
|
|
|
|
if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
|
|
|
|
string(REPLACE "defined(WXUSINGDLL)" "0" _contents "${_contents}")
|
|
|
|
else()
|
|
|
|
string(REPLACE "defined(WXUSINGDLL)" "1" _contents "${_contents}")
|
|
|
|
endif()
|
|
|
|
# Remove install prefix from setup.h to ensure package is relocatable
|
|
|
|
string(REGEX REPLACE "\n#define wxINSTALL_PREFIX [^\n]*" "\n#define wxINSTALL_PREFIX \"\"" _contents "${_contents}")
|
|
|
|
file(WRITE "${INC}" "${_contents}")
|
|
|
|
endforeach()
|
2020-08-01 02:30:41 +08:00
|
|
|
|
2022-04-01 02:11:30 +08:00
|
|
|
if(NOT EXISTS "${CURRENT_PACKAGES_DIR}/include/wx/setup.h")
|
|
|
|
file(GLOB_RECURSE WX_SETUP_H_FILES_DBG "${CURRENT_PACKAGES_DIR}/debug/lib/*.h")
|
|
|
|
file(GLOB_RECURSE WX_SETUP_H_FILES_REL "${CURRENT_PACKAGES_DIR}/lib/*.h")
|
2022-01-07 05:05:08 +08:00
|
|
|
|
2022-01-13 03:43:30 +08:00
|
|
|
if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release")
|
2024-06-20 05:07:05 +08:00
|
|
|
vcpkg_replace_string("${WX_SETUP_H_FILES_REL}" "${CURRENT_PACKAGES_DIR}" "" IGNORE_UNCHANGED)
|
2022-01-15 08:01:13 +08:00
|
|
|
|
|
|
|
string(REPLACE "${CURRENT_PACKAGES_DIR}/lib/" "" WX_SETUP_H_FILES_REL "${WX_SETUP_H_FILES_REL}")
|
|
|
|
string(REPLACE "/setup.h" "" WX_SETUP_H_REL_RELATIVE "${WX_SETUP_H_FILES_REL}")
|
2022-01-13 03:43:30 +08:00
|
|
|
endif()
|
|
|
|
if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug")
|
2024-06-20 05:07:05 +08:00
|
|
|
vcpkg_replace_string("${WX_SETUP_H_FILES_DBG}" "${CURRENT_PACKAGES_DIR}" "" IGNORE_UNCHANGED)
|
2022-01-15 08:01:13 +08:00
|
|
|
|
|
|
|
string(REPLACE "${CURRENT_PACKAGES_DIR}/debug/lib/" "" WX_SETUP_H_FILES_DBG "${WX_SETUP_H_FILES_DBG}")
|
|
|
|
string(REPLACE "/setup.h" "" WX_SETUP_H_DBG_RELATIVE "${WX_SETUP_H_FILES_DBG}")
|
2022-01-13 03:43:30 +08:00
|
|
|
endif()
|
|
|
|
|
2022-04-01 02:11:30 +08:00
|
|
|
configure_file("${CMAKE_CURRENT_LIST_DIR}/setup.h.in" "${CURRENT_PACKAGES_DIR}/include/wx/setup.h" @ONLY)
|
2021-02-11 16:00:18 +08:00
|
|
|
endif()
|
2022-04-01 02:11:30 +08:00
|
|
|
|
2022-04-22 05:31:21 +08:00
|
|
|
file(GLOB configs LIST_DIRECTORIES false "${CURRENT_PACKAGES_DIR}/lib/wx/config/*" "${CURRENT_PACKAGES_DIR}/tools/${PORT}/wx-config")
|
2022-04-19 01:56:00 +08:00
|
|
|
foreach(config IN LISTS configs)
|
|
|
|
vcpkg_replace_string("${config}" "${CURRENT_INSTALLED_DIR}" [[${prefix}]])
|
|
|
|
endforeach()
|
2022-04-22 05:31:21 +08:00
|
|
|
file(GLOB configs LIST_DIRECTORIES false "${CURRENT_PACKAGES_DIR}/debug/lib/wx/config/*" "${CURRENT_PACKAGES_DIR}/tools/${PORT}/debug/wx-config")
|
2022-04-19 01:56:00 +08:00
|
|
|
foreach(config IN LISTS configs)
|
|
|
|
vcpkg_replace_string("${config}" "${CURRENT_INSTALLED_DIR}/debug" [[${prefix}]])
|
|
|
|
endforeach()
|
|
|
|
|
|
|
|
# For CMake multi-config in connection with wrapper
|
|
|
|
if(EXISTS "${CURRENT_PACKAGES_DIR}/debug/lib/mswud/wx/setup.h")
|
|
|
|
file(INSTALL "${CURRENT_PACKAGES_DIR}/debug/lib/mswud/wx/setup.h"
|
|
|
|
DESTINATION "${CURRENT_PACKAGES_DIR}/lib/mswud/wx"
|
|
|
|
)
|
|
|
|
endif()
|
|
|
|
|
2022-07-12 05:06:54 +08:00
|
|
|
if(NOT "debug-support" IN_LIST FEATURES)
|
2022-10-09 12:26:00 +08:00
|
|
|
if(VCPKG_TARGET_IS_WINDOWS)
|
2022-07-12 05:06:54 +08:00
|
|
|
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/wx/debug.h" "#define wxDEBUG_LEVEL 1" "#define wxDEBUG_LEVEL 0")
|
|
|
|
else()
|
2022-07-28 02:51:32 +08:00
|
|
|
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/wx-3.2/wx/debug.h" "#define wxDEBUG_LEVEL 1" "#define wxDEBUG_LEVEL 0")
|
2022-07-12 05:06:54 +08:00
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
|
2022-04-19 01:56:00 +08:00
|
|
|
if("example" IN_LIST FEATURES)
|
|
|
|
file(INSTALL
|
|
|
|
"${CMAKE_CURRENT_LIST_DIR}/example/CMakeLists.txt"
|
|
|
|
"${SOURCE_PATH}/samples/popup/popup.cpp"
|
|
|
|
"${SOURCE_PATH}/samples/sample.xpm"
|
|
|
|
DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}/example"
|
|
|
|
)
|
|
|
|
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/share/${PORT}/example/popup.cpp" "../sample.xpm" "sample.xpm")
|
|
|
|
endif()
|
|
|
|
|
|
|
|
configure_file("${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper.cmake" "${CURRENT_PACKAGES_DIR}/share/${PORT}/vcpkg-cmake-wrapper.cmake" @ONLY)
|
2022-04-01 02:11:30 +08:00
|
|
|
|
2022-04-19 01:56:00 +08:00
|
|
|
file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")
|
2023-10-19 01:04:28 +08:00
|
|
|
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/docs/licence.txt")
|