Skip to content

Commit

Permalink
cmake: emit warning if X11_Xi or X11_XTest not found
Browse files Browse the repository at this point in the history
at least on Debian, a bullseye installation, the X11 development files
may be installed without the libxi-dev or the libxtest-dev packages.
this leads to the autotype shared library libkeepassxc-autotype-xcb.so
not being built without any complaint from cmake.

this commit makes cmake emit warning messages that shall hint anyone
building themselves that autotype will not work without these libs.
  • Loading branch information
schlimmchen authored and droidmonkey committed Jun 19, 2022
1 parent b86c3e6 commit 63a5e47
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/autotype/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,16 @@ if(WITH_XC_AUTOTYPE)
add_feature_info(Qt5X11Extras Qt5X11Extras_FOUND "The Qt5X11Extras library is required for auto-type")
endif()

# an error will be emitted by find_package above if X11 (or Qt5X11Extras) dev files were not found.
# X11 possibly is installed and found while X11_Xi and/or X11_XTest are not, so we emit a warning.
if(NOT X11_Xi_FOUND)
message(WARNING "The X11 Xi Protocol library is required for auto-type (try libxi-dev package)")
endif()

if(NOT X11_XTest_FOUND)
message(WARNING "The X11 XTEST Protocol library is required for auto-type (try libxtst-dev package)")
endif()

if(X11_FOUND AND X11_Xi_FOUND AND X11_XTest_FOUND AND Qt5X11Extras_FOUND)
add_subdirectory(xcb)
endif()
Expand Down

0 comments on commit 63a5e47

Please sign in to comment.