summaryrefslogtreecommitdiff
path: root/CMake
diff options
context:
space:
mode:
authorZhigang Gong <zhigang.gong@linux.intel.com>2012-12-18 16:45:36 +0800
committerZhigang Gong <zhigang.gong@linux.intel.com>2013-04-10 14:51:29 +0800
commite2f07c15572653e7b403aed4ae5ba8daa617fc21 (patch)
tree8e95865a8641cfd4f939858dcf7ae3c702d6baa0 /CMake
parent8e8d5157cb587d7b4e12a00a65e5c3196679f638 (diff)
Refine CMake to check llvm version.
This branch need llvm 3.3 or newer version. We need to modify the cmake to check the version. This commit also fixed some minor bugs in the find_packages, and removed those useless files. Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>
Diffstat (limited to 'CMake')
-rw-r--r--CMake/FindCPP.cmake25
-rw-r--r--CMake/FindDRMIntel.cmake8
-rw-r--r--CMake/FindFlex.cmake27
-rw-r--r--CMake/FindLLVM.cmake20
-rw-r--r--CMake/FindXLib.cmake34
-rw-r--r--CMake/FindXext.cmake7
-rw-r--r--CMake/FindXfixes.cmake7
7 files changed, 40 insertions, 88 deletions
diff --git a/CMake/FindCPP.cmake b/CMake/FindCPP.cmake
deleted file mode 100644
index be05064e..00000000
--- a/CMake/FindCPP.cmake
+++ /dev/null
@@ -1,25 +0,0 @@
-#
-# Try to find c preprocessor
-# Once done this will define
-#
-# CPP_FOUND
-# CPP_PATH
-#
-
-FIND_PROGRAM(CPP_PATH cpp
- /bin/
- /usr/bin/
- /usr/local/bin
- ~/bin
- /opt/local/bin/
- DOC "The directory where cpp is")
-
-IF(CPP_PATH)
- SET(CPP_FOUND 1 CACHE STRING "Set to 1 if CPP is found, 0 otherwise")
-ELSE(CPP_PATH)
- SET(CPP_FOUND 0 CACHE STRING "Set to 1 if CPP is found, 0 otherwise")
-ENDIF(CPP_PATH)
-
-MARK_AS_ADVANCED(CPP_FOUND)
-
-
diff --git a/CMake/FindDRMIntel.cmake b/CMake/FindDRMIntel.cmake
index 05778824..2ab9c1fd 100644
--- a/CMake/FindDRMIntel.cmake
+++ b/CMake/FindDRMIntel.cmake
@@ -6,6 +6,14 @@
# DRM_INTEL_INCLUDE_PATH
#
+FIND_PATH(DRM_INTEL_INCLUDE_PATH intel_bufmgr.h
+ ~/include/libdrm/
+ /usr/include/libdrm/
+ /usr/local/include/libdrm/
+ /sw/include/libdrm/
+ /opt/local/include/libdrm/
+ DOC "The directory where intel_bufmgr.h resides")
+
FIND_LIBRARY(DRM_INTEL_LIBRARY
NAMES DRM_INTEL drm_intel
PATHS
diff --git a/CMake/FindFlex.cmake b/CMake/FindFlex.cmake
deleted file mode 100644
index f7972ebe..00000000
--- a/CMake/FindFlex.cmake
+++ /dev/null
@@ -1,27 +0,0 @@
-#
-# Try to find X library and include path.
-# Once done this will define
-#
-# FLEX_FOUND
-# FLEX_LIBRARY
-#
-
-FIND_LIBRARY(FLEX_LIBRARY
- NAMES FLEX fl
- PATHS
- /usr/lib64
- /usr/lib
- /usr/local/lib64
- /usr/local/lib
- /sw/lib
- /opt/local/lib
- DOC "The FLEX library")
-
-IF(FLEX_INCLUDE_PATH)
- SET(FLEX_FOUND 1 CACHE STRING "Set to 1 if FLEX is found, 0 otherwise")
-ELSE(FLEX_INCLUDE_PATH)
- SET(FLEX_FOUND 0 CACHE STRING "Set to 1 if FLEX is found, 0 otherwise")
-ENDIF(FLEX_INCLUDE_PATH)
-
-MARK_AS_ADVANCED(FLEX_FOUND)
-
diff --git a/CMake/FindLLVM.cmake b/CMake/FindLLVM.cmake
index 4fa10a53..f5a74b48 100644
--- a/CMake/FindLLVM.cmake
+++ b/CMake/FindLLVM.cmake
@@ -6,8 +6,7 @@
# 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 DOC "llvm-config executable")
+find_program(LLVM_CONFIG_EXECUTABLE NAMES llvm-config llvm-config-32 llvm-config-3.0 DOC "llvm-config executable")
if (LLVM_CONFIG_EXECUTABLE)
message(STATUS "LLVM llvm-config found at: ${LLVM_CONFIG_EXECUTABLE}")
@@ -15,6 +14,23 @@ else (LLVM_CONFIG_EXECUTABLE)
message(FATAL_ERROR "Could NOT find LLVM executable")
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
diff --git a/CMake/FindXLib.cmake b/CMake/FindXLib.cmake
deleted file mode 100644
index 5047a0f3..00000000
--- a/CMake/FindXLib.cmake
+++ /dev/null
@@ -1,34 +0,0 @@
-#
-# Try to find X library and include path.
-# Once done this will define
-#
-# XLIB_FOUND
-# XLIB_INCLUDE_PATH
-# XLIB_LIBRARY
-#
-
-FIND_PATH(XLIB_INCLUDE_PATH X11/Xlib.h
- /usr/include
- /usr/local/include
- /sw/include
- /opt/local/include
- DOC "The directory where X11/Xlib.h resides")
-FIND_LIBRARY(XLIB_LIBRARY
- NAMES XLIB X11
- PATHS
- /usr/lib64
- /usr/lib
- /usr/local/lib64
- /usr/local/lib
- /sw/lib
- /opt/local/lib
- DOC "The XLIB library")
-
-IF(XLIB_INCLUDE_PATH)
- SET(XLIB_FOUND 1 CACHE STRING "Set to 1 if XLIB is found, 0 otherwise")
-ELSE(XLIB_INCLUDE_PATH)
- SET(XLIB_FOUND 0 CACHE STRING "Set to 1 if XLIB is found, 0 otherwise")
-ENDIF(XLIB_INCLUDE_PATH)
-
-MARK_AS_ADVANCED(XLIB_FOUND)
-
diff --git a/CMake/FindXext.cmake b/CMake/FindXext.cmake
index 3f913706..3025da8f 100644
--- a/CMake/FindXext.cmake
+++ b/CMake/FindXext.cmake
@@ -6,6 +6,13 @@
# XEXT_LIBRARY
#
+FIND_PATH(XEXT_INCLUDE_PATH X11/extensions/Xext.h
+ /usr/include
+ /usr/local/include
+ /sw/include
+ /opt/local/include
+ DOC "The directory where Xext.h resides")
+
FIND_LIBRARY(XEXT_LIBRARY
NAMES XEXT Xext
PATHS
diff --git a/CMake/FindXfixes.cmake b/CMake/FindXfixes.cmake
index 8bce1d60..182e479f 100644
--- a/CMake/FindXfixes.cmake
+++ b/CMake/FindXfixes.cmake
@@ -6,6 +6,13 @@
# XFIXES_LIBRARY
#
+FIND_PATH(XFIXES_INCLUDE_PATH X11/extensions/Xfixes.h
+ /usr/include
+ /usr/local/include
+ /sw/include
+ /opt/local/include
+ DOC "The directory where Xfixes.h resides")
+
FIND_LIBRARY(XFIXES_LIBRARY
NAMES XFIXES Xfixes
PATHS