blob: 2f188f07127a33e91f589c03148a1b935a789fa8 [file] [log] [blame]
Patrick Williamsc124f4f2015-09-15 14:41:29 -05001require cmake.inc
2
3inherit cmake
4
5DEPENDS += "curl expat zlib libarchive xz ncurses bzip2"
6
7SRC_URI_append_class-nativesdk = " \
8 file://OEToolchainConfig.cmake \
9 file://environment.d-cmake.sh"
10
11# Strip ${prefix} from ${docdir}, set result into docdir_stripped
12python () {
13 prefix=d.getVar("prefix", True)
14 docdir=d.getVar("docdir", True)
15
16 if not docdir.startswith(prefix):
17 raise bb.build.FuncFailed('docdir must contain prefix as its prefix')
18
19 docdir_stripped = docdir[len(prefix):]
20 if len(docdir_stripped) > 0 and docdir_stripped[0] == '/':
21 docdir_stripped = docdir_stripped[1:]
22
23 d.setVar("docdir_stripped", docdir_stripped)
24}
25
26EXTRA_OECMAKE=" \
27 -DCMAKE_DOC_DIR=${docdir_stripped}/cmake-${CMAKE_MAJOR_VERSION} \
28 -DCMAKE_USE_SYSTEM_LIBRARY_BZIP2=1 \
29 -DCMAKE_USE_SYSTEM_LIBRARY_CURL=1 \
30 -DCMAKE_USE_SYSTEM_LIBRARY_EXPAT=1 \
31 -DCMAKE_USE_SYSTEM_LIBRARY_FORM=1 \
32 -DCMAKE_USE_SYSTEM_LIBRARY_LIBARCHIVE=1 \
33 -DCMAKE_USE_SYSTEM_LIBRARY_LIBLZMA=1 \
34 -DCMAKE_USE_SYSTEM_LIBRARY_ZLIB=1 \
35 -DKWSYS_CHAR_IS_SIGNED=1 \
36 -DBUILD_CursesDialog=0 \
37 ${@bb.utils.contains('DISTRO_FEATURES', 'largefile', '-DKWSYS_LFS_WORKS=1', '-DKWSYS_LFS_DISABLE=1', d)} \
38"
39
40do_install_append_class-nativesdk() {
41 mkdir -p ${D}${datadir}/cmake
42 install -m 644 ${WORKDIR}/OEToolchainConfig.cmake ${D}${datadir}/cmake/
43
44 mkdir -p ${D}${SDKPATHNATIVE}/environment-setup.d
45 install -m 644 ${WORKDIR}/environment.d-cmake.sh ${D}${SDKPATHNATIVE}/environment-setup.d/cmake.sh
46}
47
48FILES_${PN}_append_class-nativesdk = " ${SDKPATHNATIVE}"
49
50FILES_${PN} += "${datadir}/cmake-${CMAKE_MAJOR_VERSION}"
51FILES_${PN}-doc += "${docdir}/cmake-${CMAKE_MAJOR_VERSION}"
52
53BBCLASSEXTEND = "nativesdk"