remove CMAKE_TOOLCHAIN_FILE for cmake build
[scm/bb/meta-tizen.git] / recipes-tizen / libsf-common / libsf-common.inc
1 DESCRIPTION = "Sensor framework common library"
2 HOMEPAGE = "http://nohomepage.org"
3 SECTION = "System/Sensor Framework"
4 LICENSE = "Apache-2.0"
5
6 SRC_URI = ""
7
8 S = "${WORKDIR}/git"
9
10 inherit autotools-brokensep
11
12 PROVIDES = ""
13
14 #PROVIDES by libsf-common 
15
16
17 #PROVIDES by libsf-common-dev 
18
19
20 RDEPENDS = ""
21 #RDEPENDS of libsf-common-dev (${PN}-dev)
22 RDEPENDS_${PN}-dev += "libsf-common"
23
24
25 DEPENDS = ""
26 #DEPENDS of libsf-common 
27 DEPENDS_append_class-native = " cmake-native"
28 DEPENDS += "attr"
29 DEPENDS += "dlog"
30
31 do_prep() {
32  cd ${S}
33  chmod -Rf a+rX,u+w,g-w,o-w ${S}
34  #setup -q
35  cp ${S}/packaging/libsf-common.manifest .
36  
37  
38 }
39 do_patch_append() {
40     bb.build.exec_func('do_prep', d)
41 }
42
43 do_configure() {
44 }
45
46 do_compile() {
47  cd ${S}
48  LANG=C
49  export LANG
50  unset DISPLAY
51  CFLAGS="-O2 -g -m64 -fmessage-length=0 -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables" ; export CFLAGS ; 
52  CXXFLAGS="${CXXFLAGS:--O2 -g -m64 -fmessage-length=0 -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables}" ; export CXXFLAGS ; 
53  FFLAGS="${FFLAGS:--O2 -g -m64 -fmessage-length=0 -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables -I%_fmoddir}" ; export FFLAGS ; 
54  LD_AS_NEEDED=1; export LD_AS_NEEDED ; 
55  
56  
57    CFLAGS="${CFLAGS:--O2 -g -m64 -fmessage-length=0 -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables}" ; export CFLAGS ; 
58    CXXFLAGS="${CXXFLAGS:--O2 -g -m64 -fmessage-length=0 -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables}" ; export CXXFLAGS ; 
59    FFLAGS="${FFLAGS:--O2 -g -m64 -fmessage-length=0 -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables}" ; export FFLAGS ; 
60    cmake \
61          -DCMAKE_VERBOSE_MAKEFILE=ON \
62          -DCMAKE_INSTALL_PREFIX:PATH=${prefix} \
63          -DCMAKE_INSTALL_LIBDIR:PATH=${prefix}/lib \
64          -DINCLUDE_INSTALL_DIR:PATH=${prefix}/include \
65          -DLIB_INSTALL_DIR:PATH=${prefix}/lib \
66          -DSYSCONF_INSTALL_DIR:PATH=${sysconfdir} \
67          -DSHARE_INSTALL_PREFIX:PATH=${prefix}/share \
68          -DCMAKE_SKIP_RPATH:BOOL=ON \
69          -DBUILD_SHARED_LIBS:BOOL=ON .
70  
71  make -j16
72  
73  
74  
75 }
76
77 do_install() {
78  echo export RPM_BUILD_ROOT=${D}
79  cd ${S}
80  LANG=C
81  export LANG
82  unset DISPLAY
83  rm -rf ${D} 
84  mkdir -p ${D} 
85  
86  
87    oe_runmake \
88          DESTDIR=${D} \
89          INSTALL_ROOT=${D} \
90          BINDIR=${prefix}/bin \
91    install  
92    rm -f ${D}${infodir}/dir 
93    find ${D} -regex ".*\.la$" | xargs rm -f -- 
94    find ${D} -regex ".*\.a$" | xargs rm -f --
95  
96  mkdir -p ${D}${prefix}/share/license
97  cp LICENSE ${D}${prefix}/share/license/libsf-common
98  
99  
100 }
101
102
103 libsf-common_files = ""
104 libsf-common_files += "libsf-common.manifest"
105 libsf-common_files += "${prefix}/lib/libsf_common.so"
106 libsf-common_files += "${prefix}/share/license/libsf-common"
107
108 libsf-common-dev_files = ""
109 libsf-common-dev_files += "libsf-common.manifest"
110 libsf-common-dev_files += "${prefix}/include/sf_common/*.h"
111 libsf-common-dev_files += "${prefix}/lib/pkgconfig/sf_common.pc"
112
113 FILES_${PN} = "${libsf-common_files}"
114 FILES_${PN}-dev = "${libsf-common-dev_files}"
115
116 PKG_libsf-common= "libsf-common"
117 PKG_libsf-common-dev= "libsf-common-dev"
118
119 require libsf-common-extraconf.inc
120