diff options
author | Alex Merry <alex.merry@kde.org> | 2014-11-07 12:26:48 +0000 |
---|---|---|
committer | Alex Merry <alex.merry@kde.org> | 2014-11-07 12:26:48 +0000 |
commit | 32c41706e06e96ab10b757ebe6337071db53fe43 (patch) | |
tree | 34787589382540628d66cf0529686b657ccd7c07 /find-modules/FindQtWaylandScanner.cmake | |
parent | 7e535b93cdbb7420d241c00cb9c0abf462ff59d8 (diff) | |
download | extra-cmake-modules-32c41706e06e96ab10b757ebe6337071db53fe43.tar.gz extra-cmake-modules-32c41706e06e96ab10b757ebe6337071db53fe43.tar.bz2 |
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
Diffstat (limited to 'find-modules/FindQtWaylandScanner.cmake')
-rw-r--r-- | find-modules/FindQtWaylandScanner.cmake | 37 |
1 files changed, 16 insertions, 21 deletions
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) |