cmake: Add 'examples' target
authorDuncan P. N. Exon Smith <dexonsmith@apple.com>
Tue, 6 Jan 2015 23:42:49 +0000 (23:42 +0000)
committerDuncan P. N. Exon Smith <dexonsmith@apple.com>
Tue, 6 Jan 2015 23:42:49 +0000 (23:42 +0000)
llvm-svn: 225319

llvm/cmake/modules/AddLLVM.cmake

index ee55c52..517b828 100644 (file)
@@ -513,6 +513,12 @@ macro(add_llvm_example name)
     install(TARGETS ${name} RUNTIME DESTINATION examples)
   endif()
   set_target_properties(${name} PROPERTIES FOLDER "Examples")
+
+  if(NOT TARGET examples)
+    add_custom_target(examples ${name})
+  else()
+    add_dependencies(examples ${name})
+  endif()
 endmacro(add_llvm_example name)