如何从cmake文件(GLOB ...)模式排除单个文件 [英] how do i exclude a single file form a cmake file(GLOB ... ) pattern

查看:5033
本文介绍了如何从cmake文件(GLOB ...)模式排除单个文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的CmakeLists.txt包含这一行:

my CmakeLists.txt contains this line:

文件(GLOB lib_srcs Half / half.cpp Iex / *。cpp IlmThread / *。 cpp>

file(GLOB lib_srcs Half/half.cpp Iex/*.cpp IlmThread/*.cpp Imath/*.cpp IlmImf/*.cpp)

IlmImf 文件夹包含 b44ExpLogTable.cpp ,我需要从构建中排除。

and the IlmImf folder contains b44ExpLogTable.cpp, which i need to exclude from the build.

如何实现? p>

how to achieve that ?

推荐答案

可以使用 list 函数来操作列表,例如:

You can use the list function to manipulate the list, for example:

list(REMOVE_ITEM <list> <value> [<value> ...])

在这种情况下,也许这样的工作方式:

In your case, maybe something like this will work:

list(REMOVE_ITEM lib_srcs "IlmImf/b44ExpLogTable.cpp")

这篇关于如何从cmake文件(GLOB ...)模式排除单个文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆