Move version check of Clang to CMakeLists. webgl
authorBryan Dunsmore <dunsmoreb@gmail.com>
Fri, 30 Nov 2012 21:28:40 -0600
branchwebgl
changeset 8111 4307de8780fa
parent 8109 b5cd8cad2d86
child 8113 0ad9c42dca7c
child 8114 2816919ea74d
Move version check of Clang to CMakeLists.
CMakeLists.txt
cmake_modules/FindClang.cmake
--- a/CMakeLists.txt	Fri Nov 30 20:00:58 2012 -0600
+++ b/CMakeLists.txt	Fri Nov 30 21:28:40 2012 -0600
@@ -66,6 +66,18 @@
 set(CPACK_PACKAGE_VERSION_PATCH 19${version_suffix})
 set(HEDGEWARS_PROTO_VER 44)
 set(HEDGEWARS_VERSION "${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}")
+SET(REQUIRED_CLANG_VERSION 3.0)
+
+
+# Check LLVM/Clang version
+FIND_PACKAGE(Clang)
+
+IF (CLANG_VERSION VERSION_GREATER REQUIRED_CLANG_VERSION
+    OR CLANG_VERSION VERSION_EQUAL REQUIRED_CLANG_VERSION)
+    MESSAGE(STATUS "Found CLANG: ${CLANG_EXECUTABLE} (version ${CLANG_VERSION})")
+ELSE()
+    MESSAGE(FATAL_ERROR "Necessary LLVM/Clang version not found (version >= ${REQUIRED_CLANG_VERSION} required)")
+ENDIF()
 
 
 #bundle .app setup
--- a/cmake_modules/FindClang.cmake	Fri Nov 30 20:00:58 2012 -0600
+++ b/cmake_modules/FindClang.cmake	Fri Nov 30 21:28:40 2012 -0600
@@ -13,13 +13,6 @@
 
     STRING(REGEX MATCH "[0-9]+\\.[0-9]+" CLANG_VERSION_LONG "${CLANG_VERSION_FULL}")
     STRING(REGEX REPLACE "([0-9]+\\.[0-9]+)" "\\1" CLANG_VERSION "${CLANG_VERSION_LONG}")
-
-    # Required that LLVM/Clang version is >= 3.0
-    IF (CLANG_VERSION VERSION_GREATER 3.0 OR CLANG_VERSION VERSION_EQUAL 3.0)
-        MESSAGE(STATUS "Found CLANG: ${CLANG_EXECUTABLE} (version ${CLANG_VERSION})")
-    ELSE()
-        MESSAGE(FATAL_ERROR "Necessary LLVM/Clang version not found (version >= 3.0 required)")
-    ENDIF()
 ELSE()
     MESSAGE(FATAL_ERROR "No LLVM/Clang compiler found (required for engine_c target)")
 ENDIF()