cmake: Don't try to install exports if there aren't any

When using LLVM_DISTRIBUTION_COMPONENTS, it's possible for clang's
export list to be empty. If this happens the install(EXPORTS) command
will fail, but since there isn't anything to install anyway we really
just want to skip it.

llvm-svn: 286210
diff --git a/clang/cmake/modules/AddClang.cmake b/clang/cmake/modules/AddClang.cmake
index 16c65f6..e657059 100644
--- a/clang/cmake/modules/AddClang.cmake
+++ b/clang/cmake/modules/AddClang.cmake
@@ -93,6 +93,7 @@
       if(${name} IN_LIST LLVM_DISTRIBUTION_COMPONENTS OR
           NOT LLVM_DISTRIBUTION_COMPONENTS)
         set(export_to_clangtargets EXPORT ClangTargets)
+        set_property(GLOBAL PROPERTY CLANG_HAS_EXPORTS True)
       endif()
 
       install(TARGETS ${name}
@@ -137,6 +138,7 @@
     if(${name} IN_LIST LLVM_DISTRIBUTION_COMPONENTS OR
         NOT LLVM_DISTRIBUTION_COMPONENTS)
       set(export_to_clangtargets EXPORT ClangTargets)
+      set_property(GLOBAL PROPERTY CLANG_HAS_EXPORTS True)
     endif()
 
     install(TARGETS ${name}