Bug 212236 - [GTK] Manette_INCLUDE_DIR and Manette_LIBRARY are undefined.
Summary: [GTK] Manette_INCLUDE_DIR and Manette_LIBRARY are undefined.
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKitGTK (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: ChangSeok Oh
URL:
Keywords:
Depends on:
Blocks: 133847
  Show dependency treegraph
 
Reported: 2020-05-21 16:01 PDT by ChangSeok Oh
Modified: 2020-05-27 10:52 PDT (History)
12 users (show)

See Also:


Attachments
Patch (1.64 KB, patch)
2020-05-21 16:12 PDT, ChangSeok Oh
no flags Details | Formatted Diff | Diff
WIP Patch (2.66 KB, patch)
2020-05-26 09:34 PDT, Don Olmstead
no flags Details | Formatted Diff | Diff
Patch (4.16 KB, patch)
2020-05-26 23:55 PDT, ChangSeok Oh
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description ChangSeok Oh 2020-05-21 16:01:38 PDT
The cmake complains Manette_INCLUDE_DIR and Manette_LIBRARY are missing where ENABLE_GAMEPAD is enabled.
Comment 1 ChangSeok Oh 2020-05-21 16:12:25 PDT
Created attachment 399993 [details]
Patch
Comment 2 ChangSeok Oh 2020-05-25 13:52:56 PDT
I think this is a necessary change. The imported_target argument does not set <XXX>_INCLUDE_DIR and <XXX>_LIBRARY according to the cmake doc. https://cmake.org/cmake/help/v3.13/module/FindPkgConfig.html#command:pkg_check_modules
Comment 3 Don Olmstead 2020-05-26 09:34:04 PDT
Created attachment 400254 [details]
WIP Patch

In your original patch for manette I made a comment about copying what was happening in the Find modules within that directory already. This is what that would look like. I didn't see an actual release of manette on its GitLab so I'm not able to confirm the regex version finding but it should work. This will for sure set all the variables that the CMake references.

Also as an aside

    find_package(Manette 0.2.4 REQUIRED)
    if (NOT Manette_FOUND)
        message(FATAL_ERROR "libmanette is required for ENABLE_GAMEPAD")
    endif ()
    SET_AND_EXPOSE_TO_BUILD(USE_MANETTE TRUE)

You should also remove the REQUIRED as it will error before your FATAL_ERROR message is reached.
Comment 4 ChangSeok Oh 2020-05-26 23:55:37 PDT
Created attachment 400312 [details]
Patch
Comment 5 ChangSeok Oh 2020-05-27 00:01:04 PDT
(In reply to Don Olmstead from comment #3)
> In your original patch for manette I made a comment about copying what was
> happening in the Find modules within that directory already. This is what
> that would look like.

It's my bad. I did not catch this configuration failure due to the cache on my local. :P

> I didn't see an actual release of manette on its
> GitLab so I'm not able to confirm the regex version finding but it should
> work. This will for sure set all the variables that the CMake references.

I followed FindOpenJPEG.cmake as you said, and checked if the build is fine.

> 
> Also as an aside
> 
>     find_package(Manette 0.2.4 REQUIRED)
>     if (NOT Manette_FOUND)
>         message(FATAL_ERROR "libmanette is required for ENABLE_GAMEPAD")
>     endif ()
>     SET_AND_EXPOSE_TO_BUILD(USE_MANETTE TRUE)
> 
> You should also remove the REQUIRED as it will error before your FATAL_ERROR
> message is reached.

You're right. REQUIRED is removed.
Comment 6 ChangSeok Oh 2020-05-27 10:28:31 PDT
Comment on attachment 400312 [details]
Patch

Thanks!
Comment 7 EWS 2020-05-27 10:52:41 PDT
Committed r262201: <https://trac.webkit.org/changeset/262201>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 400312 [details].