From 32c41706e06e96ab10b757ebe6337071db53fe43 Mon Sep 17 00:00:00 2001 From: Alex Merry Date: Fri, 7 Nov 2014 12:26:48 +0000 Subject: Do not skip searching for X11 and Wayland on Windows While the search is unlikely to succeed on Windows, having different behaviour between the platforms (eg: find_package(Wayland REQUIRED) was not fatal on Windows, even though Wayland_FOUND would always be FALSE) is not ideal, and if someone did port them to Windows for some reason, the find modules should support that. If applications actually want different behaviour between platforms (like requiring a module on Unix, but not on Windows), they should implement that logic themselves (since they will have to deal with targets not being defined, etc, anyway). REVIEW: 120481 --- find-modules/FindWaylandScanner.cmake | 37 +++++++++++++++-------------------- 1 file changed, 16 insertions(+), 21 deletions(-) (limited to 'find-modules/FindWaylandScanner.cmake') diff --git a/find-modules/FindWaylandScanner.cmake b/find-modules/FindWaylandScanner.cmake index 4cade50f..33c46f9b 100644 --- a/find-modules/FindWaylandScanner.cmake +++ b/find-modules/FindWaylandScanner.cmake @@ -2,7 +2,7 @@ # FindWaylandScanner # ------------------ # -# Try to find wayland-scanner on a Unix system. +# Try to find wayland-scanner. # # If the wayland-scanner executable is not in your PATH, you can provide # an alternative name or full path location with the ``WaylandScanner_EXECUTABLE`` @@ -79,29 +79,24 @@ include(${CMAKE_CURRENT_LIST_DIR}/ECMFindModuleHelpersStub.cmake) ecm_find_package_version_check(WaylandScanner) -if(NOT WIN32) - # Find wayland-scanner - find_program(WaylandScanner_EXECUTABLE NAMES wayland-scanner) +# Find wayland-scanner +find_program(WaylandScanner_EXECUTABLE NAMES wayland-scanner) - include(FindPackageHandleStandardArgs) - find_package_handle_standard_args(WaylandScanner - FOUND_VAR - WaylandScanner_FOUND - REQUIRED_VARS - WaylandScanner_EXECUTABLE - ) +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(WaylandScanner + FOUND_VAR + WaylandScanner_FOUND + REQUIRED_VARS + WaylandScanner_EXECUTABLE +) - mark_as_advanced(WaylandScanner_EXECUTABLE) +mark_as_advanced(WaylandScanner_EXECUTABLE) - if(NOT TARGET Wayland::Scanner AND WaylandScanner_FOUND) - add_executable(Wayland::Scanner IMPORTED) - set_target_properties(Wayland::Scanner PROPERTIES - IMPORTED_LOCATION "${WaylandScanner_EXECUTABLE}" - ) - endif() -else() - message(STATUS "Wayland is not available on Windows.") - set(WaylandScanner_FOUND FALSE) +if(NOT TARGET Wayland::Scanner AND WaylandScanner_FOUND) + add_executable(Wayland::Scanner IMPORTED) + set_target_properties(Wayland::Scanner PROPERTIES + IMPORTED_LOCATION "${WaylandScanner_EXECUTABLE}" + ) endif() include(FeatureSummary) -- cgit v1.2.1