mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
Remove autotools-only path exception to find reports
With it we can also remove the hack to find standard reports while running from the build tree.
This commit is contained in:
parent
e7ec3a610d
commit
c29b9c9cbf
@ -59,14 +59,5 @@ GNC_ADD_SCHEME_TARGETS(scm-standard-reports-2
|
||||
|
||||
ADD_CUSTOM_TARGET(scm-standard-reports ALL DEPENDS scm-standard-reports-2 scm-standard-reports-1)
|
||||
|
||||
# FIXME: This is a hack since core-utils assumes an autotools build environment.
|
||||
|
||||
SET(STD_RPT_DIR ${CMAKE_CURRENT_BINARY_DIR}/gnucash/report)
|
||||
FILE(MAKE_DIRECTORY ${STD_RPT_DIR})
|
||||
FILE(COPY standard-reports.scm DESTINATION ${STD_RPT_DIR})
|
||||
|
||||
FILE(MAKE_DIRECTORY ${STD_RPT_DIR}/standard-reports)
|
||||
FILE(COPY ${standard_reports_SCHEME_2} DESTINATION ${STD_RPT_DIR}/standard-reports)
|
||||
|
||||
SET_LOCAL_DIST(standard_reports_DIST_local CMakeLists.txt ${standard_reports_SCHEME} ${standard_reports_SCHEME_2})
|
||||
SET(standard_reports_DIST ${standard_reports_DIST_local} ${test_standard_reports_DIST} PARENT_SCOPE)
|
||||
|
@ -169,30 +169,21 @@ gchar *gnc_path_get_accountsdir()
|
||||
* @returns A newly allocated string. */
|
||||
gchar *gnc_path_get_reportdir()
|
||||
{
|
||||
gchar *result;
|
||||
const gchar *builddir = g_getenv ("GNC_BUILDDIR");
|
||||
if (g_getenv ("GNC_UNINSTALLED") && builddir)
|
||||
{
|
||||
result = g_build_filename (builddir, "gnucash", "report", NULL);
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Careful: if the autoconf macro GNC_SCM_INSTALL_DIR gets changed
|
||||
* in configure.ac, this path should probably change as well.
|
||||
* Currently this code assumes GNC_SCM_INSTALL_DIR is set to
|
||||
* pkgdatadir/scm
|
||||
* We can't use the AC_MACRO GNC_SCM_INSTALL_DIR here directly
|
||||
* because that's expanded at build time. On Windows and OS X
|
||||
* the final path may get installed in a different location
|
||||
* than assumed during build, invalidating the build path at
|
||||
* runtime.
|
||||
*/
|
||||
gchar *pkgdatadir = gnc_path_get_pkgdatadir ();
|
||||
result = g_build_filename (pkgdatadir, "scm",
|
||||
"gnucash", "report", (char*)NULL);
|
||||
g_free (pkgdatadir);
|
||||
}
|
||||
//printf("Returning stdreportsdir %s\n", result);
|
||||
/* Careful: if the cmake variable SCHEME_INSTALLED_SOURCE_DIR gets changed
|
||||
* in toplevel CMakeLists.txt, this path should probably change as well.
|
||||
* Currently this code assumes SCHEME_INSTALLED_SOURCE_DIR is set to
|
||||
* pkgdatadir/scm
|
||||
* We can't use GNC_SCM_INSTALL_DIR directly at build time to
|
||||
* get this information, because on Windows and OS X
|
||||
* the final path may get installed in a different location
|
||||
* than assumed during build, invalidating the build path at
|
||||
* runtime.
|
||||
*/
|
||||
gchar *pkgdatadir = gnc_path_get_pkgdatadir ();
|
||||
gchar *result = g_build_filename (pkgdatadir, "scm",
|
||||
"gnucash", "report", (char*)NULL);
|
||||
g_free (pkgdatadir);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
@ -203,17 +194,8 @@ gchar *gnc_path_get_reportdir()
|
||||
* @returns A newly allocated string. */
|
||||
gchar *gnc_path_get_stdreportsdir()
|
||||
{
|
||||
gchar *result;
|
||||
gchar *reportdir = gnc_path_get_reportdir ();
|
||||
if (g_getenv ("GNC_UNINSTALLED"))
|
||||
{
|
||||
result = g_build_filename (reportdir, "standard-reports", "gnucash",
|
||||
"report", "standard-reports", NULL);
|
||||
}
|
||||
else
|
||||
{
|
||||
result = g_build_filename (reportdir, "standard-reports", NULL);
|
||||
}
|
||||
gchar *result = g_build_filename (reportdir, "standard-reports", NULL);
|
||||
g_free (reportdir);
|
||||
//printf("Returning stdreportsdir %s\n", result);
|
||||
return result;
|
||||
|
Loading…
Reference in New Issue
Block a user