On 7/7/2010 7:45 AM, Marcel Loose wrote:
My pragmatic question is: is there a different way to check whether a
target has already been defined, or not.

Try this:

  get_target_property(mytarget_exists mytarget TYPE)
  if(mytarget_exists)
    message("YES")
  else()
    message("NO")
  endif()

The if(TARGET) mode was added in 2.6.2 to make the
test more readable.

-Brad
_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake

Reply via email to