PROJECT_SOURCE_DIR

From Get docs
Cmake/docs/3.21/variable/project source dir


PROJECT_SOURCE_DIR

This is the source directory of the last call to the project() command made in the current directory scope or one of its parents. Note, it is not affected by calls to project() made within a child directory scope (i.e. from within a call to add_subdirectory() from the current scope).

© 2000–2021 Kitware, Inc. and Contributors
Licensed under the BSD 3-clause License.
https://cmake.org/cmake/help/v3.21/variable/PROJECT_SOURCE_DIR.html