diff mbox series

[v2,2/3] kernel-shark: Check if Qt has been found when building the examples

Message ID 20200930150741.224779-2-y.karadz@gmail.com (mailing list archive)
State Accepted
Headers show
Series [v2,1/3] kernel-shark: Fix all warnings showing when bulding with gcc 10.2.1 | expand

Commit Message

Yordan Karadzhov Sept. 30, 2020, 3:07 p.m. UTC
Some of the examples depend on Qt. Check is Qt exists befor trying
to build these examples.

Signed-off-by: Yordan Karadzhov (VMware) <y.karadz@gmail.com>
---
 examples/CMakeLists.txt | 16 ++++++++++------
 1 file changed, 10 insertions(+), 6 deletions(-)
diff mbox series

Patch

diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt
index 35e6b1e..032f305 100644
--- a/examples/CMakeLists.txt
+++ b/examples/CMakeLists.txt
@@ -20,10 +20,14 @@  message(STATUS "dataplot")
 add_executable(dplot          dataplot.cpp)
 target_link_libraries(dplot   kshark-plot)
 
-message(STATUS "widgetdemo")
-add_executable(widgetdemo          widgetdemo.cpp)
-target_link_libraries(widgetdemo   kshark-gui)
+if (Qt5Widgets_FOUND)
 
-message(STATUS "cmd_split")
-add_executable(cmd_split           cmd_split.cpp)
-target_link_libraries(cmd_split    kshark-gui)
+    message(STATUS "widgetdemo")
+    add_executable(widgetdemo          widgetdemo.cpp)
+    target_link_libraries(widgetdemo   kshark-gui)
+
+    message(STATUS "cmd_split")
+    add_executable(cmd_split           cmd_split.cpp)
+    target_link_libraries(cmd_split    kshark-gui)
+
+endif (Qt5Widgets_FOUND)