gpt4 book ai didi

cmake - 对于 CMake 的 “install” , CONFIGURATIONS 参数有什么作用?

转载 作者:行者123 更新时间:2023-12-04 13:28:25 24 4
gpt4 key购买 nike

我不知道是什么CONFIGURATIONS CMake 的论据 install命令可以。当我使用 CONFIGURATIONS在安装文件时进行调试或发布,不会安装任何文件。发生了什么?

有人可以更详细地解释一下。如果你能给我一些例子,那将是最好的。

附言这与:For CMake's "install" command, what can the COMPONENT argument do? 不同

最佳答案

来自 docs :

The CONFIGURATIONS argument specifies a list of build configurations for which the install rule applies (Debug, Release, etc.).



例如,请考虑以下 CMakeListst.txt:
cmake_minimum_required(VERSION 2.8 FATAL_ERROR)
project(Test)
add_executable(MyTest main.cc)
install(TARGETS MyTest DESTINATION bin CONFIGURATIONS Release)

这意味着
cmake --build . --target install --config Release

将放置可执行文件 MyTest (或 MyTest.exe)在 ${CMAKE_INSTALL_PREFIX}/bin , 和
cmake --build . --target install --config Debug

不会安装任何东西。

关于cmake - 对于 CMake 的 “install” , CONFIGURATIONS 参数有什么作用?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11240827/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com