Fix binreloc test for all install paths inside prefix

The FHS standard rules for a /opt based prefix sets a sysconfig dir to
/etc/opt/... which is outside of /opt. This was however not detected
properly. It now is.
This commit is contained in:
Geert Janssens 2020-01-22 22:05:20 +01:00
parent 93ff991b31
commit 031d805bb2

View File

@ -74,7 +74,7 @@ foreach(install_dir ${CMAKE_INSTALL_FULL_BINDIR}
${CMAKE_INSTALL_FULL_SYSCONFDIR} ${CMAKE_INSTALL_FULL_DATAROOTDIR} ${CMAKE_INSTALL_FULL_SYSCONFDIR} ${CMAKE_INSTALL_FULL_DATAROOTDIR}
${CMAKE_INSTALL_FULL_DATADIR} ${CMAKE_INSTALL_FULL_LIBDIR}) ${CMAKE_INSTALL_FULL_DATADIR} ${CMAKE_INSTALL_FULL_LIBDIR})
string(FIND ${install_dir} ${CMAKE_INSTALL_PREFIX} in_prefix) string(FIND ${install_dir} ${CMAKE_INSTALL_PREFIX} in_prefix)
if(in_prefix EQUAL -1) if(NOT (in_prefix EQUAL 0))
set(ENABLE_BINRELOC OFF) set(ENABLE_BINRELOC OFF)
message(WARNING "${install_dir} is set outside of the intallation prefix ${CMAKE_INSTALL_PREFIX}. That will break relocation so ENABLE_BINRELOC is set to off. With relocation disabled GnuCash will run only in its configured install location. You must set GNC_UNINSTALLED=1 and GNC_BUILDDIR=/path/to/builddir to run from the build directory. GnuCash will not run from a DESTDIR.") message(WARNING "${install_dir} is set outside of the intallation prefix ${CMAKE_INSTALL_PREFIX}. That will break relocation so ENABLE_BINRELOC is set to off. With relocation disabled GnuCash will run only in its configured install location. You must set GNC_UNINSTALLED=1 and GNC_BUILDDIR=/path/to/builddir to run from the build directory. GnuCash will not run from a DESTDIR.")
break() break()