lanl / ports-of-call

Performance Portability Utilities
https://lanl.github.io/ports-of-call/
BSD 3-Clause "New" or "Revised" License
2 stars 1 forks source link

cmake config guard for submodule mode #9

Closed mauneyc-LANL closed 2 years ago

mauneyc-LANL commented 2 years ago

PR Summary

If used as in-tree as a submodule downstream, cmake will include() a file generated by export(), which generates an error (see https://cmake.org/cmake/help/v3.17/policy/CMP0024.html). This includes a guard against invoking the include() in the scenario when ports-of-call is not the main project.

This fixes an issue encountered when singularity-eos cmake configuration was re-run after the initial cmake generate step. In this case, importing spiner submodule would use the prior export()-ed ports-of-callConfig.cmake that was present in the build directory. Due to CMP0024 (above), this would produce an error, and the build directory would need to be cleaned to produce a usable configuration.

PR Checklist

Yurlungur commented 2 years ago

@mauneyc-LANL let me know when all tests pass and I will merge. Can't run tests myself at the moment.

mauneyc-LANL commented 2 years ago

@mauneyc-LANL let me know when all tests pass and I will merge. Can't run tests myself at the moment.

I'm not seeing any tests for this code.

Yurlungur commented 2 years ago

I thought there was an install test. Well no big deal either way.

Yurlungur commented 2 years ago

The install test passed. Merging.

mauneyc-LANL commented 2 years ago

Sorry, I just grep'd the CMake for "test", didn't see the directory

Yurlungur commented 2 years ago

No problem.