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/FindQtWaylandScanner.cmake | 37 ++++++++++++++------------------- 1 file changed, 16 insertions(+), 21 deletions(-) (limited to 'find-modules/FindQtWaylandScanner.cmake') diff --git a/find-modules/FindQtWaylandScanner.cmake b/find-modules/FindQtWaylandScanner.cmake index acd7e0b2..7fb8a009 100644 --- a/find-modules/FindQtWaylandScanner.cmake +++ b/find-modules/FindQtWaylandScanner.cmake @@ -2,7 +2,7 @@ # FindQtWaylandScanner # -------------------- # -# Try to find qtwaylandscanner on a Unix system. +# Try to find qtwaylandscanner. # # If the qtwaylandscanner executable is not in your PATH, you can provide # an alternative name or full path location with the ``QtWaylandScanner_EXECUTABLE`` @@ -87,29 +87,24 @@ include(${CMAKE_CURRENT_LIST_DIR}/ECMFindModuleHelpersStub.cmake) ecm_find_package_version_check(QtWaylandScanner) -if(NOT WIN32) - # Find qtwaylandscanner - find_program(QtWaylandScanner_EXECUTABLE NAMES qtwaylandscanner) +# Find qtwaylandscanner +find_program(QtWaylandScanner_EXECUTABLE NAMES qtwaylandscanner) - include(FindPackageHandleStandardArgs) - find_package_handle_standard_args(QtWaylandScanner - FOUND_VAR - QtWaylandScanner_FOUND - REQUIRED_VARS - QtWaylandScanner_EXECUTABLE - ) +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(QtWaylandScanner + FOUND_VAR + QtWaylandScanner_FOUND + REQUIRED_VARS + QtWaylandScanner_EXECUTABLE +) - mark_as_advanced(QtWaylandScanner_EXECUTABLE) +mark_as_advanced(QtWaylandScanner_EXECUTABLE) - if(NOT TARGET Wayland::QtScanner AND QtWaylandScanner_FOUND) - add_executable(Wayland::QtScanner IMPORTED) - set_target_properties(Wayland::QtScanner PROPERTIES - IMPORTED_LOCATION "${QtWaylandScanner_EXECUTABLE}" - ) - endif() -else() - message(STATUS "Wayland and QtWayland are not available on Windows.") - set(QtWaylandScanner_FOUND FALSE) +if(NOT TARGET Wayland::QtScanner AND QtWaylandScanner_FOUND) + add_executable(Wayland::QtScanner IMPORTED) + set_target_properties(Wayland::QtScanner PROPERTIES + IMPORTED_LOCATION "${QtWaylandScanner_EXECUTABLE}" + ) endif() include(FeatureSummary) -- cgit v1.2.1