[wxwidgets] Fix usage, add cmake options#17111
[wxwidgets] Fix usage, add cmake options#17111JackBoosY wants to merge 39 commits intomicrosoft:masterfrom
Conversation
|
@SamuelMarks Can you please test this PR? Thanks. |
|
|
@SamuelMarks Sorry I can't repro your issue on my machine, and I got some other errors: Both |
|
@JackBoosY You might need to remove your build dir and recreate it. Or you can manually do those lines: $ cd build
$ mkdir -p 'src/icons'
$ curl -L 'https://raw.githubusercontent.com/wxWidgets/wxWidgets/c034a78/samples/widgets/button.cpp' -o 'src/main.cpp'
$ curl -L 'https://raw.githubusercontent.com/wxWidgets/wxWidgets/c034a78/samples/widgets/widgets.h' -o 'src/widgets.h'
$ curl -L 'https://raw.githubusercontent.com/wxWidgets/wxWidgets/WX_3_0_BRANCH/samples/widgets/icons/button.xpm' -o 'src/icons/button.xpm' |
|
|
@SamuelMarks I think this is a bug of You can find a lot of useless |
|
@JackBoosY Yeah I've been hacking together this, it really is the wrong list of libraries, I could autoprepend them all but I've decided to go manually: cmake_minimum_required(VERSION 3.3)
cmake_policy(SET CMP0048 NEW)
cmake_policy(SET CMP0060 NEW)
project(pp VERSION 0.0.0 LANGUAGES CXX)
set(CMAKE_CXX_STANDARD 14)
file(DOWNLOAD https://raw.githubusercontent.com/wxWidgets/wxWidgets/c034a78/samples/widgets/button.cpp src/main.cpp
EXPECTED_HASH SHA256=c94699427f8b4a90c7ae3e075210bc44ae80098b5303a564f11d3991c620328f)
file(DOWNLOAD https://raw.githubusercontent.com/wxWidgets/wxWidgets/c034a78/samples/widgets/widgets.h src/widgets.h
EXPECTED_HASH SHA256=6ccef93318db87830fd400a8d217f08030358b0494bc594bf533bcf75da9cf2d)
file(DOWNLOAD https://raw.githubusercontent.com/wxWidgets/wxWidgets/WX_3_0_BRANCH/samples/widgets/icons/button.xpm src/icons/button.xpm
EXPECTED_HASH SHA256=c7f7bf9a4b678376a20af95adc213a467450a71040710dacc168fa6885a1ad0f)
set(src ${CMAKE_CURRENT_BINARY_DIR}/src/main.cpp)
#add_library(libjpeg UNKNOWN IMPORTED)
#set_property(TARGET libjpeg PROPERTY IMPORTED_LOCATION "${JPEG_LIBRARIES}")
find_package(wxWidgets REQUIRED)
include(FindJPEG)
find_package(jpeg REQUIRED)
include(FindPNG)
find_package(png REQUIRED)
add_definitions(${PNG_DEFINITIONS})
string(REPLACE "optimized;" "" PNG_LIBRARIES "${PNG_LIBRARIES}")
string(REPLACE "debug;" "" PNG_LIBRARIES "${PNG_LIBRARIES}")
include(FindTIFF)
find_package(tiff REQUIRED)
string(REPLACE "optimized;" "" TIFF_LIBRARIES "${TIFF_LIBRARIES}")
string(REPLACE "debug;" "" TIFF_LIBRARIES "${TIFF_LIBRARIES}")
include(FindLibLZMA)
find_package(lzma REQUIRED)
message(LIBLZMA_LIBRARIES = "${LIBLZMA_LIBRARIES}")
string(REPLACE ">" "" wxWidgets_LIBRARIES "${wxWidgets_LIBRARIES}")
string(REPLACE ";libjpeg.a;" ";${JPEG_LIBRARIES};" wxWidgets_LIBRARIES "${wxWidgets_LIBRARIES}")
string(REPLACE ";libz.a" "" wxWidgets_LIBRARIES "${wxWidgets_LIBRARIES}")
string(REPLACE ";libpng16d.a" "" wxWidgets_LIBRARIES "${wxWidgets_LIBRARIES}")
string(REPLACE ";libpng.a;" ";${PNG_LIBRARIES};" wxWidgets_LIBRARIES "${wxWidgets_LIBRARIES}")
string(REPLACE ";libtiff.a;libtiffd.a;" ";${TIFF_LIBRARIES};" wxWidgets_LIBRARIES "${wxWidgets_LIBRARIES}")
add_executable(${PROJECT_NAME} "${src}")
target_include_directories(${PROJECT_NAME} PRIVATE "${wxWidgets_INCLUDE_DIRS}")
target_link_libraries(${PROJECT_NAME} PRIVATE "${wxWidgets_LIBRARIES}")
target_compile_options(${PROJECT_NAME} PRIVATE "${wxWidgets_FLAGS}")This is really an awful hack… even if at some point I am able to get it to build and run properly. What's the proper way of depending on wxWidgets with |
|
@SamuelMarks There are two ways to solve it:
|
|
So what should I expect, shall I keep waiting for a fix here, should I try and contribute to CMake directly, or…? |
|
FYI: Looks like some unrelated things were merged in… |
|
@SamuelMarks Becuase this PR will fix 3 issues. |
|
Hi @JackBoosY, |
There was a problem hiding this comment.
This is a new experimental fast check for PR issues. Please let us know if this bot is helpful!
After committing all other changes, the version database must be updated
git add -u && git commit
git checkout ab60f27567ec24ab97289fb7a1d8455c74bcad04 -- versions
./vcpkg x-add-version --allDiff
diff --git a/versions/baseline.json b/versions/baseline.json
index 1331fab..ffecb60 100644
--- a/versions/baseline.json
+++ b/versions/baseline.json
@@ -6782,7 +6782,7 @@
},
"wxwidgets": {
"baseline": "3.1.5",
- "port-version": 3
+ "port-version": 4
},
"x-plane": {
"baseline": "3.0.3",
diff --git a/versions/w-/wxwidgets.json b/versions/w-/wxwidgets.json
index f2ade9a..d686454 100644
--- a/versions/w-/wxwidgets.json
+++ b/versions/w-/wxwidgets.json
@@ -1,7 +1,7 @@
{
"versions": [
{
- "git-tree": "e8dec57de7c4d7c31f123d67a38631b713c5dee4",
+ "git-tree": "07c83fd019148ae37ade69fe8c0446aa6bf1dbaa",
"version-semver": "3.1.5",
"port-version": 4
},|
I just tested this change and confirm that it fixes |
Yeah, but the upstream has absolutely no intention to approve to my changes. |
|
@JackBoosY Please link again your fix PRs on wxwidgets |
Added to my first comment. |
|
@JackBoosY Can you resolve your conflict to make sure it works? |
|
This PR needs the upstream approval. |
|
@JackBoosY Hi, please don't merge this PR, Just fix it until we get the approval. |
|
Blocked in upstream (wxWidgets/wxWidgets#2391) for quite a long time, why not use a patch in vcpkg instead? |
|
@playgithub Because I can't vouch for correctness. |
@JackBoosY You have tests to vouch the correctness. |
|
@JackBoosY wxwidgets don't compile on linux: tal@tal-pav15:~/vcpkg$ ./vcpkg install wxwidgets
Computing installation plan...
The following packages will be built and installed:
wxwidgets[core]:x64-linux -> 3.1.5#7
Detecting compiler hash for triplet x64-linux...
Restored 0 packages from /home/tal/.cache/vcpkg/archives in 10.06 ms. Use --debug to see more details.
Starting package 1/1: wxwidgets:x64-linux
Building package wxwidgets[core]:x64-linux...
-- Using cached wxWidgets-wxWidgets-9c0a8be1dc32063d91ed1901fd5fcd54f4f955a1.tar.gz.
-- Extracting source /home/tal/vcpkg/downloads/wxWidgets-wxWidgets-9c0a8be1dc32063d91ed1901fd5fcd54f4f955a1.tar.gz
-- Applying patch disable-platform-lib-dir.patch
-- Applying patch fix-build.patch
-- Using source at /home/tal/vcpkg/buildtrees/wxwidgets/src/54f4f955a1-0d7c66a59e.clean
-- Configuring x64-linux-dbg
CMake Error at scripts/cmake/vcpkg_execute_required_process.cmake:128 (message):
Command failed: /home/tal/vcpkg/downloads/tools/cmake-3.22.2-linux/cmake-3.22.2-linux-x86_64/bin/cmake /home/tal/vcpkg/buildtrees/wxwidgets/src/54f4f955a1-0d7c66a59e.clean -DwxUSE_REGEX=builtin -DwxUSE_ZLIB=sys -DwxUSE_EXPAT=sys -DwxUSE_LIBJPEG=sys -DwxUSE_LIBPNG=sys -DwxUSE_LIBTIFF=sys -DwxBUILD_DISABLE_PLATFORM_LIB_DIR=ON -DwxUSE_STL=OFF -DwxUSE_STD_CONTAINERS=OFF -DCMAKE_MAKE_PROGRAM=/home/tal/vcpkg/downloads/tools/ninja-1.10.2-linux/ninja -DCMAKE_SYSTEM_NAME=Linux -DBUILD_SHARED_LIBS=OFF -DVCPKG_CHAINLOAD_TOOLCHAIN_FILE=/home/tal/vcpkg/scripts/toolchains/linux.cmake -DVCPKG_TARGET_TRIPLET=x64-linux -DVCPKG_SET_CHARSET_FLAG=ON -DVCPKG_PLATFORM_TOOLSET=external -DCMAKE_EXPORT_NO_PACKAGE_REGISTRY=ON -DCMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY=ON -DCMAKE_FIND_PACKAGE_NO_SYSTEM_PACKAGE_REGISTRY=ON -DCMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP=TRUE -DCMAKE_VERBOSE_MAKEFILE=ON -DVCPKG_APPLOCAL_DEPS=OFF -DCMAKE_TOOLCHAIN_FILE=/home/tal/vcpkg/scripts/buildsystems/vcpkg.cmake -DCMAKE_ERROR_ON_ABSOLUTE_INSTALL_DESTINATION=ON -DVCPKG_CXX_FLAGS= -DVCPKG_CXX_FLAGS_RELEASE= -DVCPKG_CXX_FLAGS_DEBUG= -DVCPKG_C_FLAGS= -DVCPKG_C_FLAGS_RELEASE= -DVCPKG_C_FLAGS_DEBUG= -DVCPKG_CRT_LINKAGE=dynamic -DVCPKG_LINKER_FLAGS= -DVCPKG_LINKER_FLAGS_RELEASE= -DVCPKG_LINKER_FLAGS_DEBUG= -DVCPKG_TARGET_ARCHITECTURE=x64 -DCMAKE_INSTALL_LIBDIR:STRING=lib -DCMAKE_INSTALL_BINDIR:STRING=bin -D_VCPKG_ROOT_DIR=/home/tal/vcpkg -D_VCPKG_INSTALLED_DIR=/home/tal/vcpkg/installed -DVCPKG_MANIFEST_INSTALL=OFF -G Ninja -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=/home/tal/vcpkg/packages/wxwidgets_x64-linux/debug
Working Directory: /home/tal/vcpkg/buildtrees/wxwidgets/x64-linux-dbg
Error code: 1
See logs for more information:
/home/tal/vcpkg/buildtrees/wxwidgets/config-x64-linux-dbg-out.log
/home/tal/vcpkg/buildtrees/wxwidgets/config-x64-linux-dbg-err.log
Call Stack (most recent call first):
installed/x64-linux/share/vcpkg-cmake/vcpkg_cmake_configure.cmake:393 (vcpkg_execute_required_process)
ports/wxwidgets/portfile.cmake:35 (vcpkg_cmake_configure)
scripts/ports.cmake:145 (include) |
|
Since April 6, 2021, problems with the debug variant and pc files were resolved for some dependencies. IMHO this PR should be moved forward:
Unfortunately it is hard to contribute here without x64-linux support. |
|
Let it work please, thanks. |
Please test #24047. |
|
In favor of #24047. |
This PR will:
wx-configand parse out cxxflags invcpkg-cmake-wrapper.wx-config --libs.Fixes #17072.
Upstream PR: wxWidgets/wxWidgets#2391