作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
如何仅使用 clion 构建静态库没有可执行文件?
CMakeLists.txt 是什么样的? (没有 add_executable
)
更新:如果我不向 Clion 添加可执行文件,我有一个
error ,需要一个可执行文件。
这是我的 CMakeLists.txt .
最佳答案
这是一个老问题。但是我会将您的问题的答案添加为对其他人的帮助。您需要更换您的 add_executable
与 add_library
add_library(target_name source_files)
关于cmake - CLion 和 CMake : only building a library without an executable?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29355937/
我是一名优秀的程序员,十分优秀!