More LLVM work (now always search llvm-config into LLVM_DIRECTORY when
authorBastien Montagne <montagne29@wanadoo.fr>
Wed, 21 Nov 2012 08:59:20 +0000 (08:59 +0000)
committerBastien Montagne <montagne29@wanadoo.fr>
Wed, 21 Nov 2012 08:59:20 +0000 (08:59 +0000)
set!).

CMakeLists.txt

index cc45000..3ca01a8 100644 (file)
@@ -716,9 +716,16 @@ if(UNIX AND NOT APPLE)
                        set(LLVM_VERSION "3.0")
                endif()
                set(LLVM_STATIC YES)
-               FIND_PROGRAM(LLVM_CONFIG llvm-config-${LLVM_VERSION} HINTS ${LLVM_DIRECTORY} ${LLVM_DIRECTORY}/bin)
-               if(NOT LLVM_CONFIG)
-                       FIND_PROGRAM(LLVM_CONFIG llvm-config HINTS ${LLVM_DIRECTORY} ${LLVM_DIRECTORY}/bin)
+               if(LLVM_DIRECTORY)
+                       FIND_PROGRAM(LLVM_CONFIG llvm-config-${LLVM_VERSION} HINTS ${LLVM_DIRECTORY}/bin NO_CMAKE_PATH)
+                       if(NOT LLVM_CONFIG)
+                               FIND_PROGRAM(LLVM_CONFIG llvm-config HINTS ${LLVM_DIRECTORY}/bin NO_CMAKE_PATH)
+                       endif()
+               else()
+                       FIND_PROGRAM(LLVM_CONFIG llvm-config-${LLVM_VERSION})
+                       if(NOT LLVM_CONFIG)
+                               FIND_PROGRAM(LLVM_CONFIG llvm-config)
+                       endif()
                endif()
                execute_process(COMMAND ${LLVM_CONFIG} --version
                                OUTPUT_VARIABLE LLVM_VERSION