set(CLANG_VENDOR_UTI "org.llvm.clang" CACHE STRING
"Vendor-specific uti.")
+set(CLANG_PYTHON_BINDINGS_VERSIONS "" CACHE STRING
+ "Python versions to install libclang python bindings for")
+
# The libdir suffix must exactly match whatever LLVM's configuration used.
set(CLANG_LIBDIR_SUFFIX "${LLVM_LIBDIR_SUFFIX}")
add_llvm_install_targets(install-libclang-headers
COMPONENT libclang-headers)
endif()
+
+# Create a target to install the python bindings to make them easier to
+# distribute. Since the bindings are over libclang, which is installed
+# unbundled to the clang version, follow suit.
+foreach(PythonVersion ${CLANG_PYTHON_BINDINGS_VERSIONS})
+ install(DIRECTORY
+ ${CMAKE_CURRENT_SOURCE_DIR}/../../bindings/python/clang
+ COMPONENT
+ libclang-python-bindings
+ DESTINATION
+ "lib${LLVM_LIBDIR_SUFFIX}/python${PythonVersion}/site-packages")
+endforeach()
+if(NOT CMAKE_CONFIGURATION_TYPES)
+ add_custom_target(libclang-python-bindings)
+ add_llvm_install_targets(install-libclang-python-bindings
+ COMPONENT
+ libclang-python-bindings)
+endif()
+