Permalink
Browse files

Incredibly inelegant search through the cellar for libclang.

  • Loading branch information...
Andersbakken committed Sep 8, 2017
1 parent 14d6292 commit 2af4d6a32e8194f8fbcc23fd94395e3d595a3c25
Showing with 26 additions and 6 deletions.
  1. +26 −6 cmake/FindLibClang.cmake
View
@@ -45,13 +45,33 @@ endif ()
if (NOT LIBCLANG_LLVM_CONFIG_EXECUTABLE)
set(LIBCLANG_LLVM_CONFIG_EXECUTABLE $ENV{LIBCLANG_LLVM_CONFIG_EXECUTABLE})
if (NOT LIBCLANG_LLVM_CONFIG_EXECUTABLE)
set(llvm_config_names llvm-config)
foreach(major RANGE 9 3)
foreach(minor RANGE 9 0)
list(APPEND llvm_config_names "llvm-config${major}${minor}" "llvm-config-${major}.${minor}" "llvm-config-mp-${major}.${minor}")
if (APPLE)
foreach(major RANGE 9 3)
foreach(minor RANGE 9 0)
foreach(patch RANGE 9 0)
# message(STATUS "trying llvm-config llvm-config${major}${minor} in /usr/local/Cellar/llvm/${major}.${minor}.${patch}/bin")
find_program(LIBCLANG_LLVM_CONFIG_EXECUTABLE NAMES llvm-config llvm-config${major}${minor} PATHS /usr/local/Cellar/llvm/${major}.${minor}.${patch}/bin)
if (LIBCLANG_LLVM_CONFIG_EXECUTABLE)
break()
endif ()
endforeach ()
if (LIBCLANG_LLVM_CONFIG_EXECUTABLE)
break()
endif ()
endforeach ()
if (LIBCLANG_LLVM_CONFIG_EXECUTABLE)
break()
endif ()
endforeach ()
endforeach ()
find_program(LIBCLANG_LLVM_CONFIG_EXECUTABLE NAMES ${llvm_config_names})
else ()
set(llvm_config_names llvm-config)
foreach(major RANGE 9 3)
foreach(minor RANGE 9 0)
list(APPEND llvm_config_names "llvm-config${major}${minor}" "llvm-config-${major}.${minor}" "llvm-config-mp-${major}.${minor}")
endforeach ()
endforeach ()
find_program(LIBCLANG_LLVM_CONFIG_EXECUTABLE NAMES ${llvm_config_names})
endif ()
endif ()
if (LIBCLANG_LLVM_CONFIG_EXECUTABLE)
message(STATUS "llvm-config executable found: ${LIBCLANG_LLVM_CONFIG_EXECUTABLE}")

0 comments on commit 2af4d6a

Please sign in to comment.