From: Zhigang Gong Date: Wed, 19 Dec 2012 06:18:23 +0000 (+0800) Subject: Keep consistent naming rule for LLVM_XXX Cmake variables. X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=af5a1f00b47588a44f1d864d0b58458002b12e10;p=contrib%2Fbeignet.git Keep consistent naming rule for LLVM_XXX Cmake variables. Also fixed inconsistent indentation in FindLLVM.cmake and remove some unecessary blank lines. Based on patch from guanqun. Signed-off-by: Zhigang Gong --- diff --git a/CMake/FindLLVM.cmake b/CMake/FindLLVM.cmake index 351fd76..391e262 100644 --- a/CMake/FindLLVM.cmake +++ b/CMake/FindLLVM.cmake @@ -1,11 +1,11 @@ # Find the native LLVM includes and library # -# LLVM_INCLUDE_DIR - where to find llvm include files -# LLVM_LIBRARY_DIRS - where to find llvm libs -# LLVM_CFLAGS - llvm compiler flags -# LLVM_LFLAGS - llvm linker flags -# LLVM_MODULE_LIBS - list of llvm libs for working with modules. -# LLVM_FOUND - True if llvm found. +# LLVM_INCLUDE_DIR - where to find llvm include files +# LLVM_LIBRARY_DIR - where to find llvm libs +# LLVM_CFLAGS - llvm compiler flags +# LLVM_LFLAGS - llvm linker flags +# LLVM_MODULE_LIBS - list of llvm libs for working with modules. +# LLVM_FOUND - True if llvm found. find_program(LLVM_CONFIG_EXECUTABLE NAMES llvm-config llvm-config-32 llvm-config-3.0 DOC "llvm-config executable") if (LLVM_CONFIG_EXECUTABLE) @@ -16,21 +16,16 @@ endif (LLVM_CONFIG_EXECUTABLE) if (LLVM_FIND_VERSION_MAJOR AND LLVM_FIND_VERSION_MINOR) SET(LLVM_FIND_VERSION_NODOT "${LLVM_FIND_VERSION_MAJOR}${LLVM_FIND_VERSION_MINOR}") - execute_process( COMMAND ${LLVM_CONFIG_EXECUTABLE} --version OUTPUT_VARIABLE LLVM_VERSION ) - string(REGEX REPLACE "([0-9]*)\\.([0-9]*)[^0-9]*" "\\1\\2 " LLVM_VERSION_NODOT ${LLVM_VERSION}) if (LLVM_VERSION_NODOT VERSION_LESS LLVM_FIND_VERSION_NODOT) message(FATAL_ERROR "imcompatible LLVM version ${LLVM_VERSION_NODOT} required ${LLVM_FIND_VERSION}") endif (LLVM_VERSION_NODOT VERSION_LESS LLVM_FIND_VERSION_NODOT) - endif (LLVM_FIND_VERSION_MAJOR AND LLVM_FIND_VERSION_MINOR) - - execute_process( COMMAND ${LLVM_CONFIG_EXECUTABLE} --includedir OUTPUT_VARIABLE LLVM_INCLUDE_DIR @@ -39,7 +34,7 @@ execute_process( execute_process( COMMAND ${LLVM_CONFIG_EXECUTABLE} --libdir - OUTPUT_VARIABLE LLVM_LIBRARY_DIRS + OUTPUT_VARIABLE LLVM_LIBRARY_DIR OUTPUT_STRIP_TRAILING_WHITESPACE ) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index ee119c7..8626eab 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -29,7 +29,7 @@ set(OPENCL_SRC x11/dricommon.c x11/va_dri2.c) -link_directories (${LLVM_LIBRARY_DIRS}) +link_directories (${LLVM_LIBRARY_DIR}) add_library(cl SHARED ${OPENCL_SRC}) target_link_libraries( cl diff --git a/utests/CMakeLists.txt b/utests/CMakeLists.txt index 42b1855..0c136ee 100644 --- a/utests/CMakeLists.txt +++ b/utests/CMakeLists.txt @@ -1,7 +1,7 @@ INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/../include) -link_directories (${LLVM_LIBRARY_DIRS}) +link_directories (${LLVM_LIBRARY_DIR}) ADD_LIBRARY(utests SHARED utest_error.c compiler_shader_toy.cpp