Goddard-Fortran-Ecosystem / pFUnit

Parallel Fortran Unit Testing Framework
Other
171 stars 45 forks source link

CMake Feature Request: Recompile *_driver.F90 when new TEST_SOURCES added #380

Open jphill4 opened 1 year ago

jphill4 commented 1 year ago

Another observation from my test suite migration: When a new .pf file is added to TEST_SOURCES for add_pfunit_ctest, the file gets processed and the *.inc file gets updated, but a re-compilation of the test program is not triggered. It would be nice for this re-build to happen automatically. One of these approaches should work:

https://cmake.org/cmake/help/latest/command/add_dependencies.html https://stackoverflow.com/questions/40914497/why-doesnt-cmake-detect-dependency-on-my-generated-file

jphill4 commented 1 year ago

(And thank you for making this resource available. I started with FRUIT because it was easy to start with, but moving to pFUnit has been great. Much simpler code).

tclune commented 1 year ago

Yeah - I've been annoyed by this for a long time, but do not actually know how to cleanly fix this. It probably is not hard, but it's not quite canonical CMake. My usual solution is to just do make clean in the offending directory. Rebuilds are faster than finding a solution. :-)

I'm happy to accept a patch for this, but realistically, I'm not likely to dig into this until some major revamp of the preprocessing facility.

jphill4 commented 1 year ago

Yep, fair enough. I will try to take a look at this once I get past the FY transition. I did something similar to what PF unit is doing for another project (compiling generated files), so I have an idea of what to do here.