r346731 - CMake: Replace open-coded find_package
Tom Stellard via cfe-commits
cfe-commits at lists.llvm.org
Mon Nov 12 19:16:46 PST 2018
Author: tstellar
Date: Mon Nov 12 19:16:45 2018
New Revision: 346731
URL: http://llvm.org/viewvc/llvm-project?rev=346731&view=rev
Log:
CMake: Replace open-coded find_package
Reviewers: beanz, mgorny
Reviewed By: mgorny
Subscribers: cfe-commits, chapuni, llvm-commits
Differential Revision: https://reviews.llvm.org/D32577
Modified:
cfe/trunk/CMakeLists.txt
Modified: cfe/trunk/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/CMakeLists.txt?rev=346731&r1=346730&r2=346731&view=diff
==============================================================================
--- cfe/trunk/CMakeLists.txt (original)
+++ cfe/trunk/CMakeLists.txt Mon Nov 12 19:16:45 2018
@@ -68,13 +68,8 @@ if( CMAKE_SOURCE_DIR STREQUAL CMAKE_CURR
find_program(LLVM_TABLEGEN_EXE "llvm-tblgen" ${LLVM_TOOLS_BINARY_DIR}
NO_DEFAULT_PATH)
- set(LLVMCONFIG_FILE "${LLVM_CMAKE_PATH}/LLVMConfig.cmake")
- if(EXISTS ${LLVMCONFIG_FILE})
- list(APPEND CMAKE_MODULE_PATH "${LLVM_CMAKE_PATH}")
- include(${LLVMCONFIG_FILE})
- else()
- message(FATAL_ERROR "Not found: ${LLVMCONFIG_FILE}")
- endif()
+ find_package(LLVM REQUIRED HINTS "${LLVM_CMAKE_PATH}")
+ list(APPEND CMAKE_MODULE_PATH ${LLVM_DIR})
# They are used as destination of target generators.
set(LLVM_RUNTIME_OUTPUT_INTDIR ${CMAKE_BINARY_DIR}/${CMAKE_CFG_INTDIR}/bin)
More information about the cfe-commits
mailing list