[英]How can we pass a ${BASEWORK} directory from Bitbake recipe to CMAKE for using find library function from CMAKE?
I want to pass a variable BASEWORKDIR
yocto recipe variable to CMake so that it can search for library in a particular folder using find_library()
function for .so library. 我想将变量BASEWORKDIR
yocto配方变量传递给CMake,以便它可以使用.so库的find_library()
函数在特定文件夹中搜索库。 But it is not working. 但这是行不通的。 I printed it also Ie for debugging the Cmake file message(${BASEWORKDIR})
but this variable is empty. 我也打印了它,即用于调试Cmake文件message(${BASEWORKDIR})
但此变量为空。 This variable is defined in Bitbake.conf file in my yocto system. 这个变量在我的yocto系统的Bitbake.conf文件中定义。
You could try something like this to use the Yocto environment variables in CMake: 您可以尝试使用类似的方法在CMake中使用Yocto环境变量:
if(DEFINED ENV{BASEWORKDIR})
set(YOCTO_BASEWORK_DIR $ENV{BASEWORKDIR} CACHE INTERNAL "Path retrieved from environment variable.")
endif()
This creates a new CMake variable called YOCTO_BASEWORK_DIR
using the system environment variable BASEWORKDIR
. 这将使用系统环境变量BASEWORKDIR
创建一个名为YOCTO_BASEWORK_DIR
的新CMake变量。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.