I’m trying to add fpm support for the HOHQMesh and FTObjectLibrary programs I reference in a previous thread. I have some fpm questions about how to set up and compile test and example programs that have local dependencies (ie module files) that are not included in the main /src directory. The current make and Cmake files for FTObjectLibrary build the main library from files in the /src directories. However, both the test and example code need to build extra modules that get linked into the test and example programs. Again, the source for these extra modules are not in the root /src directory and related subdirectories. So how do I get fpm to compile the extra modules.
Do I do something like (assuming the main test program is in Testing and the extra modules are in a subdirectory in Testing named Tests}
I’m trying to set up the fpm build so I make no changes to the existing directory structure or modify any existing code (don’t know if thats possible)
Under Linux (and I guess MacOSX) the path of least resistance would be to add a static link in the /src directory to the code in Testing/Tests but I’m not sure if fpm honors static links. I haven’t a clue as to how to do this under WIndows.
Another option would be to chain fpm calls (ie add an fpm.toml file to the Testing directory and a second fpm call just for the tests.
Also, It appears that the default compiler options for gfortran include turning off implicit typeing and implicit interfaces (is that true). I was able to get HOHQMesh to build with fpm but I had to add
Have not tried some of the available methods in a while that worked in earlier versions but you should just be able to put the files only needed for the testing in the Testing/ directory as one solution, or make a subdirectory info a separate project of it’s one and then specify it as a testing.dependency using the pathname as in
M_CLI2={path = "DEPS/M_CLI2" }
particularly if you reuse the “subproject” the path should be able to include relative pathnames so it can point to a directory “above” the project. For working offline I have a large directory called GLINKS that contains links to many fpm projects in the local filesystem and then I just link that GLINKS directory into a project and then have an fpm.toml file that uses the pathnames and another that uses the URLs for the remote projects that I have local clones of when online. Let me try those two and perhaps a few others but if you are not reusing it in other projects it should just suffice to put the files in or below the Testing/ directory and not treat them as a dependency at all, but just as files that are part of the testing. That used to work; but for quite a while I have been using my own testing framework so I have not tried that direct approach in quite a while.