blob: 7d81edc6041a0bb6fa4204c37795bd675ac9cc49 [file] [log] [blame]
Brad Bishopd7bf8c12018-02-25 22:55:05 -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")
14 docdir=d.getVar("docdir")
15
16 if not docdir.startswith(prefix):
17 bb.fatal('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_LIBRARIES=1 \
29 -DCMAKE_USE_SYSTEM_LIBRARY_JSONCPP=0 \
30 -DCMAKE_USE_SYSTEM_LIBRARY_LIBUV=0 \
31 -DCMAKE_USE_SYSTEM_LIBRARY_LIBRHASH=0 \
32 -DKWSYS_CHAR_IS_SIGNED=1 \
33 -DBUILD_CursesDialog=0 \
34 -DKWSYS_LFS_WORKS=1 \
35"
36
37do_install_append_class-nativesdk() {
38 mkdir -p ${D}${datadir}/cmake
39 install -m 644 ${WORKDIR}/OEToolchainConfig.cmake ${D}${datadir}/cmake/
40
41 mkdir -p ${D}${SDKPATHNATIVE}/environment-setup.d
42 install -m 644 ${WORKDIR}/environment.d-cmake.sh ${D}${SDKPATHNATIVE}/environment-setup.d/cmake.sh
43}
44
45FILES_${PN}_append_class-nativesdk = " ${SDKPATHNATIVE}"
46
Brad Bishop6ef32652018-10-09 18:59:25 +010047FILES_${PN} += "${datadir}/cmake-${CMAKE_MAJOR_VERSION} ${datadir}/cmake ${datadir}/aclocal"
Brad Bishopd7bf8c12018-02-25 22:55:05 -050048FILES_${PN}-doc += "${docdir}/cmake-${CMAKE_MAJOR_VERSION}"
Brad Bishop6ef32652018-10-09 18:59:25 +010049FILES_${PN}-dev = ""
Brad Bishopd7bf8c12018-02-25 22:55:05 -050050
51BBCLASSEXTEND = "nativesdk"