Assume I have a cmake macro that adds target (library or executable) based on some conditions
macro (conditionally_add target_name target_src condition) if (co
Use the TARGET clause of the if command:
TARGET
if
conditionally_add (mylib mysrc.cc ${some_condition}) if (TARGET mylib) # Do something when target found endif()