Search code examples
c++cbuildcmakebuild-process

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


in cmake, can cmake folder and CMakeLists.txt sit in different folder?\

usually, cmake folder and CmakeLists.txt are in same source root directory. But, to re-use cmake folder for different project, is that possible to put cmake folder into other places?

Is this a good approach ans thinking?

Thanks,


Solution

  • 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.