Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/cmake/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
是否有在Windows下的CMake中设置相对RPATH的解决方法_Cmake_Cross Compiling_Rpath - Fatal编程技术网

是否有在Windows下的CMake中设置相对RPATH的解决方法

是否有在Windows下的CMake中设置相对RPATH的解决方法,cmake,cross-compiling,rpath,Cmake,Cross Compiling,Rpath,我想将CMake中的RPATH设置为$ORIGIN。我正在Windows计算机上交叉编译Linux系统。我需要将RPATH属性设置为$ORIGIN。为此,我使用以下代码 set_target_properties(LibraryName PROPERTIES INSTALL_RPATH "\$ORIGIN") 我得到的是\$ORIGIN 我还尝试了不同的方法来逃避美元标志 set_target_properties(LibraryName PROPERTIES INSTAL

我想将CMake中的RPATH设置为
$ORIGIN
。我正在Windows计算机上交叉编译Linux系统。我需要将RPATH属性设置为
$ORIGIN
。为此,我使用以下代码

set_target_properties(LibraryName PROPERTIES INSTALL_RPATH "\$ORIGIN")
我得到的是
\$ORIGIN

我还尝试了不同的方法来逃避美元标志

set_target_properties(LibraryName PROPERTIES INSTALL_RPATH "$ORIGIN") -> \$ORIGIN
set_target_properties(LibraryName PROPERTIES INSTALL_RPATH $ORIGIN) -> \$ORIGIN
set_target_properties(LibraryName PROPERTIES INSTALL_RPATH \$ORIGIN) -> \$ORIGIN
set_target_properties(LibraryName PROPERTIES INSTALL_RPATH "\\\$ORIGIN") -> \\\$ORIGIN
当我使用Linux机器交叉编译同一个项目时,它就不起作用了。意思是“\$ORIGIN”->
$ORIGIN
。 我已经在CMake问题跟踪程序中打开了一个,但我想这需要一些时间。是否有一种解决方法,可以在Windows中设置RPATH?也许是一些命令行工具或其他黑客?;-)

编辑

我尝试了更多的东西:

set_target_properties(LibraryName PROPERTIES INSTALL_RPATH [=[$ORIGIN]=]) => \$ORIGIN

set(ORIGIN_RPATH [=[$ORIGIN]=])
set_target_properties(FancyLibrary PROPERTIES INSTALL_RPATH ${ORIGIN_RPATH})  => \$ORIGIN

cmake_policy(SET CMP0095 OLD) + any of the mentioned variations => \$ORIGIN
当我查看build.make文件时,我发现转义的链接器选项
-Wl,-rpath,“\$$ORIGIN”

是否有一种方法至少可以在执行生成的build.make之前对其进行操作?

这是否与中描述的问题有关?听起来不错,但不幸的是,没有解决问题。我将策略设置为OLD,甚至使用了旧版本的CMAKE(3.14.7),但仍然得到了转义的\$ORIGIN