Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[wxwidgets] cmake integration failure #27316

Closed
justinboneh opened this issue Oct 19, 2022 · 4 comments · Fixed by #27391
Closed

[wxwidgets] cmake integration failure #27316

justinboneh opened this issue Oct 19, 2022 · 4 comments · Fixed by #27391
Assignees
Labels
category:port-bug The issue is with a library, which is something the port should already support

Comments

@justinboneh
Copy link

justinboneh commented Oct 19, 2022

Host Environment

  • OS: Windows
  • Compiler:
    • Visual Studio 16 2019
    • CMake 3.24.2

To Reproduce

  1. .\vcpkg.exe install wxwidgets:x64-windows - finishes successfully
  2. On CMake, find_package(wxWidgets COMPONENTS base core gl adv aui html) - fails

Failure logs

CMake Error at E:/workspace/vcpkg/installed/x64-windows/share/wxwidgets/vcpkg-cmake-wrapper.cmake:62 (if):
if given arguments:

"WIN32" "AND" "CMAKE_HOST_WIN32" "AND" "dynamic" "STREQUAL" "static" "AND" "NOT" "wx::core" "IN_LIST" "wxWidgets_LIBRARIES"

Unknown arguments specified

CMakeError.log
CMakeOutput.log

Additional context

Commenting out the lines below solves the issue, as it's supposed to evaluate to false anyway ("dynamic" STREQUAL "static"):

if(WIN32 AND "@VCPKG_LIBRARY_LINKAGE@" STREQUAL "static" AND NOT "wx::core" IN_LIST wxWidgets_LIBRARIES)
find_package(EXPAT QUIET)
find_package(JPEG QUIET)
find_package(PNG QUIET)
find_package(TIFF QUIET)
find_package(ZLIB QUIET)
list(APPEND wxWidgets_LIBRARIES
${EXPAT_LIBRARIES}
${JPEG_LIBRARIES}
${PNG_LIBRARIES}
${TIFF_LIBRARIES}
${ZLIB_LIBRARIES}
)
endif()

@justinboneh justinboneh added the category:port-bug The issue is with a library, which is something the port should already support label Oct 19, 2022
@dg0yt
Copy link
Contributor

dg0yt commented Oct 19, 2022

Well, usage of this port is CI tested, although not with all components.
What is your project's cmake_minimum_required?
What is stdout/stderr of your CMake run? The attached log files are pointless for this issue.

@Cheney-W Cheney-W added the requires:more-information This Issue requires more information to solve label Oct 19, 2022
@justinboneh
Copy link
Author

justinboneh commented Oct 22, 2022

I'm actually using a third-party repository, mrpt.
They set cmake_minimum_required(VERSION 3.8).

The stdout/stderr log is attached.
CMakeStdOutStdErr.log

@dg0yt
Copy link
Contributor

dg0yt commented Oct 22, 2022

  Policy CMP0057 is not set: Support new IN_LIST if() operator.  Run "cmake
  --help-policy CMP0057" for policy details.  Use the cmake_policy command to
  set the policy and suppress this warning.

  IN_LIST will be interpreted as an operator when the policy is set to NEW.
  Since the policy is not set the OLD behavior will be used.
Call Stack (most recent call first):
  E:/workspace/vcpkg/scripts/buildsystems/vcpkg.cmake:788 (include)
  cmakemodules/script_wxwidgets.cmake:44 (find_package)
  CMakeLists.txt:300 (include)
This warning is for project developers.  Use -Wno-dev to suppress it.

CMake Error at E:/workspace/vcpkg/installed/x64-windows/share/wxwidgets/vcpkg-cmake-wrapper.cmake:62 (if):
  if given arguments:

    "WIN32" "AND" "CMAKE_HOST_WIN32" "AND" "dynamic" "STREQUAL" "static" "AND" "NOT" "wx::core" "IN_LIST" "wxWidgets_LIBRARIES"

  Unknown arguments specified

So this stumbles over IN_LIST. That's what I expected. We can set the given policy in the wrapper.

However, mrpt has a problem, too: It calls cmake_minimum_required after project. That is the reason why CMP0057 is not already set: The order of the command must be switched for the policies to take effect. So there can be more unexpected behaviour in that project.

@justinboneh
Copy link
Author

Thanks. I'll open an issue there as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category:port-bug The issue is with a library, which is something the port should already support
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants