Bluegill

  • 首页
  • 关于
  • 归档
  • 分类
  • 标签
  • 随笔
  • 发现
  • 搜索
  • 文章目录
  • 站点概览
🤖

🤖

个人博客,主要是零散的笔记。
433 日志
12 分类
86 标签
Github RSS 订阅
共享知识
友情链接
  • shuai.guru
0%

CMake execute_process

发表于: 2024-01-16
字数: 61 阅读:≈ 1分钟

和 add_custom_command / add_custom_target 不同,这个是在配置时就运行,但是一定要注意给对工作路径,否则运行结果出乎意料(或者以为没有运行)。

示例:

execute_process(COMMAND ./utils/pre-commit-cmake.sh
    WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
)
cmake

VS Code + CMake: Allow building in different directories per build type
pybind11 CMake 不能编译和运行
© 2023 - 2025 🤖
由 Hugo & Hugo NexT.Gemini 强力驱动