CMake: was defaulting to an old LLVM version
authorCampbell Barton <ideasman42@gmail.com>
Thu, 5 Mar 2015 04:33:57 +0000 (15:33 +1100)
committerCampbell Barton <ideasman42@gmail.com>
Thu, 5 Mar 2015 04:42:01 +0000 (15:42 +1100)
Made finding LLVM fail.

only use LLVM_VERSION if set, else set to installed version

CMakeLists.txt

index 0809a2f1ba914a0aba2d822c8cb014d8e7d67574..6a7e39cadf65d72101831a9e226f26ba4baef100 100644 (file)
@@ -1033,18 +1033,18 @@ if(UNIX AND NOT APPLE)
 
        # XXX Maybe most of this section should go into an llvm module?
        if(WITH_LLVM)
-               # Set llvm version if not specified
-               if(NOT LLVM_VERSION)
-                       set(LLVM_VERSION "3.0")
-               endif()
 
                if(LLVM_DIRECTORY)
-                       find_program(LLVM_CONFIG llvm-config-${LLVM_VERSION} HINTS ${LLVM_DIRECTORY}/bin NO_CMAKE_PATH)
+                       if(NOT DEFINED LLVM_VERSION)
+                               find_program(LLVM_CONFIG llvm-config-${LLVM_VERSION} HINTS ${LLVM_DIRECTORY}/bin NO_CMAKE_PATH)
+                       endif()
                        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 DEFINED LLVM_VERSION)
+                               find_program(LLVM_CONFIG llvm-config-${LLVM_VERSION})
+                       endif()
                        if(NOT LLVM_CONFIG)
                                find_program(LLVM_CONFIG llvm-config)
                        endif()