CMake找不到Perl

时间:2019-04-04 16:17:52

标签: cmake yocto bitbake

我正在尝试使用自己的Yocto Linux主板配方制作mbedcrypto。我可以下载和解压缩源代码,但是在编译库的过程中,我得到了错误

| -- Detecting C compiler ABI info
| -- Detecting C compiler ABI info - done
| -- Detecting C compile features
| -- Detecting C compile features - done
| -- Could NOT find PythonInterp (missing:  PYTHON_EXECUTABLE)
| -- Could NOT find Perl (missing:  PERL_EXECUTABLE)

相关的CMakeLists.txt部分如下


set(CTR_DRBG_128_BIT_KEY_WARNING "${WARNING_BORDER}"
                         "${CTR_DRBG_128_BIT_KEY_WARN_L1}"
                         "${CTR_DRBG_128_BIT_KEY_WARN_L2}"
                         "${CTR_DRBG_128_BIT_KEY_WARN_L3}"
                         "${WARNING_BORDER}")


find_package(PythonInterp)
find_package(Perl)
if(PERL_FOUND)

    # If 128-bit keys are configured for CTR_DRBG, display an appropriate warning
    execute_process(COMMAND ${PERL_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/scripts/config.pl -f ${CMAKE_CURRENT_SOURCE_DIR}/include/mbedtls/config.h get MBEDTLS_CTR_DRBG_USE_128_BIT_KEY

错误消息

 Found Threads: TRUE
| -- Could NOT find Perl (missing:  PERL_EXECUTABLE)
| CMake Error at tests/CMakeLists.txt:15 (message):
|   Cannot build test suites without Perl

来自文件tests / CMakeLists.txt,具有

if(ENABLE_ZLIB_SUPPORT)
    set(libs ${libs} ${ZLIB_LIBRARIES})
endif(ENABLE_ZLIB_SUPPORT)

find_package(Perl)
if(NOT PERL_FOUND)
    message(FATAL_ERROR "Cannot build test suites without Perl")
endif()

我已经在我的主机的/ usr / bin / perl上安装并运行了perl。我不知道这是cmake配置还是yocto问题。

mbedcrypto食谱

DESCRIPTION = "Simple helloworld application"
SECTION = "examples"
DEPENDS = ""
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://LICENSE;md5=302d50a6369f5f22efdb674db908167a"
SRC_URI[md5sum] = "06dd48905c236f7939d03b09bcf7f1a2"


SRC_URI = "https://github.com/ARMmbed/mbed-crypto/archive/mbedcrypto-${PV}.tar.gz"

S = "${WORKDIR}/mbed-crypto-mbedcrypto-${PV}"

inherit cmake pkgconfig

1 个答案:

答案 0 :(得分:0)

您的食谱缺少Perl和Python的 build-time 依赖性。这些依赖项由DEPENDS variable指定。

如果您需要Perl的本机变体来构建测试,请指定(编辑:根据评论,它没有帮助):

DEPENDS = "perl-native"

您也可以使用perlnative class (see doc for the difference)

inherit perlnative

顺便说一句,还有 runtime 依赖项(请参阅RDEPENDS variable)