Have CMake recursively scan folders?

后端 未结 1 1348
醉酒成梦
醉酒成梦 2020-12-08 04:30

How do I set up CMake to recursively scan a given directory and determine the list of source files?

My project is a shared library. I have a folder structure similar

相关标签:
1条回答
  • 2020-12-08 04:37

    CMake provides the following command for recursive files globing:

    file(GLOB_RECURSE variable [RELATIVE path] 
       [FOLLOW_SYMLINKS] [globbing expressions]...)
    

    Command documentation: http://www.cmake.org/cmake/help/v2.8.8/cmake.html#command:file

    0 讨论(0)
提交回复
热议问题