diff --git a/llvm/cmake/modules/CMakeLists.txt b/llvm/cmake/modules/CMakeLists.txt --- a/llvm/cmake/modules/CMakeLists.txt +++ b/llvm/cmake/modules/CMakeLists.txt @@ -54,6 +54,11 @@ set(LLVM_CONFIG_BINARY_DIR "${LLVM_BINARY_DIR}") set(LLVM_CONFIG_TOOLS_BINARY_DIR "${LLVM_TOOLS_BINARY_DIR}") +# Generate a default location for lit +if (LLVM_BUILD_UTILS) + set(LLVM_CONFIG_DEFAULT_EXTERNAL_LIT "${LLVM_CONFIG_TOOLS_BINARY_DIR}/llvm-lit") +endif() + if (LLVM_LINK_LLVM_DYLIB) set(LLVM_CONFIG_LINK_LLVM_DYLIB "set(LLVM_LINK_LLVM_DYLIB ${LLVM_LINK_LLVM_DYLIB})") @@ -103,6 +108,12 @@ set(LLVM_CONFIG_CMAKE_DIR "\${LLVM_INSTALL_PREFIX}/${LLVM_INSTALL_PACKAGE_DIR}") set(LLVM_CONFIG_BINARY_DIR "\${LLVM_INSTALL_PREFIX}") set(LLVM_CONFIG_TOOLS_BINARY_DIR "\${LLVM_INSTALL_PREFIX}/bin") + +# Generate a default location for lit +if (LLVM_INSTALL_UTILS AND LLVM_BUILD_UTILS) + set(LLVM_CONFIG_DEFAULT_EXTERNAL_LIT "${LLVM_CONFIG_TOOLS_BINARY_DIR}/llvm-lit") +endif() + set(LLVM_CONFIG_EXPORTS_FILE "\${LLVM_CMAKE_DIR}/LLVMExports.cmake") set(LLVM_CONFIG_EXPORTS "${LLVM_EXPORTS}") configure_file( diff --git a/llvm/cmake/modules/LLVMConfig.cmake.in b/llvm/cmake/modules/LLVMConfig.cmake.in --- a/llvm/cmake/modules/LLVMConfig.cmake.in +++ b/llvm/cmake/modules/LLVMConfig.cmake.in @@ -93,6 +93,7 @@ set(LLVM_BINARY_DIR "@LLVM_CONFIG_BINARY_DIR@") set(LLVM_TOOLS_BINARY_DIR "@LLVM_CONFIG_TOOLS_BINARY_DIR@") set(LLVM_TOOLS_INSTALL_DIR "@LLVM_TOOLS_INSTALL_DIR@") +set(LLVM_DEFAULT_EXTERNAL_LIT "@LLVM_CONFIG_DEFAULT_EXTERNAL_LIT@") set(LLVM_HAVE_OPT_VIEWER_MODULES @LLVM_HAVE_OPT_VIEWER_MODULES@) set(LLVM_CONFIGURATION_TYPES @CMAKE_CONFIGURATION_TYPES@) set(LLVM_ENABLE_SHARED_LIBS @BUILD_SHARED_LIBS@)