Teach LLVM-Config to use logical target names (1/2)

LLVM library names are now available as logical CMake targets both
to our own build and to application CMake code.  Replace use of
'list(FIND)' with a simple 'if(TARGET)' to determine whether a
library is available.

Contributed by Brad King.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@201852 91177308-0d34-0410-b5e6-96231b3b80d8
Teach LLVM-Config to use logical target names (2/2)

The module still needs to collect the list of all available libraries
in order to satisfy the 'all' component.  Provide this in the package
configuration file, 'LLVMConfig.cmake', as a LLVM_AVAILABLE_LIBS
variable.  (A variable is scoped better than a global property.)
Since this won't be set for our own build, fall back to looking up the
LLVM_LIBS property to get the value when it is not set.

Contributed by Brad King.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@201853 91177308-0d34-0410-b5e6-96231b3b80d8
[CMake] Introduce "llvm_add_library(SHARED STATIC)" to build both shared lib and static lib simulataneously.

  llvm_add_library(foo SHARED STATIC
    DEPENDS <dependent targets...>
    LINK_LIBS <required libraries...>
    )

It generates both foo (foo.so) and foo_static(foo.a) and both of them depend on DEPENDS and LINK_LIBS.
Then, also obj.foo is generated. obj.foo depends on DEPENDS, but doesn't depend on LINK_LIBS.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@201854 91177308-0d34-0410-b5e6-96231b3b80d8
[CMake] llvm_add_library: Add dependencies also to objlibs as workaround of CMake issue 14747.

http://www.cmake.org/Bug/view.php?id=14747

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@201855 91177308-0d34-0410-b5e6-96231b3b80d8
[CMake] libLTO: Use (SHARED|STATIC) to build both shared LTO and LTO_static.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@201856 91177308-0d34-0410-b5e6-96231b3b80d8