diff --git a/clang/CMakeLists.txt b/clang/CMakeLists.txt --- a/clang/CMakeLists.txt +++ b/clang/CMakeLists.txt @@ -50,9 +50,9 @@ list(GET CONFIG_OUTPUT 5 MAIN_SRC_DIR) list(GET CONFIG_OUTPUT 6 LLVM_CONFIG_CMAKE_PATH) - # Normalize LLVM_CMAKE_PATH. --cmakedir might contain backslashes. + # Normalize LLVM_CMAKE_DIR. --cmakedir might contain backslashes. # CMake assumes slashes as PATH. - file(TO_CMAKE_PATH ${LLVM_CONFIG_CMAKE_PATH} LLVM_CMAKE_PATH) + file(TO_CMAKE_PATH ${LLVM_CONFIG_CMAKE_PATH} LLVM_CMAKE_DIR) endif() @@ -63,7 +63,7 @@ mark_as_advanced(LLVM_ENABLE_ASSERTIONS) endif() - find_package(LLVM REQUIRED HINTS "${LLVM_CMAKE_PATH}") + find_package(LLVM REQUIRED HINTS "${LLVM_CMAKE_DIR}") list(APPEND CMAKE_MODULE_PATH ${LLVM_DIR}) # We can't check LLVM_CONFIG here, because find_package(LLVM ...) also sets @@ -75,11 +75,6 @@ set(LIBRARY_DIR ${LLVM_LIBRARY_DIR}) set(INCLUDE_DIR ${LLVM_INCLUDE_DIR}) set(LLVM_OBJ_DIR ${LLVM_BINARY_DIR}) - # The LLVM_CMAKE_PATH variable is set when doing non-standalone builds and - # used in this project, so we need to make sure we set this value. - # FIXME: LLVM_CMAKE_DIR comes from LLVMConfig.cmake. We should rename - # LLVM_CMAKE_PATH to LLVM_CMAKE_DIR throughout the project. - set(LLVM_CMAKE_PATH ${LLVM_CMAKE_DIR}) endif() set(LLVM_TOOLS_BINARY_DIR ${TOOLS_BINARY_DIR} CACHE PATH "Path to llvm/bin") diff --git a/clang/lib/Basic/CMakeLists.txt b/clang/lib/Basic/CMakeLists.txt --- a/clang/lib/Basic/CMakeLists.txt +++ b/clang/lib/Basic/CMakeLists.txt @@ -8,7 +8,7 @@ # The VC revision include that we want to generate. set(version_inc "${CMAKE_CURRENT_BINARY_DIR}/VCSVersion.inc") -set(generate_vcs_version_script "${LLVM_CMAKE_PATH}/GenerateVersionFromVCS.cmake") +set(generate_vcs_version_script "${LLVM_CMAKE_DIR}/GenerateVersionFromVCS.cmake") if(llvm_vc AND LLVM_APPEND_VC_REV) set(llvm_source_dir ${LLVM_MAIN_SRC_DIR}) diff --git a/compiler-rt/cmake/Modules/CompilerRTMockLLVMCMakeConfig.cmake b/compiler-rt/cmake/Modules/CompilerRTMockLLVMCMakeConfig.cmake --- a/compiler-rt/cmake/Modules/CompilerRTMockLLVMCMakeConfig.cmake +++ b/compiler-rt/cmake/Modules/CompilerRTMockLLVMCMakeConfig.cmake @@ -13,13 +13,13 @@ endmacro() macro(compiler_rt_mock_llvm_cmake_config_set_cmake_path) - # Point `LLVM_CMAKE_PATH` at the source tree in the monorepo. - set(LLVM_CMAKE_PATH "${LLVM_MAIN_SRC_DIR}/cmake/modules") - if (NOT EXISTS "${LLVM_CMAKE_PATH}") - message(FATAL_ERROR "LLVM_CMAKE_PATH (${LLVM_CMAKE_PATH}) does not exist") + # Point `LLVM_CMAKE_DIR` at the source tree in the monorepo. + set(LLVM_CMAKE_DIR "${LLVM_MAIN_SRC_DIR}/cmake/modules") + if (NOT EXISTS "${LLVM_CMAKE_DIR}") + message(FATAL_ERROR "LLVM_CMAKE_DIR (${LLVM_CMAKE_DIR}) does not exist") endif() - list(APPEND CMAKE_MODULE_PATH "${LLVM_CMAKE_PATH}") - message(STATUS "LLVM_CMAKE_PATH: \"${LLVM_CMAKE_PATH}\"") + list(APPEND CMAKE_MODULE_PATH "${LLVM_CMAKE_DIR}") + message(STATUS "LLVM_CMAKE_DIR: \"${LLVM_CMAKE_DIR}\"") endmacro() function(compiler_rt_mock_llvm_cmake_config_set_target_triple) @@ -71,5 +71,5 @@ macro(compiler_rt_mock_llvm_cmake_config_include_cmake_files) # Some compiler-rt CMake code needs to call code in this file. - include("${LLVM_CMAKE_PATH}/AddLLVM.cmake") + include("${LLVM_CMAKE_DIR}/AddLLVM.cmake") endmacro() diff --git a/compiler-rt/cmake/Modules/CompilerRTUtils.cmake b/compiler-rt/cmake/Modules/CompilerRTUtils.cmake --- a/compiler-rt/cmake/Modules/CompilerRTUtils.cmake +++ b/compiler-rt/cmake/Modules/CompilerRTUtils.cmake @@ -373,15 +373,15 @@ OUTPUT_VARIABLE CONFIG_OUTPUT) if(NOT HAD_ERROR) string(STRIP "${CONFIG_OUTPUT}" LLVM_CMAKE_PATH_FROM_LLVM_CONFIG) - file(TO_CMAKE_PATH ${LLVM_CMAKE_PATH_FROM_LLVM_CONFIG} LLVM_CMAKE_PATH) + file(TO_CMAKE_PATH ${LLVM_CMAKE_PATH_FROM_LLVM_CONFIG} LLVM_CMAKE_DIR) else() file(TO_CMAKE_PATH ${LLVM_BINARY_DIR} LLVM_BINARY_DIR_CMAKE_STYLE) - set(LLVM_CMAKE_PATH "${LLVM_BINARY_DIR_CMAKE_STYLE}/lib${LLVM_LIBDIR_SUFFIX}/cmake/llvm") + set(LLVM_CMAKE_DIR "${LLVM_BINARY_DIR_CMAKE_STYLE}/lib${LLVM_LIBDIR_SUFFIX}/cmake/llvm") endif() - set(LLVM_CMAKE_INCLUDE_FILE "${LLVM_CMAKE_PATH}/LLVMConfig.cmake") + set(LLVM_CMAKE_INCLUDE_FILE "${LLVM_CMAKE_DIR}/LLVMConfig.cmake") if (EXISTS "${LLVM_CMAKE_INCLUDE_FILE}") - list(APPEND CMAKE_MODULE_PATH "${LLVM_CMAKE_PATH}") + list(APPEND CMAKE_MODULE_PATH "${LLVM_CMAKE_DIR}") # Get some LLVM variables from LLVMConfig. include("${LLVM_CMAKE_INCLUDE_FILE}") set(FOUND_LLVM_CMAKE_PATH TRUE) diff --git a/flang/CMakeLists.txt b/flang/CMakeLists.txt --- a/flang/CMakeLists.txt +++ b/flang/CMakeLists.txt @@ -35,7 +35,7 @@ endif() # We need a pre-built/installed version of LLVM. - find_package(LLVM REQUIRED HINTS "${LLVM_CMAKE_PATH}") + find_package(LLVM REQUIRED HINTS "${LLVM_CMAKE_DIR}") # If the user specifies a relative path to LLVM_DIR, the calls to include # LLVM modules fail. Append the absolute path to LLVM_DIR instead. get_filename_component(LLVM_DIR_ABSOLUTE ${LLVM_DIR} REALPATH) diff --git a/libcxx/cmake/Modules/HandleOutOfTreeLLVM.cmake b/libcxx/cmake/Modules/HandleOutOfTreeLLVM.cmake --- a/libcxx/cmake/Modules/HandleOutOfTreeLLVM.cmake +++ b/libcxx/cmake/Modules/HandleOutOfTreeLLVM.cmake @@ -13,14 +13,14 @@ set(LLVM_INCLUDE_DIR ${LLVM_PATH}/include CACHE PATH "Path to llvm/include") set(LLVM_PATH ${LLVM_PATH} CACHE PATH "Path to LLVM source tree") set(LLVM_MAIN_SRC_DIR ${LLVM_PATH}) -set(LLVM_CMAKE_PATH "${LLVM_PATH}/cmake/modules") +set(LLVM_CMAKE_DIR "${LLVM_PATH}/cmake/modules") -if (EXISTS "${LLVM_CMAKE_PATH}") - list(APPEND CMAKE_MODULE_PATH "${LLVM_CMAKE_PATH}") +if (EXISTS "${LLVM_CMAKE_DIR}") + list(APPEND CMAKE_MODULE_PATH "${LLVM_CMAKE_DIR}") elseif (EXISTS "${LLVM_MAIN_SRC_DIR}/cmake/modules") list(APPEND CMAKE_MODULE_PATH "${LLVM_MAIN_SRC_DIR}/cmake/modules") else() - message(FATAL_ERROR "Neither ${LLVM_CMAKE_PATH} nor ${LLVM_MAIN_SRC_DIR}/cmake/modules found. " + message(FATAL_ERROR "Neither ${LLVM_CMAKE_DIR} nor ${LLVM_MAIN_SRC_DIR}/cmake/modules found. " "This is not a supported configuration.") endif() diff --git a/libunwind/CMakeLists.txt b/libunwind/CMakeLists.txt --- a/libunwind/CMakeLists.txt +++ b/libunwind/CMakeLists.txt @@ -342,6 +342,6 @@ add_subdirectory(docs) endif() -if (LIBUNWIND_INCLUDE_TESTS AND EXISTS ${LLVM_CMAKE_PATH}) +if (LIBUNWIND_INCLUDE_TESTS AND EXISTS ${LLVM_CMAKE_DIR}) add_subdirectory(test) endif() diff --git a/lld/CMakeLists.txt b/lld/CMakeLists.txt --- a/lld/CMakeLists.txt +++ b/lld/CMakeLists.txt @@ -27,7 +27,7 @@ list(GET LLVM_CONFIG_OUTPUT 0 OBJ_ROOT) list(GET LLVM_CONFIG_OUTPUT 1 MAIN_INCLUDE_DIR) - list(GET LLVM_CONFIG_OUTPUT 2 LLVM_CMAKE_PATH) + list(GET LLVM_CONFIG_OUTPUT 2 LLVM_CMAKE_DIR) list(GET LLVM_CONFIG_OUTPUT 3 MAIN_SRC_DIR) set(LLVM_OBJ_ROOT ${OBJ_ROOT} CACHE PATH "path to LLVM build tree") @@ -35,14 +35,14 @@ set(LLVM_MAIN_SRC_DIR ${MAIN_SRC_DIR} CACHE PATH "Path to LLVM source tree") file(TO_CMAKE_PATH ${LLVM_OBJ_ROOT} LLVM_BINARY_DIR) - file(TO_CMAKE_PATH ${LLVM_CMAKE_PATH} LLVM_CMAKE_PATH) + file(TO_CMAKE_PATH ${LLVM_CMAKE_DIR} LLVM_CMAKE_DIR) - if(NOT EXISTS "${LLVM_CMAKE_PATH}/LLVMConfig.cmake") + if(NOT EXISTS "${LLVM_CMAKE_DIR}/LLVMConfig.cmake") message(FATAL_ERROR "LLVMConfig.cmake not found") endif() - include("${LLVM_CMAKE_PATH}/LLVMConfig.cmake") + include("${LLVM_CMAKE_DIR}/LLVMConfig.cmake") - list(APPEND CMAKE_MODULE_PATH "${LLVM_CMAKE_PATH}") + list(APPEND CMAKE_MODULE_PATH "${LLVM_CMAKE_DIR}") set(PACKAGE_VERSION "${LLVM_PACKAGE_VERSION}") include_directories("${LLVM_BINARY_DIR}/include" ${LLVM_INCLUDE_DIRS}) diff --git a/lld/Common/CMakeLists.txt b/lld/Common/CMakeLists.txt --- a/lld/Common/CMakeLists.txt +++ b/lld/Common/CMakeLists.txt @@ -8,7 +8,7 @@ find_first_existing_vc_file("${LLD_SOURCE_DIR}" lld_vc) set(version_inc "${CMAKE_CURRENT_BINARY_DIR}/VCSVersion.inc") -set(generate_vcs_version_script "${LLVM_CMAKE_PATH}/GenerateVersionFromVCS.cmake") +set(generate_vcs_version_script "${LLVM_CMAKE_DIR}/GenerateVersionFromVCS.cmake") if(lld_vc AND LLVM_APPEND_VC_REV) set(lld_source_dir ${LLD_SOURCE_DIR}) diff --git a/lldb/cmake/modules/LLDBStandalone.cmake b/lldb/cmake/modules/LLDBStandalone.cmake --- a/lldb/cmake/modules/LLDBStandalone.cmake +++ b/lldb/cmake/modules/LLDBStandalone.cmake @@ -3,8 +3,8 @@ find_package(LLVM REQUIRED CONFIG HINTS ${LLVM_DIR} NO_CMAKE_FIND_ROOT_PATH) find_package(Clang REQUIRED CONFIG HINTS ${Clang_DIR} ${LLVM_DIR}/../clang NO_CMAKE_FIND_ROOT_PATH) -# We set LLVM_CMAKE_PATH so that GetSVN.cmake is found correctly when building SVNVersion.inc -set(LLVM_CMAKE_PATH ${LLVM_CMAKE_DIR} CACHE PATH "Path to LLVM CMake modules") +# We set LLVM_CMAKE_DIR so that GetSVN.cmake is found correctly when building SVNVersion.inc +set(LLVM_CMAKE_DIR ${LLVM_CMAKE_DIR} CACHE PATH "Path to LLVM CMake modules") set(LLVM_MAIN_SRC_DIR ${LLVM_BUILD_MAIN_SRC_DIR} CACHE PATH "Path to LLVM source tree") set(LLVM_MAIN_INCLUDE_DIR ${LLVM_MAIN_INCLUDE_DIR} CACHE PATH "Path to llvm/include") diff --git a/lldb/source/CMakeLists.txt b/lldb/source/CMakeLists.txt --- a/lldb/source/CMakeLists.txt +++ b/lldb/source/CMakeLists.txt @@ -8,7 +8,7 @@ find_first_existing_vc_file("${LLDB_SOURCE_DIR}" lldb_vc) set(version_inc "${CMAKE_CURRENT_BINARY_DIR}/VCSVersion.inc") -set(generate_vcs_version_script "${LLVM_CMAKE_PATH}/GenerateVersionFromVCS.cmake") +set(generate_vcs_version_script "${LLVM_CMAKE_DIR}/GenerateVersionFromVCS.cmake") if(lldb_vc AND LLVM_APPEND_VC_REV) set(lldb_source_dir ${LLDB_SOURCE_DIR}) diff --git a/llvm/CMakeLists.txt b/llvm/CMakeLists.txt --- a/llvm/CMakeLists.txt +++ b/llvm/CMakeLists.txt @@ -295,8 +295,8 @@ set(LLVM_MAIN_INCLUDE_DIR ${LLVM_MAIN_SRC_DIR}/include ) # --includedir set(LLVM_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR} ) # --prefix -# Note: LLVM_CMAKE_PATH does not include generated files -set(LLVM_CMAKE_PATH ${LLVM_MAIN_SRC_DIR}/cmake/modules) +# Note: LLVM_CMAKE_DIR does not include generated files +set(LLVM_CMAKE_DIR ${LLVM_MAIN_SRC_DIR}/cmake/modules) set(LLVM_EXAMPLES_BINARY_DIR ${LLVM_BINARY_DIR}/examples) set(LLVM_INCLUDE_DIR ${CMAKE_CURRENT_BINARY_DIR}/include) diff --git a/llvm/include/llvm/Support/CMakeLists.txt b/llvm/include/llvm/Support/CMakeLists.txt --- a/llvm/include/llvm/Support/CMakeLists.txt +++ b/llvm/include/llvm/Support/CMakeLists.txt @@ -3,7 +3,7 @@ # The VC revision include that we want to generate. set(version_inc "${CMAKE_CURRENT_BINARY_DIR}/VCSRevision.h") -set(generate_vcs_version_script "${LLVM_CMAKE_PATH}/GenerateVersionFromVCS.cmake") +set(generate_vcs_version_script "${LLVM_CMAKE_DIR}/GenerateVersionFromVCS.cmake") if(LLVM_APPEND_VC_REV) set(llvm_source_dir ${LLVM_MAIN_SRC_DIR}) diff --git a/runtimes/CMakeLists.txt b/runtimes/CMakeLists.txt --- a/runtimes/CMakeLists.txt +++ b/runtimes/CMakeLists.txt @@ -65,7 +65,7 @@ # This variable makes sure that e.g. llvm-lit is found. set(LLVM_MAIN_SRC_DIR ${LLVM_BUILD_MAIN_SRC_DIR}) -set(LLVM_CMAKE_PATH ${LLVM_MAIN_SRC_DIR}/cmake/modules) +set(LLVM_CMAKE_DIR ${LLVM_MAIN_SRC_DIR}/cmake/modules) # This variable is used by individual runtimes to locate LLVM files. set(LLVM_PATH ${LLVM_BUILD_MAIN_SRC_DIR})