blob: bb7ed83e308bf9e73507347066fb33249c4c8b52 [file] [log] [blame]
Brad Bishop1a4b7ee2018-12-16 17:11:34 -08001require cmake.inc
2
Andrew Geisslerc9f78652020-09-18 14:11:35 -05003inherit cmake bash-completion
Brad Bishop1a4b7ee2018-12-16 17:11:34 -08004
5DEPENDS += "curl expat zlib libarchive xz ncurses bzip2"
6
Patrick Williams213cb262021-08-07 19:21:33 -05007SRC_URI:append:class-nativesdk = " \
Brad Bishop1a4b7ee2018-12-16 17:11:34 -08008 file://OEToolchainConfig.cmake \
Patrick Williams45852732022-04-02 08:58:32 -05009 file://SDKToolchainConfig.cmake.template \
10 file://cmake-setup.py \
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080011 file://environment.d-cmake.sh \
12 file://0001-CMakeDetermineSystem-use-oe-environment-vars-to-load.patch \
13"
14
Patrick Williams03907ee2022-05-01 06:28:52 -050015LICENSE:append = " & BSD-1-Clause & MIT"
16LIC_FILES_CHKSUM:append = " \
17 file://Utilities/cmjsoncpp/LICENSE;md5=5d73c165a0f9e86a1342f32d19ec5926 \
18 file://Utilities/cmlibrhash/COPYING;md5=a8c2a557a5c53b1c12cddbee98c099af \
19 file://Utilities/cmlibuv/LICENSE;md5=ad93ca1fffe931537fcf64f6fcce084d \
20"
21
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080022# Strip ${prefix} from ${docdir}, set result into docdir_stripped
23python () {
24 prefix=d.getVar("prefix")
25 docdir=d.getVar("docdir")
26
27 if not docdir.startswith(prefix):
28 bb.fatal('docdir must contain prefix as its prefix')
29
30 docdir_stripped = docdir[len(prefix):]
31 if len(docdir_stripped) > 0 and docdir_stripped[0] == '/':
32 docdir_stripped = docdir_stripped[1:]
33
34 d.setVar("docdir_stripped", docdir_stripped)
35}
36
37EXTRA_OECMAKE=" \
38 -DCMAKE_DOC_DIR=${docdir_stripped}/cmake-${CMAKE_MAJOR_VERSION} \
39 -DCMAKE_USE_SYSTEM_LIBRARIES=1 \
40 -DCMAKE_USE_SYSTEM_LIBRARY_JSONCPP=0 \
41 -DCMAKE_USE_SYSTEM_LIBRARY_LIBUV=0 \
42 -DCMAKE_USE_SYSTEM_LIBRARY_LIBRHASH=0 \
43 -DKWSYS_CHAR_IS_SIGNED=1 \
44 -DBUILD_CursesDialog=0 \
45 -DKWSYS_LFS_WORKS=1 \
46"
47
Patrick Williams213cb262021-08-07 19:21:33 -050048do_install:append:class-nativesdk() {
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080049 mkdir -p ${D}${datadir}/cmake
50 install -m 644 ${WORKDIR}/OEToolchainConfig.cmake ${D}${datadir}/cmake/
51
52 mkdir -p ${D}${SDKPATHNATIVE}/environment-setup.d
53 install -m 644 ${WORKDIR}/environment.d-cmake.sh ${D}${SDKPATHNATIVE}/environment-setup.d/cmake.sh
Patrick Williams45852732022-04-02 08:58:32 -050054
55 # install cmake-setup.py to create arch-specific toolchain cmake file from template
56 install -m 0644 ${WORKDIR}/SDKToolchainConfig.cmake.template ${D}${datadir}/cmake/
57 install -d ${D}${SDKPATHNATIVE}/post-relocate-setup.d
58 install -m 0755 ${WORKDIR}/cmake-setup.py ${D}${SDKPATHNATIVE}/post-relocate-setup.d/
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080059}
60
Patrick Williams213cb262021-08-07 19:21:33 -050061FILES:${PN}:append:class-nativesdk = " ${SDKPATHNATIVE}"
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080062
Patrick Williams213cb262021-08-07 19:21:33 -050063FILES:${PN} += "${datadir}/cmake-${CMAKE_MAJOR_VERSION} ${datadir}/cmake ${datadir}/aclocal ${datadir}/emacs ${datadir}/vim"
64FILES:${PN}-doc += "${docdir}/cmake-${CMAKE_MAJOR_VERSION}"
65FILES:${PN}-dev = ""
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080066
67BBCLASSEXTEND = "nativesdk"