e68a78bd4d81ad39cb44a178f06456d0b382b239
[pti/rtp.git] / meta-stx / recipes-devtools / libcomps / libcomps_git.bbappend
1 #
2 # Copyright (C) 2019 Wind River Systems, Inc.
3 #
4 #  Licensed under the Apache License, Version 2.0 (the "License");
5 #  you may not use this file except in compliance with the License.
6 #  You may obtain a copy of the License at
7 #
8 #      http://www.apache.org/licenses/LICENSE-2.0
9 #
10 #  Unless required by applicable law or agreed to in writing, software
11 #  distributed under the License is distributed on an "AS IS" BASIS,
12 #  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 #  See the License for the specific language governing permissions and
14 #  limitations under the License.
15
16 DEPENDS += "\
17     python-native \
18     "
19
20 EXTRA_OECMAKE_PY2 = " \
21     -DPYTHON_DESIRED=2 \
22     -DPYTHON_INSTALL_DIR=${libdir}/python2.7/site-packages \
23     -DPYTHON_EXECUTABLE=${STAGING_BINDIR_NATIVE}/python-native/python \
24     "
25
26 do_configure_append() {
27         rm -rf ${B}/build-py2
28         mkdir -p ${B}/build-py2
29         cd ${B}/build-py2
30
31         cmake \
32           ${OECMAKE_GENERATOR_ARGS} \
33           $oecmake_sitefile \
34           ${OECMAKE_SOURCEPATH} \
35           -DCMAKE_INSTALL_PREFIX:PATH=${prefix} \
36           -DCMAKE_INSTALL_SO_NO_EXE=0 \
37           -DCMAKE_TOOLCHAIN_FILE=${WORKDIR}/toolchain.cmake \
38           -DCMAKE_NO_SYSTEM_FROM_IMPORTED=1 \
39           ${EXTRA_OECMAKE_PY2} \
40           -Wno-dev
41 }
42
43 cmake_runcmake_build_py2() {
44         bbnote ${DESTDIR:+DESTDIR=${DESTDIR} }VERBOSE=1 cmake --build '${B}/build-py2' "$@" -- ${EXTRA_OECMAKE_BUILD}
45         eval ${DESTDIR:+DESTDIR=${DESTDIR} }VERBOSE=1 cmake --build '${B}/build-py2' "$@" -- ${EXTRA_OECMAKE_BUILD}
46 }
47
48 do_compile_append() {
49         cd ${B}/build-py2
50         cmake_runcmake_build_py2 --target ${OECMAKE_TARGET_COMPILE}
51 }
52
53 do_install_append() {
54         cd ${B}/build-py2
55         DESTDIR='${D}' cmake_runcmake_build_py2 --target ${OECMAKE_TARGET_INSTALL}
56 }
57