Update drivers
[vuplus_openembedded] / classes / cmake.bbclass
1 DEPENDS += " cmake-native "
2
3 # We want the staging and installing functions from autotools
4 inherit autotools_stage
5
6 # Use in-tree builds by default but allow this to be changed
7 # since some packages do not support them (e.g. llvm 2.5).
8 OECMAKE_SOURCEPATH ?= "."
9
10 # If declaring this, make sure you also set EXTRA_OEMAKE to
11 # "-C ${OECMAKE_BUILDPATH}". So it will run the right makefiles.
12 OECMAKE_BUILDPATH ?= ""
13
14 cmake_do_configure() {
15   if [ ${OECMAKE_BUILDPATH} ]
16   then
17     mkdir ${OECMAKE_BUILDPATH}
18     cd ${OECMAKE_BUILDPATH}
19   fi
20
21   cmake ${OECMAKE_SOURCEPATH} \
22     -DCMAKE_INSTALL_PREFIX:PATH=${prefix} \
23     -DCMAKE_FIND_ROOT_PATH:PATH=${STAGING_DIR_HOST} \
24     ${EXTRA_OECMAKE} \
25     -Wno-dev
26 }
27
28 cmake_do_compile()  {
29   if [ ${OECMAKE_BUILDPATH} ]
30   then
31      cd ${OECMAKE_BUILDPATH}
32   fi
33   
34   base_do_compile
35 }
36
37 cmake_do_install() {
38   if [ ${OECMAKE_BUILDPATH} ];
39   then
40      cd ${OECMAKE_BUILDPATH}
41   fi
42   
43   autotools_do_install
44 }
45
46 EXPORT_FUNCTIONS do_configure do_compile do_install