2020-08-17 23:33:44 +08:00
|
|
|
vcpkg_fail_port_install(ON_TARGET "uwp")
|
|
|
|
|
2017-06-08 18:32:20 +08:00
|
|
|
vcpkg_from_github(
|
|
|
|
OUT_SOURCE_PATH SOURCE_PATH
|
|
|
|
REPO wxWidgets/wxWidgets
|
2020-08-06 04:01:00 +08:00
|
|
|
REF v3.1.4
|
|
|
|
SHA512 108e35220de10afbfc58762498ada9ece0b3166f56a6d11e11836d51bfbaed1de3033c32ed4109992da901fecddcf84ce8a1ba47303f728c159c638dac77d148
|
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
|
2020-08-06 04:01:00 +08:00
|
|
|
fix-stl-build-vs2019-16.6.patch
|
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()
|
|
|
|
|
2018-02-24 17:29:13 +08:00
|
|
|
vcpkg_configure_cmake(
|
|
|
|
SOURCE_PATH ${SOURCE_PATH}
|
|
|
|
PREFER_NINJA
|
|
|
|
OPTIONS
|
|
|
|
-DwxUSE_REGEX=builtin
|
|
|
|
-DwxUSE_ZLIB=sys
|
|
|
|
-DwxUSE_EXPAT=sys
|
|
|
|
-DwxUSE_LIBJPEG=sys
|
|
|
|
-DwxUSE_LIBPNG=sys
|
|
|
|
-DwxUSE_LIBTIFF=sys
|
|
|
|
-DwxUSE_STL=ON
|
|
|
|
-DwxBUILD_DISABLE_PLATFORM_LIB_DIR=ON
|
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
|
|
|
|
2018-02-24 17:29:13 +08:00
|
|
|
vcpkg_install_cmake()
|
2017-05-30 22:00:52 +08:00
|
|
|
|
2018-02-24 17:29:13 +08:00
|
|
|
file(GLOB DLLS "${CURRENT_PACKAGES_DIR}/lib/*.dll")
|
|
|
|
if(DLLS)
|
|
|
|
file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/bin)
|
|
|
|
foreach(DLL ${DLLS})
|
|
|
|
get_filename_component(N "${DLL}" NAME)
|
|
|
|
file(RENAME ${DLL} ${CURRENT_PACKAGES_DIR}/bin/${N})
|
|
|
|
endforeach()
|
2017-05-30 22:00:52 +08:00
|
|
|
endif()
|
2018-02-24 17:29:13 +08:00
|
|
|
file(GLOB DLLS "${CURRENT_PACKAGES_DIR}/debug/lib/*.dll")
|
|
|
|
if(DLLS)
|
|
|
|
file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/debug/bin)
|
|
|
|
foreach(DLL ${DLLS})
|
|
|
|
get_filename_component(N "${DLL}" NAME)
|
|
|
|
file(RENAME ${DLL} ${CURRENT_PACKAGES_DIR}/debug/bin/${N})
|
|
|
|
endforeach()
|
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()
|
|
|
|
|
2018-11-29 14:55:18 +08:00
|
|
|
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/include/msvc)
|
2018-07-31 02:33:59 +08:00
|
|
|
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
|
2021-02-11 16:00:18 +08:00
|
|
|
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)
|
|
|
|
endif()
|
|
|
|
if(EXISTS ${CURRENT_PACKAGES_DIR}/debug/lib/mswud/wx/setup.h)
|
|
|
|
list(APPEND INCLUDES ${CURRENT_PACKAGES_DIR}/debug/lib/mswud/wx/setup.h)
|
|
|
|
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
|
|
|
|
2021-02-11 16:00:18 +08:00
|
|
|
if(NOT EXISTS ${CURRENT_PACKAGES_DIR}/include/wx/setup.h)
|
2021-04-08 05:12:18 +08:00
|
|
|
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)
|
|
|
|
|
|
|
|
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}")
|
|
|
|
|
|
|
|
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}")
|
|
|
|
|
|
|
|
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()
|
2021-02-09 10:30:48 +08:00
|
|
|
file(COPY ${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper.cmake DESTINATION ${CURRENT_PACKAGES_DIR}/share/wxwidgets)
|
|
|
|
configure_file(${CMAKE_CURRENT_LIST_DIR}/usage ${CURRENT_PACKAGES_DIR}/share/wxwidgets/usage COPYONLY)
|
|
|
|
file(INSTALL ${SOURCE_PATH}/docs/licence.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)
|