Closed merkys closed 1 year ago
Hi,
Thanks for the suggestion. I think "conditionally including" expansions may indeed be convenient. I am not sure it will work with only few easy modifications, but the only way to know is to try.
So far "expansion_js" and "expansion_gl" are treated as separate applications that use the core Voronota code and resources, hence the separate CMakeLists.txt files and separate compilation. If I understood correctly, you proposal will eliminate the need to do additional cmake runs for every expansion, but still leave the possibility to compile every expansion separately? If, so this is a very good non-intrusive modification. If you have time to do it, I would be grateful.
Thanks for the suggestion. I think "conditionally including" expansions may indeed be convenient. I am not sure it will work with only few easy modifications, but the only way to know is to try.
From what I have seen, conditional include in CMakeLists.txt
should be as simple as:
if(EXPANSION_GL)
add_subdirectory(expansion_gl)
endif(EXPANSION_GL)
I have not tried that out yet, but will try.
So far "expansion_js" and "expansion_gl" are treated as separate applications that use the core Voronota code and resources, hence the separate CMakeLists.txt files and separate compilation. If I understood correctly, you proposal will eliminate the need to do additional cmake runs for every expansion, but still leave the possibility to compile every expansion separately? If, so this is a very good non-intrusive modification. If you have time to do it, I would be grateful.
Yes, the possibility to compile separately would remain as before, but people willing to compile/install everything at once would be given such possibility.
I have tested the described method and it seems to work as expected, without affecting the original intention to have separate CMake files. I have opened pull request #4.
Current layout of
CMakeLists.txt
files (one in base directory and one in each of extensions) is convenient, but cannot be easily handled by Debian build tools. Thus to build for Debian I have to modify the mainCMakeLists.txt
:Many CMake-based projects I encounter use conditional includes for expansion directories. Maybe this could be done here? Then users wanting to build
expansion_gl
would run, for example:If this is fine, I could come up with a pull request implementing it.