# HG changeset patch # User Christian Kamm # Date 1246392470 -7200 # Node ID 1a93c3da09efaf6103269f732eccc1a20266bb23 # Parent 6182ceeb336a9dce567a2a6bd4e8c389852fd68d Yet another fix for finding llvm's config file. Since llvm-config --includedir sometimes includes the trailing llvm/ and sometimes it doesn't, we just check both directories. diff -r 6182ceeb336a -r 1a93c3da09ef CMakeLists.txt --- a/CMakeLists.txt Mon Jun 29 21:44:11 2009 +0200 +++ b/CMakeLists.txt Tue Jun 30 22:07:50 2009 +0200 @@ -143,7 +143,9 @@ # build a define that contains all LLVM targets required and is usable for # preprocessor code generation. start with the native target. -file(STRINGS ${LLVM_INCLUDEDIR}/llvm/Config/config.h LLVM_NATIVE_ARCH REGEX "^#define LLVM_NATIVE_ARCH") +find_path(LLVM_CONFIG_FILE_PATH config.h PATHS ${LLVM_INCLUDEDIR}/llvm/Config ${LLVM_INCLUDEDIR}/Config NO_DEFAULT_PATH) +message(${LLVM_CONFIG_FILE_PATH}/config.h) +file(STRINGS ${LLVM_CONFIG_FILE_PATH}/config.h LLVM_NATIVE_ARCH REGEX "^#define LLVM_NATIVE_ARCH") string(REGEX REPLACE "^#define LLVM_NATIVE_ARCH (.*)Target$" "\\1" LLVM_NATIVE_ARCH ${LLVM_NATIVE_ARCH}) set(LLVM_MODULES_DEFINE "LLVM_TARGET(${LLVM_NATIVE_ARCH})") # chain the extra target list to the define