what is the proper use of the CMake “project” directive

前端 未结 3 1441
悲哀的现实
悲哀的现实 2021-02-15 02:09

I have a large-ish codebase which builds several dozen libaries and several executables.

The codebase is broken down hierarchically and libraries are build at pretty muc

3条回答
  •  傲寒
    傲寒 (楼主)
    2021-02-15 02:30

    If the libraries are truly independent projects then it makes sense to use the project command. However if they are not I would instead just add them as subdirectories in your root CmakeLists.txt. You can use the variables CMAKE_CURRENT_SOURCE_DIR and CMAKE_CURRENT_BINARY_DIR if you need to know the directories that are currently being processed.

提交回复
热议问题