Custom GRASS location not found, wrong GRASS_PREFIX (6) used #21117
Labels
Bug
Either a bug report, or a bug fix. Let's hope for the latter!
Build/Install
Related to compiling or installing QGIS
Author Name: William Kyngesburye (@kyngchaos)
Original Redmine Issue: 13043
Affected QGIS version: master
Redmine category:build/install
This is a combination of an old issue and the recent split GRASS 6/7 build mechanism.
When configuring QGIS for GRASS 6 on OS X, I use a custom GRASS prefix for a custom build to bundle with the app. I also have the GRASS app installed. Configure uses the custom GRASS_PREFIX yet finds the app (one of the default search paths for GRASS) for the GRASS_INCLUDE_DIR, but this has not been a problem in the past because my app and custom builds were the same version so the app's includes worked. If I rename the GRASS app, FindGRASS does not find GRASS at all, even from my custom path.
The new wrinkle added by the split GRASS 6/7 configuring is that the GRASS plugin and provider cmakelists don't appear to use the right GRASS_PREFIX for GRASS 6. FindGRASS sets GRASS_PREFIX${GRASS_CACHE_VERSION} where GRASS_CACHE_VERSION is empty for G6 to keep the old variable name. But the ADD_GRASSLIB macros for the GRASS provider and plugin use the GRASS_BUILD_VERSION passed to them to get the GRASS_PREFIX${GRASS_BUILD_VERSION}, but GRASS_PREFIX6 is not set, it's GRASS_PREFIX. And the build fails because headers are not found. The workaround is to specify both GRASS_PREFIX and GRASS_PREFIX6.
The text was updated successfully, but these errors were encountered: