[wxWidgets] Fix issue with port usage (#16154)

Fixed issue when necessary header file was not installed that leaded to this error:
`\vcpkg\installed\x64-windows-static\include\wx\platform.h(160,10): fatal error C1083: Cannot open include file: 'wx/setup.h': No such file or directory`

Also fixed string replace enumeration to include only *.h files because otherwise for some reason *.cur file was messed up.

Signed-off-by: Vitalii Koshura <lestat.de.lionkur@gmail.com>
This commit is contained in:
Vitalii Koshura 2021-02-11 09:00:18 +01:00 committed by GitHub
parent fbd84192fe
commit 551875c539
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 22 additions and 7 deletions

View File

@ -66,13 +66,15 @@ endif()
# do the copy pdbs now after the dlls got moved to the expected /bin folder above
vcpkg_copy_pdbs()
if(EXISTS ${CURRENT_PACKAGES_DIR}/debug/lib/mswud)
file(RENAME ${CURRENT_PACKAGES_DIR}/debug/lib/mswud ${CURRENT_PACKAGES_DIR}/lib/mswud)
endif()
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/include/msvc)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
file(GLOB_RECURSE INCLUDES ${CURRENT_PACKAGES_DIR}/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)
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()
foreach(INC IN LISTS INCLUDES)
file(READ "${INC}" _contents)
if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
@ -85,6 +87,9 @@ foreach(INC IN LISTS INCLUDES)
file(WRITE "${INC}" "${_contents}")
endforeach()
if(NOT EXISTS ${CURRENT_PACKAGES_DIR}/include/wx/setup.h)
file(COPY ${CMAKE_CURRENT_LIST_DIR}/setup.h DESTINATION ${CURRENT_PACKAGES_DIR}/include/wx)
endif()
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)

5
ports/wxwidgets/setup.h Normal file
View File

@ -0,0 +1,5 @@
#ifdef _DEBUG
#include "../../debug/lib/mswud/wx/setup.h"
#else
#include "../../lib/mswu/wx/setup.h"
#endif

View File

@ -1,7 +1,7 @@
{
"name": "wxwidgets",
"version-semver": "3.1.4",
"port-version": 5,
"port-version": 6,
"description": "a widget toolkit and tools library for creating graphical user interfaces (GUIs) for cross-platform applications.",
"homepage": "https://github.com/wxWidgets/wxWidgets",
"supports": "!uwp",

View File

@ -6230,7 +6230,7 @@
},
"wxwidgets": {
"baseline": "3.1.4",
"port-version": 5
"port-version": 6
},
"x-plane": {
"baseline": "3.0.3",

View File

@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "eed8ba1dc939b1c1a17a05bf409142664015ad4d",
"version-semver": "3.1.4",
"port-version": 6
},
{
"git-tree": "c608ed7a8383b93a30bd7894b8bee51b0c53066d",
"version-semver": "3.1.4",