CMake可以识别其他名称(CMakeLists_nightly.txt)的CMakeLists.txt吗? [英] Can CMake recognize CMakeLists.txt with another name (CMakeLists_nightly.txt)?
问题描述
我想创建更具体命名的CMakeLists.txt文件,例如 CMakeLists_nightly.txt, CMakeLists_weekly.txt等等。我要这样做的原因是为了减少项目的文件夹层次结构混乱。我可以使用上面显示的后缀轻松地将每个文件放在各自的文件夹中,但我不想这样做。
I am wanting to create CMakeLists.txt files that are more specifically named such as "CMakeLists_nightly.txt", "CMakeLists_weekly.txt" and so forth. The reason I want to do this is to cut down on the folder hierarchy clutter of my project. I could easily put each of these files in their own folder with the postfix I showed above but I do not want to do this.
我可以告诉cmake接受CMakeLists吗? .txt文件的其他名称?我曾经在另一个论坛(http://www.cmake.org/pipermail/cmake/2007-August/016036.html)上看到过这个问题,但它早在2007年,答案是否定的。当前版本的CMake是否提供此功能?
Can I tell cmake to take a CMakeLists.txt file by another name? I have seen this question asked before on another forum (http://www.cmake.org/pipermail/cmake/2007-August/016036.html) but it was back in 2007 and the answer was no. Does the current version of CMake provide this capability?
推荐答案
不是真的,但是您可以通过放置 CMakeLists.txt
在单独的目录中,例如 continuous / CMakeLists.txt
和 nightly / CMakeLists.txt
。使用 INCLUDE
为每个构建配置包括适当的脚本。
Not really, but you can emulate this by putting CMakeLists.txt
in separate directories, e.g. continous/CMakeLists.txt
and nightly/CMakeLists.txt
. Use INCLUDE
to include the appropriate scripts for each of the build configs.
考虑这是否是正确的方法-将夜间脚本和连续脚本完全分开是一个非常糟糕的主意,因为这将导致重复和非常容易出错的构建设置。
Consider if this really is the right approach - completely separating the nightly and continuous script is a really bad idea as that will lead to duplication and a very bug prone build setup.
这篇关于CMake可以识别其他名称(CMakeLists_nightly.txt)的CMakeLists.txt吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!