diff options
author | fuzzard <fuzzard@kodi.tv> | 2024-05-16 19:59:30 +1000 |
---|---|---|
committer | fuzzard <fuzzard@kodi.tv> | 2024-06-22 14:06:06 +1000 |
commit | 8611aef2a092c0027d7bb22a93721cc11bfcc76b (patch) | |
tree | 9a1e356841109ba3df616062aa516160474acd60 /cmake | |
parent | 6e0f90becdcac533f8b480fe0a5bcd68c30be7b2 (diff) |
[cmake][modules/buildtools] Separate WaylandPP scanner to individual find module
Diffstat (limited to 'cmake')
-rw-r--r-- | cmake/modules/buildtools/FindWaylandPPScanner.cmake | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/cmake/modules/buildtools/FindWaylandPPScanner.cmake b/cmake/modules/buildtools/FindWaylandPPScanner.cmake new file mode 100644 index 0000000000..ff80dbd3f4 --- /dev/null +++ b/cmake/modules/buildtools/FindWaylandPPScanner.cmake @@ -0,0 +1,34 @@ +# FindWaylandPPScanner +# -------- +# Find the WaylandPPScanner Tool +# +# This will define the following target: +# +# wayland::waylandppscanner - The FXC compiler + +if(NOT wayland::waylandppscanner) + + find_package(PkgConfig) + pkg_check_modules(PC_WAYLANDPP_SCANNER wayland-scanner++ QUIET) + + if(PC_WAYLANDPP_SCANNER_FOUND) + pkg_get_variable(PC_WAYLANDPP_SCANNER wayland-scanner++ wayland_scannerpp) + endif() + + find_program(WAYLANDPP_SCANNER wayland-scanner++ HINTS ${PC_WAYLANDPP_SCANNER}) + + if(WAYLANDPP_SCANNER) + + include(FindPackageMessage) + find_package_message(WaylandPPScanner "Found WaylandPP Scanner: ${WAYLANDPP_SCANNER}" "[${WAYLANDPP_SCANNER}]") + + add_executable(wayland::waylandppscanner IMPORTED) + set_target_properties(wayland::waylandppscanner PROPERTIES + IMPORTED_LOCATION "${WAYLANDPP_SCANNER}" + FOLDER "External Projects") + else() + if(WaylandPPScanner_FIND_REQUIRED) + message(FATAL_ERROR "Could NOT find WaylandPP Scanner") + endif() + endif() +endif() |