2017-06-08 18:32:20 +08:00
|
|
|
vcpkg_from_github(
|
|
|
|
OUT_SOURCE_PATH SOURCE_PATH
|
|
|
|
REPO wxWidgets/wxWidgets
|
2021-05-18 08:42:11 +08:00
|
|
|
REF 9c0a8be1dc32063d91ed1901fd5fcd54f4f955a1 #v3.1.5
|
|
|
|
SHA512 33817f766b36d24e5e6f4eb7666f2e4c1ec305063cb26190001e0fc82ce73decc18697e8005da990a1c99dc1ccdac9b45bb2bbe5ba73e6e2aa860c768583314c
|
2017-06-08 18:32:20 +08:00
|
|
|
HEAD_REF master
|
2020-08-01 02:30:41 +08:00
|
|
|
PATCHES
|
|
|
|
disable-platform-lib-dir.patch
|
2021-05-20 05:05:43 +08:00
|
|
|
fix-build.patch
|
2022-04-01 02:11:30 +08:00
|
|
|
fix-linux-configure.patch # Remove this patch in the next update
|
2017-05-30 22:00:52 +08:00
|
|
|
)
|
|
|
|
|
2019-01-09 07:35:20 +08:00
|
|
|
set(OPTIONS)
|
2020-08-17 23:33:44 +08:00
|
|
|
if(VCPKG_TARGET_IS_OSX)
|
2019-01-09 07:35:20 +08:00
|
|
|
set(OPTIONS -DCOTIRE_MINIMUM_NUMBER_OF_TARGET_SOURCES=9999)
|
|
|
|
endif()
|
|
|
|
|
2019-08-24 00:17:51 +08:00
|
|
|
if(VCPKG_TARGET_ARCHITECTURE STREQUAL arm64 OR VCPKG_TARGET_ARCHITECTURE STREQUAL arm)
|
|
|
|
set(OPTIONS
|
|
|
|
-DwxUSE_OPENGL=OFF
|
|
|
|
-DwxUSE_STACKWALKER=OFF
|
|
|
|
)
|
|
|
|
endif()
|
|
|
|
|
2022-04-01 02:11:30 +08:00
|
|
|
# wxWidgets on Linux currently needs to find the system's `gtk+-3.0.pc`.
|
|
|
|
# vcpkg's port pkgconf would prevent this lookup.
|
|
|
|
if(VCPKG_TARGET_IS_LINUX AND NOT VCPKG_CROSSCOMPILING AND NOT DEFINED ENV{PKG_CONFIG})
|
|
|
|
find_program(system_pkg_config NAMES pkg-config)
|
|
|
|
if(system_pkg_config)
|
|
|
|
set(ENV{PKG_CONFIG} "${system_pkg_config}")
|
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
|
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
|
|
|
|
-DwxUSE_REGEX=builtin
|
|
|
|
-DwxUSE_ZLIB=sys
|
|
|
|
-DwxUSE_EXPAT=sys
|
|
|
|
-DwxUSE_LIBJPEG=sys
|
|
|
|
-DwxUSE_LIBPNG=sys
|
|
|
|
-DwxUSE_LIBTIFF=sys
|
|
|
|
-DwxBUILD_DISABLE_PLATFORM_LIB_DIR=ON
|
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}
|
2019-01-09 07:35:20 +08:00
|
|
|
${OPTIONS}
|
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()
|
2017-05-30 22:00:52 +08:00
|
|
|
|
2022-04-01 02:11:30 +08:00
|
|
|
if (VCPKG_TARGET_IS_WINDOWS)
|
|
|
|
file(GLOB DLLS "${CURRENT_PACKAGES_DIR}/lib/*.dll")
|
|
|
|
if(DLLS)
|
|
|
|
file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/bin")
|
|
|
|
foreach(DLL IN LISTS DLLS)
|
|
|
|
get_filename_component(N "${DLL}" NAME)
|
|
|
|
file(RENAME "${DLL}" "${CURRENT_PACKAGES_DIR}/bin/${N}")
|
|
|
|
endforeach()
|
|
|
|
endif()
|
|
|
|
file(GLOB DLLS "${CURRENT_PACKAGES_DIR}/debug/lib/*.dll")
|
|
|
|
if(DLLS)
|
|
|
|
file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/debug/bin")
|
|
|
|
foreach(DLL IN LISTS DLLS)
|
|
|
|
get_filename_component(N "${DLL}" NAME)
|
|
|
|
file(RENAME "${DLL}" "${CURRENT_PACKAGES_DIR}/debug/bin/${N}")
|
|
|
|
endforeach()
|
|
|
|
endif()
|
2017-05-30 22:00:52 +08:00
|
|
|
endif()
|
|
|
|
|
2021-02-09 10:30:48 +08:00
|
|
|
if(VCPKG_TARGET_IS_WINDOWS)
|
|
|
|
vcpkg_copy_tools(TOOL_NAMES wxrc AUTO_CLEAN)
|
|
|
|
else()
|
|
|
|
vcpkg_copy_tools(TOOL_NAMES wxrc wx-config wxrc-3.1 AUTO_CLEAN)
|
|
|
|
endif()
|
|
|
|
|
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")
|
|
|
|
vcpkg_replace_string("${WX_SETUP_H_FILES_REL}" "${CURRENT_PACKAGES_DIR}" "")
|
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")
|
|
|
|
vcpkg_replace_string("${WX_SETUP_H_FILES_DBG}" "${CURRENT_PACKAGES_DIR}" "")
|
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
|
|
|
|
|
|
|
file(COPY "${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper.cmake" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")
|
|
|
|
configure_file("${CMAKE_CURRENT_LIST_DIR}/usage" "${CURRENT_PACKAGES_DIR}/share/${PORT}/usage" COPYONLY)
|
|
|
|
|
|
|
|
file(INSTALL "${SOURCE_PATH}/docs/licence.txt" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
|