When included as a subproject as add_subdirectory or similar, the CMAKE_{SOURCE,BINARY}_DIR variables will point to those of the highest level project. This will not be the same as the root of the AdePT source code. Include/etc paths will not then be correct, leading to compile time errors. Additionally, generated files may appear in the wrong place, or clash with higher level projects. This may be one of the methods experiments use to integrate the code, so good to support it, and will also help co-working with Celeritas.
Use PROJECT_{SOURCE,BINARY}_DIR in place of the CMAKE_ versions to guarantee pointing to the AdePT root source/build directories.
When included as a subproject as
add_subdirectory
or similar, theCMAKE_{SOURCE,BINARY}_DIR
variables will point to those of the highest level project. This will not be the same as the root of the AdePT source code. Include/etc paths will not then be correct, leading to compile time errors. Additionally, generated files may appear in the wrong place, or clash with higher level projects. This may be one of the methods experiments use to integrate the code, so good to support it, and will also help co-working with Celeritas.Use
PROJECT_{SOURCE,BINARY}_DIR
in place of theCMAKE_
versions to guarantee pointing to the AdePT root source/build directories.