gpt4 book ai didi

cmake - CLion 和 CMake : only building a library without an executable?

转载 作者:行者123 更新时间:2023-12-03 23:31:59 24 4
gpt4 key购买 nike

如何仅使用 clion 构建静态库没有可执行文件?
CMakeLists.txt 是什么样的? (没有 add_executable)

更新:如果我不向 Clion 添加可执行文件,我有一个
error ,需要一个可执行文件。

这是我的 CMakeLists.txt .

最佳答案

这是一个老问题。但是我会将您的问题的答案添加为对其他人的帮助。您需要更换您的 add_executableadd_library

add_library(target_name source_files)

关于cmake - CLion 和 CMake : only building a library without an executable?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29355937/

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