简体   繁体   English

在cmake中,cmake文件夹和CMakeLists.txt可以放在其他文件夹中吗?

[英]in cmake, can cmake folder and CMakeLists.txt sit in different folder?

in cmake, can cmake folder and CMakeLists.txt sit in different folder?\\ 在cmake中,cmake文件夹和CMakeLists.txt可以放在其他文件夹中吗?\\

usually, cmake folder and CmakeLists.txt are in same source root directory. 通常,cmake文件夹和CmakeLists.txt位于同一源根目录中。 But, to re-use cmake folder for different project, is that possible to put cmake folder into other places? 但是,要重新将cmake文件夹用于其他项目,是否可以将cmake文件夹放到其他地方?

Is this a good approach ans thinking? 这是一个很好的方法吗?

Thanks, 谢谢,

I don't see any problem with that. 我认为没有任何问题。 You just have to know the relative path from the ${CMAKE_SOURCE_DIR} or the absolute path in order to use it in your CMake files. 您只需要知道$ {CMAKE_SOURCE_DIR}的相对路径或绝对路径,即可在CMake文件中使用它。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM