Tweak install rule to be able to compile glib's schema's on Windows as well

It's a bit of a hack based on the assumption DESTDIR is never set on Windows.
A install time guard is added to assert this.

It needed a few changes to make this working:
- Have cmake expand DESTDIR instead of delaying this to bash
  If not, bash would see "$DESTDIRC:/gcdev64/..." and we'd loose
  the drive letter in bash' expansion of $DESTDIRC.
  So work with $ENV{DESTDIR} instead
- To prevent cmake from already expanding this in the
  build system generation step add the appropriate escapes to
  that variable.
- Add guard code in the install command that asserts
  DESTDIR is not set on Windows. Use similar escapes as
  necessary to ensure the evaluation happens at install time
  rather than in the generation step.
This commit is contained in:
Geert Janssens
2019-10-06 21:27:10 +02:00
parent f28cf41611
commit 75073a7ab2
2 changed files with 16 additions and 4 deletions

View File

@@ -84,6 +84,8 @@ foreach(install_dir ${CMAKE_INSTALL_FULL_BINDIR}
break()
endif()
endforeach()
message(STATUS "CMAKE_INSTALL_FULL_DATADIR: ${CMAKE_INSTALL_FULL_DATADIR}")
message(STATUS "DESTDIR: ${DESTDIR}")
# GnuCash installs two files in ${CMAKE_INSTALL_SYSCONFDIR}
set(BINDIR ${CMAKE_INSTALL_BINDIR} CACHE STRING "user executables")