2016-01-26 23:01:49 -08:00
|
|
|
# Copyright (c) 2016 Andrew Kelley
|
2016-01-18 20:28:54 -08:00
|
|
|
# This file is MIT licensed.
|
|
|
|
# See http://opensource.org/licenses/MIT
|
|
|
|
|
|
|
|
# CLANG_FOUND
|
2016-01-26 23:01:49 -08:00
|
|
|
# CLANG_INCLUDE_DIRS
|
|
|
|
# CLANG_LIBRARIES
|
2016-01-18 20:28:54 -08:00
|
|
|
|
2016-02-16 18:42:46 -08:00
|
|
|
find_path(CLANG_INCLUDE_DIRS NAMES clang/Frontend/ASTUnit.h
|
|
|
|
PATHS
|
2017-03-29 22:18:12 -07:00
|
|
|
/usr/lib/llvm-4.0/include
|
2016-02-16 18:42:46 -08:00
|
|
|
/mingw64/include)
|
2016-01-18 20:28:54 -08:00
|
|
|
|
2017-03-13 08:54:56 -07:00
|
|
|
macro(FIND_AND_ADD_CLANG_LIB _libname_)
|
2016-01-26 23:01:49 -08:00
|
|
|
string(TOUPPER ${_libname_} _prettylibname_)
|
2016-02-16 18:42:46 -08:00
|
|
|
find_library(CLANG_${_prettylibname_}_LIB NAMES ${_libname_}
|
|
|
|
PATHS
|
2017-03-29 22:18:12 -07:00
|
|
|
/usr/lib/llvm-4.0/lib
|
2016-02-16 18:42:46 -08:00
|
|
|
/mingw64/lib)
|
2016-01-26 23:01:49 -08:00
|
|
|
if(CLANG_${_prettylibname_}_LIB)
|
|
|
|
set(CLANG_LIBRARIES ${CLANG_LIBRARIES} ${CLANG_${_prettylibname_}_LIB})
|
|
|
|
endif()
|
|
|
|
endmacro(FIND_AND_ADD_CLANG_LIB)
|
|
|
|
|
|
|
|
FIND_AND_ADD_CLANG_LIB(clangFrontend)
|
|
|
|
FIND_AND_ADD_CLANG_LIB(clangDriver)
|
|
|
|
FIND_AND_ADD_CLANG_LIB(clangSerialization)
|
|
|
|
FIND_AND_ADD_CLANG_LIB(clangSema)
|
|
|
|
FIND_AND_ADD_CLANG_LIB(clangAnalysis)
|
|
|
|
FIND_AND_ADD_CLANG_LIB(clangAST)
|
|
|
|
FIND_AND_ADD_CLANG_LIB(clangParse)
|
|
|
|
FIND_AND_ADD_CLANG_LIB(clangSema)
|
|
|
|
FIND_AND_ADD_CLANG_LIB(clangBasic)
|
|
|
|
FIND_AND_ADD_CLANG_LIB(clangEdit)
|
|
|
|
FIND_AND_ADD_CLANG_LIB(clangLex)
|
2016-01-18 20:28:54 -08:00
|
|
|
|
|
|
|
include(FindPackageHandleStandardArgs)
|
2016-01-26 23:01:49 -08:00
|
|
|
find_package_handle_standard_args(CLANG DEFAULT_MSG CLANG_LIBRARIES CLANG_INCLUDE_DIRS)
|
2016-01-18 20:28:54 -08:00
|
|
|
|
2016-01-26 23:01:49 -08:00
|
|
|
mark_as_advanced(CLANG_INCLUDE_DIRS CLANG_LIBRARIES)
|