Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 1 | require cmake.inc |
| 2 | |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 3 | inherit cmake bash-completion |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 4 | |
| 5 | DEPENDS += "curl expat zlib libarchive xz ncurses bzip2" |
| 6 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 7 | SRC_URI:append:class-nativesdk = " \ |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 8 | file://OEToolchainConfig.cmake \ |
| 9 | file://environment.d-cmake.sh \ |
| 10 | file://0001-CMakeDetermineSystem-use-oe-environment-vars-to-load.patch \ |
| 11 | " |
| 12 | |
| 13 | # Strip ${prefix} from ${docdir}, set result into docdir_stripped |
| 14 | python () { |
| 15 | prefix=d.getVar("prefix") |
| 16 | docdir=d.getVar("docdir") |
| 17 | |
| 18 | if not docdir.startswith(prefix): |
| 19 | bb.fatal('docdir must contain prefix as its prefix') |
| 20 | |
| 21 | docdir_stripped = docdir[len(prefix):] |
| 22 | if len(docdir_stripped) > 0 and docdir_stripped[0] == '/': |
| 23 | docdir_stripped = docdir_stripped[1:] |
| 24 | |
| 25 | d.setVar("docdir_stripped", docdir_stripped) |
| 26 | } |
| 27 | |
| 28 | EXTRA_OECMAKE=" \ |
| 29 | -DCMAKE_DOC_DIR=${docdir_stripped}/cmake-${CMAKE_MAJOR_VERSION} \ |
| 30 | -DCMAKE_USE_SYSTEM_LIBRARIES=1 \ |
| 31 | -DCMAKE_USE_SYSTEM_LIBRARY_JSONCPP=0 \ |
| 32 | -DCMAKE_USE_SYSTEM_LIBRARY_LIBUV=0 \ |
| 33 | -DCMAKE_USE_SYSTEM_LIBRARY_LIBRHASH=0 \ |
| 34 | -DKWSYS_CHAR_IS_SIGNED=1 \ |
| 35 | -DBUILD_CursesDialog=0 \ |
| 36 | -DKWSYS_LFS_WORKS=1 \ |
| 37 | " |
| 38 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 39 | do_install:append:class-nativesdk() { |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 40 | mkdir -p ${D}${datadir}/cmake |
| 41 | install -m 644 ${WORKDIR}/OEToolchainConfig.cmake ${D}${datadir}/cmake/ |
| 42 | |
| 43 | mkdir -p ${D}${SDKPATHNATIVE}/environment-setup.d |
| 44 | install -m 644 ${WORKDIR}/environment.d-cmake.sh ${D}${SDKPATHNATIVE}/environment-setup.d/cmake.sh |
| 45 | } |
| 46 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 47 | FILES:${PN}:append:class-nativesdk = " ${SDKPATHNATIVE}" |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 48 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 49 | FILES:${PN} += "${datadir}/cmake-${CMAKE_MAJOR_VERSION} ${datadir}/cmake ${datadir}/aclocal ${datadir}/emacs ${datadir}/vim" |
| 50 | FILES:${PN}-doc += "${docdir}/cmake-${CMAKE_MAJOR_VERSION}" |
| 51 | FILES:${PN}-dev = "" |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 52 | |
| 53 | BBCLASSEXTEND = "nativesdk" |