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

前端 未结 3 731
有刺的猬
有刺的猬 2021-02-15 01:55

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:25

    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.

提交回复
热议问题