apt-sim / AdePT

Accelerated demonstrator of electromagnetic Particle Transport
Apache License 2.0
25 stars 34 forks source link

Use `PROJECT_{SOURCE,BINARY}_DIR` in place of `CMAKE_` equivalent #269

Closed drbenmorgan closed 9 months ago

drbenmorgan commented 9 months ago

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.

phsft-bot commented 9 months ago

Can one of the admins verify this patch?