diff --git a/CMakeLists.txt b/CMakeLists.txt index 57bb970..6e5de7c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,3 +1,33 @@ +cmake_minimum_required(VERSION 3.4.3) + +project(Clang-Tools-Extra) + +find_package(LLVM REQUIRED HINTS "${LLVM_CMAKE_PATH}") +list(APPEND CMAKE_MODULE_PATH ${LLVM_DIR}) + +# This is the place where we put Clang's 'AddClang.cmake'. +list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules") + +set(LLVM_TOOLS_BINARY_DIR ${TOOLS_BINARY_DIR} CACHE PATH "Path to llvm/bin") +set(LLVM_LIBRARY_DIR ${LIBRARY_DIR} CACHE PATH "Path to llvm/lib") +set(LLVM_MAIN_INCLUDE_DIR ${INCLUDE_DIR} CACHE PATH "Path to llvm/include") +set(LLVM_BINARY_DIR ${LLVM_OBJ_ROOT} CACHE PATH "Path to LLVM build tree") +set(LLVM_MAIN_SRC_DIR ${MAIN_SRC_DIR} CACHE PATH "Path to LLVM source tree") + +set(PACKAGE_VERSION "${LLVM_PACKAGE_VERSION}") + +include(AddClang) +include(AddLLVM) +include(TableGen) +include(HandleLLVMOptions) +include(VersionFromVCS) +include(LLVMDistributionSupport) + +# Dummy targets to appease CMake. These are normally found in the +# Clang tree. +add_custom_target(clang-resource-headers) +add_custom_target(ClangSACheckers) + include(CMakeDependentOption) add_subdirectory(clang-apply-replacements)