Skip to content

Commit

Permalink
[wxwidgets] Fix #4756 (#13361)
Browse files Browse the repository at this point in the history
* [wxwidgets] Fix #4756

* [wxwidgets] Avoid replacing FindwxWidgets from CMake

* [wxwidgets] Provide usage information

* [gppanel] Use built-in CMake module

* [wxchartdir] Use built-in CMake module

* [wxwidgets] Fixup for applocal-ing

* [wxwidgets] Fix osx builds

* Update port_versions

* [gppanel][wxchartdir][wxwidgets] Change versioning schemas

Co-authored-by: Robert Schumacher <[email protected]>
Co-authored-by: NancyLi1013 <[email protected]>
  • Loading branch information
3 people authored Feb 9, 2021
1 parent 5957dcb commit ea11604
Show file tree
Hide file tree
Showing 17 changed files with 102 additions and 62 deletions.
2 changes: 1 addition & 1 deletion ports/gppanel/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ install(TARGETS gpPanel EXPORT gpPanel-config

install(EXPORT gpPanel-config DESTINATION share/cmake/gpPanel)

foreach (HEADER ${HEADERS} )
foreach(HEADER ${HEADERS})
get_filename_component(HEADER_DIR ${HEADER} DIRECTORY)
install(FILES include/${HEADER} DESTINATION include/gpPanel/${HEADER_DIR})
endforeach()
5 changes: 0 additions & 5 deletions ports/gppanel/CONTROL

This file was deleted.

16 changes: 1 addition & 15 deletions ports/gppanel/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -11,22 +11,9 @@ vcpkg_from_github(

file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH})

vcpkg_from_github(
OUT_SOURCE_PATH VCPKG_WX_FIND_SOURCE_PATH
REPO CaeruleusAqua/vcpkg-wx-find
REF 17993e942f677799b488a06ca659a8e46ff272c9
SHA512 0fe07d3669f115c9b6a761abd7743f87e67f24d1eae3f3abee4715fa4d6b76af0d1ea3a4bd82dbdbed430ae50295e1722615ce0ee7d46182125f5048185ee153
HEAD_REF master
)

file(COPY ${CMAKE_ROOT}/Modules/FindPackageHandleStandardArgs.cmake DESTINATION ${VCPKG_WX_FIND_SOURCE_PATH})
file(COPY ${CMAKE_ROOT}/Modules/FindPackageMessage.cmake DESTINATION ${VCPKG_WX_FIND_SOURCE_PATH})

vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
PREFER_NINJA
OPTIONS
-DCMAKE_MODULE_PATH=${VCPKG_WX_FIND_SOURCE_PATH}
)

vcpkg_install_cmake()
Expand All @@ -36,5 +23,4 @@ vcpkg_fixup_cmake_targets(CONFIG_PATH share/cmake/gpPanel)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share)

configure_file(${SOURCE_PATH}/LICENSE ${CURRENT_PACKAGES_DIR}/share/gpPanel/copyright COPYONLY)
file(COPY ${CMAKE_CURRENT_LIST_DIR}/usage DESTINATION ${CURRENT_PACKAGES_DIR}/share/gpPanel)
configure_file(${SOURCE_PATH}/LICENSE ${CURRENT_PACKAGES_DIR}/share/gppanel/copyright COPYONLY)
4 changes: 0 additions & 4 deletions ports/gppanel/usage

This file was deleted.

10 changes: 10 additions & 0 deletions ports/gppanel/vcpkg.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"name": "gppanel",
"version-date": "2020-05-20",
"port-version": 1,
"description": "gpPanel is chart library for wxWidget. It inheritance from wxPanel and use modified wxMathPlot library at chart engine.",
"homepage": "https://github.com/woollybah/gppanel",
"dependencies": [
"wxwidgets"
]
}
5 changes: 0 additions & 5 deletions ports/wxchartdir/CONTROL

This file was deleted.

13 changes: 0 additions & 13 deletions ports/wxchartdir/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -10,22 +10,9 @@ vcpkg_from_github(

file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH})

vcpkg_from_github(
OUT_SOURCE_PATH VCPKG_WX_FIND_SOURCE_PATH
REPO CaeruleusAqua/vcpkg-wx-find
REF 17993e942f677799b488a06ca659a8e46ff272c9
SHA512 0fe07d3669f115c9b6a761abd7743f87e67f24d1eae3f3abee4715fa4d6b76af0d1ea3a4bd82dbdbed430ae50295e1722615ce0ee7d46182125f5048185ee153
HEAD_REF master
)

file(COPY ${CMAKE_ROOT}/Modules/FindPackageHandleStandardArgs.cmake DESTINATION ${VCPKG_WX_FIND_SOURCE_PATH})
file(COPY ${CMAKE_ROOT}/Modules/FindPackageMessage.cmake DESTINATION ${VCPKG_WX_FIND_SOURCE_PATH})

vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
PREFER_NINJA
OPTIONS
-DCMAKE_MODULE_PATH=${VCPKG_WX_FIND_SOURCE_PATH}
)

vcpkg_install_cmake()
Expand Down
11 changes: 11 additions & 0 deletions ports/wxchartdir/vcpkg.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"name": "wxchartdir",
"version": "1.0.0",
"port-version": 1,
"description": "wxChartDir provides components for the integration and use of the commercial C++ library ChartDirector, a universal chart component developed by Advanced Software Engineering Ltd, in wxWidgets based applications.",
"homepage": "https://github.com/utelle/wxchartdir",
"dependencies": [
"chartdir",
"wxwidgets"
]
}
7 changes: 0 additions & 7 deletions ports/wxwidgets/CONTROL

This file was deleted.

32 changes: 23 additions & 9 deletions ports/wxwidgets/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,6 @@ vcpkg_configure_cmake(

vcpkg_install_cmake()

vcpkg_copy_tools(TOOL_NAMES wxrc AUTO_CLEAN)

file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin ${CURRENT_PACKAGES_DIR}/debug/bin)

file(GLOB DLLS "${CURRENT_PACKAGES_DIR}/lib/*.dll")
if(DLLS)
file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/bin)
Expand All @@ -61,16 +57,34 @@ if(DLLS)
endforeach()
endif()

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()

# do the copy pdbs now after the dlls got moved to the expected /bin folder above
vcpkg_copy_pdbs()

if(EXISTS ${CURRENT_PACKAGES_DIR}/lib/mswu/wx/setup.h)
file(RENAME ${CURRENT_PACKAGES_DIR}/lib/mswu/wx/setup.h ${CURRENT_PACKAGES_DIR}/include/wx/setup.h)
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}/lib/mswu)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/lib/mswud)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/include/msvc)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
file(GLOB_RECURSE INCLUDES ${CURRENT_PACKAGES_DIR}/include/*)
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()

file(INSTALL ${SOURCE_PATH}/docs/licence.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)
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 changes: 5 additions & 0 deletions ports/wxwidgets/usage
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
The package wxwidgets provides CMake integration:

find_package(wxWidgets REQUIRED)
target_include_directories(main PRIVATE ${wxWidgets_INCLUDE_DIRS})
target_link_libraries(main PRIVATE ${wxWidgets_LIBRARIES})
19 changes: 19 additions & 0 deletions ports/wxwidgets/vcpkg-cmake-wrapper.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
set(wxWidgets_ROOT_DIR "${CMAKE_CURRENT_LIST_DIR}/../.." CACHE INTERNAL "" FORCE)
set(WX_ROOT_DIR "${wxWidgets_ROOT_DIR}")
set(wxWidgets_LIB_DIR "${wxWidgets_ROOT_DIR}/lib" CACHE INTERNAL "" FORCE)
set(WX_LIB_DIR "${wxWidgets_LIB_DIR}")
find_library(WX_based NAMES wxbase31ud PATHS "${wxWidgets_ROOT_DIR}/debug/lib" NO_DEFAULT_PATH)
file(GLOB WX_DEBUG_LIBS "${wxWidgets_ROOT_DIR}/debug/lib/wx*d_*.lib")
foreach(WX_DEBUG_LIB ${WX_DEBUG_LIBS})
string(REGEX REPLACE ".*wx([^/]*)d_([^/\\.]*)\\.[^/\\.]*\$" "WX_\\2d" varname "${WX_DEBUG_LIB}")
set(${varname} "${WX_DEBUG_LIB}" CACHE INTERNAL "" FORCE)
endforeach()
_find_package(${ARGS})
find_package(ZLIB QUIET)
find_package(libpng CONFIG QUIET)
find_package(TIFF QUIET)
find_package(expat CONFIG QUIET)

if(wxWidgets_LIBRARIES AND NOT wxWidgets_LIBRARIES MATCHES "TIFF::TIFF;png;expat::expat;ZLIB::ZLIB")
list(APPEND wxWidgets_LIBRARIES "TIFF::TIFF;png;expat::expat;ZLIB::ZLIB")
endif()
14 changes: 14 additions & 0 deletions ports/wxwidgets/vcpkg.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"name": "wxwidgets",
"version-semver": "3.1.4",
"port-version": 5,
"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",
"dependencies": [
"expat",
"libpng",
"tiff",
"zlib"
]
}
6 changes: 3 additions & 3 deletions versions/baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -2278,7 +2278,7 @@
},
"gppanel": {
"baseline": "2020-05-20",
"port-version": 0
"port-version": 1
},
"graphene": {
"baseline": "1.10.2",
Expand Down Expand Up @@ -6222,11 +6222,11 @@
},
"wxchartdir": {
"baseline": "1.0.0",
"port-version": 0
"port-version": 1
},
"wxwidgets": {
"baseline": "3.1.4",
"port-version": 3
"port-version": 5
},
"x-plane": {
"baseline": "3.0.3",
Expand Down
5 changes: 5 additions & 0 deletions versions/g-/gppanel.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "4cc181130888f98e2495b4a1f342b28a532f28b4",
"version-date": "2020-05-20",
"port-version": 1
},
{
"git-tree": "9345e63310617dade1d1664276a36f5ca4578546",
"version-string": "2020-05-20",
Expand Down
5 changes: 5 additions & 0 deletions versions/w-/wxchartdir.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "a08e6fa005143547643f47527bb263aca530b715",
"version": "1.0.0",
"port-version": 1
},
{
"git-tree": "c9d334a5412996c85e1d57bf6067ba1934e7f038",
"version-string": "1.0.0",
Expand Down
5 changes: 5 additions & 0 deletions versions/w-/wxwidgets.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "c608ed7a8383b93a30bd7894b8bee51b0c53066d",
"version-semver": "3.1.4",
"port-version": 5
},
{
"git-tree": "ae942a1e9b501be783a788278accf92d99d34434",
"version-string": "3.1.4",
Expand Down

0 comments on commit ea11604

Please sign in to comment.