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 \ |
Patrick Williams | 4585273 | 2022-04-02 08:58:32 -0500 | [diff] [blame] | 9 | file://SDKToolchainConfig.cmake.template \ |
| 10 | file://cmake-setup.py \ |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 11 | file://environment.d-cmake.sh \ |
| 12 | file://0001-CMakeDetermineSystem-use-oe-environment-vars-to-load.patch \ |
| 13 | " |
| 14 | |
Patrick Williams | 03907ee | 2022-05-01 06:28:52 -0500 | [diff] [blame] | 15 | LICENSE:append = " & BSD-1-Clause & MIT" |
| 16 | LIC_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 Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 22 | # Strip ${prefix} from ${docdir}, set result into docdir_stripped |
| 23 | python () { |
| 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 | |
| 37 | EXTRA_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 Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 48 | do_install:append:class-nativesdk() { |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 49 | 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 Williams | 4585273 | 2022-04-02 08:58:32 -0500 | [diff] [blame] | 54 | |
| 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 Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 59 | } |
| 60 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 61 | FILES:${PN}:append:class-nativesdk = " ${SDKPATHNATIVE}" |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 62 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 63 | FILES:${PN} += "${datadir}/cmake-${CMAKE_MAJOR_VERSION} ${datadir}/cmake ${datadir}/aclocal ${datadir}/emacs ${datadir}/vim" |
| 64 | FILES:${PN}-doc += "${docdir}/cmake-${CMAKE_MAJOR_VERSION}" |
| 65 | FILES:${PN}-dev = "" |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 66 | |
| 67 | BBCLASSEXTEND = "nativesdk" |