Commit 0e2a1588 authored by Aleix Pol Gonzalez's avatar Aleix Pol Gonzalez 🐧

cmake/flatpak: prefer using a target to a bool variable

parent 8e8302dd
......@@ -42,7 +42,7 @@ ecm_qt_declare_logging_category(discovercommon_SRCS HEADER libdiscover_debug.h I
add_library(DiscoverCommon ${discovercommon_SRCS})
if(AppStreamQt_FOUND)
if(TARGET AppStreamQt)
target_sources(DiscoverCommon PRIVATE
appstream/OdrsReviewsBackend.cpp
appstream/AppStreamIntegration.cpp
......
  • What are the advantages of if (TARGET ...) over if (package_FOUND)?

  • Sorry Vlad, missed your question. I prefer targets because it's the only thing we need: it has all the information like includes, compile definitions etc while a variable is something volatile that can even sometimes be cached and unreliable.

Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment