Project Generator needs fixing to work with Env Variables
the lastest nightly build, projectGenerator still had trouble with addon_config.mk, can't find and include the source file from include search paths,i.e i'm tested with ofxGStreamer, ADDON_INCLUDES += $(GSTREAMER_1_0_ROOT_MSVC_X86_64)include,it can not find source file and include within the VS2022 project solution
Originally posted by @liquidzym in #7588
@liquidzym is it stripping out the _ and replacing with spaces?
If you change all GSTREAMER 1 0 ROOT MSVC X86 64 to GSTREAMER_1_0_ROOT_MSVC_X86_64 and the same with OF ROOT to OF_ROOT does it work?
@dimitre any ideas
I've took a look at the code (I didnt write it) and found this:
if (containsSourceFiles(normalizedDir)) {
this wont allow this paths to pass because this variables are resolved inside VS, not replaced by PG. cc: @roymacdonald
It seems like those _ being stripped out are the problem. The issue seems to be in ofAddon::addReplaceStringVectorPathStr That is the point where the replacements happen. It is strange though that it does so for OF_ROOT. Yet, this was working before and now it is not... cheers
@danoli3 @ofTheo This path was directly added like this in VS
$(GSTREAMER_1_0_ROOT_MSVC_X86_64)include
and it works from there, because it is an environment variable that is correctly parsed there.
by having a function that checks if a folder is not empty before adding the path
if (containsSourceFiles(normalizedDir)) {
the file is never added because it is not a resolved path for PG. I think PG didn't use this filter until recently
I see.
I think that that filter was there before. I dont recall adding it. But, then you should have some sort of rule in ofAddon::addReplaceStringVectorPathStr that if it is not able to replace that variable it should leave it untouched and then have the containsSourceFiles function to also return true if the path has a variable in it. I am not sure but I could guess that since it is being treated as a std::filesystem::path rather than a string, it gets messed up at some point.
Oww finally, found the commit introducing this check, so assigning @danoli3 https://github.com/openframeworks/projectGenerator/commit/28d3e248a94c8f7da91385b78abdb3c1f5238411#diff-569e5575fd4a62c1169c6ffe799bea95b381d89eba1756d4f165a9a1b1e681f3
yeah most likely due to all those insane vs path issues we had back then, shouldn't be too hard to figure out if the value has a env variable they look pretty much the same
@dimitre could you fix this one though, I am overburdened
@danoli3 sure. This is what I think can fix with the minimum amount of changes. https://github.com/openframeworks/projectGenerator/pull/616
Anybody else can test this one? @ofTheo @danoli3 ? No windows machine here.
@dimitre your fix looked good to me so I merged. Do we need to do anything in OF/OF to update the submodule?
@liquidzym - this time tomorrow can you check the nightly builds and see if it works for you now?
@ofTheo I've just invoked manual nightly so we will have a new one in 25 minutes. about OF/OF it should build everything using latest PG. If anybody can help testing in Windows it would be great.
Testing with the latest nightly on Windows 10 using VS 2022: of_v20250307_vs_64_release
@NickHardeman is this good? maybe fixed?
That looks correct to me! Yay!!! 🎉
@ofTheo sorry just backing to home,the addon_config.mk the include path it has "_" with it ,not too sure why the captured images looks like without on it. ADDON_INCLUDES += $(GSTREAMER_1_0_ROOT_MSVC_X86_64)include ADDON_INCLUDES += $(GSTREAMER_1_0_ROOT_MSVC_X86_64)include/gstreamer-1.0 ADDON_INCLUDES += $(GSTREAMER_1_0_ROOT_MSVC_X86_64)include/glib-2.0 ADDON_INCLUDES += $(GSTREAMER_1_0_ROOT_MSVC_X86_64)lib/glib-2.0/include ADDON_INCLUDES += $(GSTREAMER_1_0_ROOT_MSVC_X86_64)lib/gstreamer-1.0/include ADDON_INCLUDES += $(GSTREAMER_1_0_ROOT_MSVC_X86_64)lib/gstreamer-1.0/include/gst
@liquidzym I tested this a few days ago and the PG seemed to add the correct paths from the addon_config.mk. Can you test with the latest PG to determine if the issue is resolved please?
@NickHardeman sorry for the multipost i just pasted the output message from PG https://github.com/openframeworks/openFrameworks/issues/8124#issuecomment-2713151687 not too sure why still get the same issue,but i'll testing it with another computer asap!
ok,just did tested with of_v20250311_vs_64_release,same issue,no clue at all,is it because the installed GSTREAMER driver path causing this? but it has env path in the system