2017-12-23 7 views
0

Homebrew (MacOS High Sierra 10.13.3)에서 제공하는 LLVM 5.0.0을 사용하려고합니다. 내가 매개 변수없이 CMake를 실행하면brew에서 LLVM 5.0.0을 사용할 때 Cmake 오류가 발생했습니다.

# Find the LLVM library 
find_package(LLVM 5.0.0 REQUIRED) 
include_directories("${LLVM_INCLUDE_DIRS}") 
link_directories(${LLVM_LIBRARY_DIRS}) 
message(STATUS "LLVM include dirs: ${LLVM_INCLUDE_DIRS}") 

, 내가 얻을 :

CMake Error at CMakeLists.txt:74 (find_package): By not providing "FindLLVM.cmake" in CMAKE_MODULE_PATH this project has asked CMake to find a package configuration file provided by "LLVM", but CMake did not find one.

Could not find a package configuration file provided by "LLVM" (requested version 5.0.0) with any of the following names:

LLVMConfig.cmake 
llvm-config.cmake 

Add the installation prefix of "LLVM" to CMAKE_PREFIX_PATH or set "LLVM_DIR" to a directory containing one of the above files. If "LLVM" provides a separate development package or SDK, be sure it has been installed.

LLVM 내 프로젝트에, 내가 CMakeLists.txt에 다음과 같은 라인을 가지고,

이제 /usr/local/Cellar/llvm/5.0.0/에서 내 컴퓨터에 설치되어있는

그것은 LLVM을 찾을 수 없다는 것을 알려줍니다. 그래서 다음과 같이 LLVM_DIR 경로를 전달합니다.

cmake .. -DLLVM_DIR=/usr/local/Cellar/llvm/5.0.0/share/cmake/modules/ 

나는 모든 것이 작동 할 것으로 기대합니다. 버전이 share/cmake/modules 디렉토리에 아무 곳이나 존재하지 않는 몇 가지 이유를 들어

CMake Error at CMakeLists.txt:74 (find_package): Could not find a configuration file for package "LLVM" that is compatible with requested version "5.0.0".

The following configuration files were considered but not accepted:

/usr/local/Cellar/llvm/5.0.0/share/cmake/modules/llvm-config.cmake, version: unknown

대신 나는 다음과 같은 오류가 발생합니다.

양조가 설치된 LLVM을 변경하지 않고 어떻게이 문제를 해결할 수 있습니까?

+0

LLVM의 버전 번호를 제거하십시오. 'find_package (LLVM 필수)' – vre

+0

여전히 작동하지 않습니다. 양조장 설치에 ​​잘못된 버전이 있습니다. –

답변

0

답을 찾았습니다. 잘못된 경로를 LLVM_DIR에 전달하고있었습니다. 난 그냥 (안 share에, lib에 묻혀) 다른 디렉토리를 사용해야합니다 :

cmake .. -DLLVM_DIR=/usr/local/Cellar/llvm/5.0.0/lib/cmake/llvm/ 

양조는 LLVM에 대한 CMake 헬퍼의 2 개 버전, share에서 하나 lib에 하나를 설치하기로 결정 이유를 확실하지.

관련 문제