The new modules regime can only find files in the final modules
layout, so interdependent files can be built only if they're linked
first or have a strict dependency order provided to cmake. In many
cases the latter is impractical.
Add CONFIGURATIONS keyword to unadorned tests, enables tests with
multi-config generators.
Add CONFIGURATION generator expression to libgtest.a and libgmock.a
build directory specs when building with Xcode so that it can
find them when building tests.
This starts by setting the gnucash version number in the 'project' call.
This will result in a number of variables set by cmake. The remainder
of this commit is to reuse the auto-generated
PROJECT_NAME, PROJECT_VERSION, PROJECT_VERSION_MAJOR
PROJECT_VERSION_MINOR, PROJECT_VERSION_PATCH and PROJECT_VERSION_TWEAK
instead of all the various instances of PACKAGE, GNUCASH_MAJOR_VERSION
and so on.
One parameter is worth mentioning - GETTEXT_PACKAGE
GnuCash is not using this directly (any more) but it has to be set before
including gi18n-lib.h.
Resolves most merge conflicts. The only bit I was unable
to merge from maint into master is the use of match-lambda
in category-barchart.scm. This will have to be redone manually.
Emit appropriate deprecation warnings in case code tries to invoke the removed functions.
Only for gnc:module-load a more elaborate compat function has
been written which should allow code using this obsolete function
to continue to function. The emitted deprecation warning will
guide the user to update his/her code for future compatibility.
That should trigger a regeneration of these swig sources if
any of the header files change.
This is done via a small macro that can be reused for other wrappers as well.
Note
cmake 3.15 introduces a 'FILTER' generator expression
that might allow us to do something like the following:
$<FILTER:$<TARGET_PROPERTY:baselib,SOURCES>,INCLUDE,"*.h[pp]?$">
I toyed briefly with that idea but it currently has two issues:
1. 3.15 is newer than our current minimum cmake requirement, so we can't
depend in that feature yet.
2. the sources are relative to *their* source directory, which
is different from the one in which the wrappers are generated
So they should still be properly transformed into absolute paths
This reverts commit 1a9fcfefad because
on MinGW cmake complains about the paths in pkgconfig files. This can
be addressed by using the MSYS2 cmake instead of the MINGW32 one, but
that requires some other changes... and there's also a path separator
bug in that version of FindPkgConfig.cmake.
Until now it was only done when building from git, but there's no
real reason not to do it as a normal build step in all cases.
It may have been unreliable in the past. There's no evidence
it still is.
This reverts commit adae341d, "Use cmake_symbol_check to test for
AB_Banking_RuntimeConfig_SetCharValue". We received multiple reports
that the cmake check fails and the behaviour unexpectedly does not use
the new function. As this is completely counter-intuitive as long as the
new-enough aqbanking version are there, we better just stick
to the aqbanking version numbers, especially because this function is used
only in exactly one place here.
This causes CMake to include their headers with -isystem instead of -I,
so the compiler doesn't generate warnings on them. ArchLinux was failing
to build because of such warnings.
Includes a function from cmake 3.6 to allow this to work on systems like
Ubuntu 14.04 that still provide only cmake 3.5.
This
* adds normal double quotes around the guild function call
* removes escaped quotes from paths
* add 'VERBATIM' keyword to let cmake perform its own escape logic on the commands
Verified to work on Windows and linux with both ninja and make.
This simplifies function gnc_gtest_configure(), since GoogleTest and
GoogleMock are combined in one source directory.
Additionally variable GMOCK_ROOT is not necessary anymore and is
removed.
1. If GTEST_ROOT and/or GMOCK_ROOT are defined, sources are expected
somewhere inside these directories. Otherwise a CMake error is
generated. Different source directory layouts are considered.
2. If GTEST_ROOT and GMOCK_ROOT are both not defined, sources are
searched in /usr/src. Different source directory layouts are considered.
3. If sources are not found in one of the first two cases, preinstalled
libraries are searched.
Additionally using HINTS in function find_path() has been replaced by
PATHS and PATH_SUFFIXES. According to CMake documentation in case of
hard-coded guesses PATHS should be used. Remark: This reverts commit
5f53e29, but instead NO_CMAKE_SYSTEM_PATH is used now to prevent CMake
from searching in system paths.
Hint: There was a special handling implemented regarding search for
gmock-all.cc. This file was additionally searched in /usr/src/gmock
directly instead of /usr/src/gmock/src (see commit 1241b71). This
special handling has been kept in case of searching sources in
/usr/src/gmock, but not in case of searching sources in GMOCK_ROOT or
GTEST_ROOT.
if GTEST/GMOCK sources are already found, only check if gtest/gtest.h
and gmock/gmock.h exist at GTEST_SRC_DIR/include and
GMOCK_SRC_DIR/include and set GTEST_INCLUDE_DIR and GMOCK_INCLUDE_DIR
accordingly.
This simplifies usage of GoogleTest, since independent handling of
GTEST_LIB and GTEST_INCLUDE_DIR is not necessary anymore.
Additionally CMake creates a dependency now between target gtest and all
test applications using it. This improves build process when building
GoogleTest from source code. When any test application is built,
GoogleTest library is automatically rebuilt if necessary now for
instance.
Currently when compiling GoogleTest from source code, source file
gtest_main.cc from GoogleTest repository is not compiled into any
library as in GoogleTest repository, where it is compiled into
libgtest_main.a. Instead gtest_main.cc is added to source file list
GTEST_SRC, which is then added to the list of source files of every
single GoogleTest based test application.
To simplify this gtest_main.cc is added to the source file list of
target gtest now. Additionally GTEST_SRC is merged into
lib_gtest_SOURCES, since both variables defined source files for
GoogleTest libraries.
Now target gtest generates library libgtest.a, which already contains
the main function from source file gtest_main.cc. This is different to
GoogleTest build system, where both are separated into two independent
libraries libgtest.a and libgtest_main.a.
The function accepts the name of a deprecated module and optionally a
replacement module.
With that info it will generate a stub guile module that
- will be installed in the gnucash guile load path
- emits a deprecation warning when the old module is used
- if a replacement module is given, will automatically load that module instead
This allows us to gently deprecate complete guile modules without
the burden of manually maintaining their module files.
Any scm file that will be built may need access to other scheme files that may have
been linked into that directory. As it was only scm files that would be linked
themselves would also be built with the search path set, causing other linked files
not to be found for an scm file that doesn't add a link for itself.
There are more, but these are most common ones.
There are also a number of urls that don't behave well when https, so those are skipped
At some point I have also started marking non-working URLs as [DEAD LINK], though
that's not a full coverage.
This version is available for all supported platforms and distros
(CentOS can have a version via EPEL, which is required anyway)
Advantages:
- one cmake version for all platforms
- we can drop all conditions based on cmake version
There were several issues:
- we store the compiled test*.go files in a tests subdirectory, but this is not
on the GUILE_LOAD_COMPILED_PATH. Added this directory to the path.
- guile was looking for 'script.scm.go' while we create 'script.go'. This is due
to how we invoke the scripts: guile -l path-to-script.scm -c (something)
we can replace this with -l path-to-script (without extension) as -l won't add
the extension. So I've rewrittin the test command to invoke (load-from-path).
- the test modules foo.scm, bar.scm and baz.scm should go in tests/gnucash
as they are defined as modules (gnucash foo), (gnucash bar) and (gnucash baz)
respectively.
- find html.scm/go on the load path instead of using a relative path.
Instead of random locations only occasionally related to the
corresponding source.
Includes renaming libgnucash/engine/test/test-extras.scm and
gnucash/report/report-system/test/test-extras.scm to avoid a
naming conflict.
Remove old (non-SEPA) online transaction code, because now in 2019
the banks will only offer SEPA transactions and no others. This
in turn means we don't need the old ktoblzcheck checking functions
at all, hence I remove this dependency completely.
This involves renaming 3 functions:
gnc_uri_get_protocol -> gnc_uri_get_scheme
gnc_uri_is_known_protocol -> gnc_uri_is_known_scheme
gnc_uri_is_file_protocol -> gnc_uri_is_file_scheme
The *_protocol variants are marked as deprecated.
Additionally a number of local variables have been renamed from
protocol to scheme to support this change.
argument 2 of type 'gint32' on gnucash.gnucash_core.QueryInt32Predicate
Add gint32 to typemap.
Also replace a couple of PyString_ calls leftover from Py2.
Patch by David Osguthorpe to provide typemaps so that SWIG doesn't
free buffers mem when buffer is saved as part of query struct leading
to garbage content. See https://bugs.gnucash.org/show_bug.cgi?id=796137
We only used strfmon in one source file to generate three fixed format
strings. Instead of updating to a newer strfmon in borrowed I have
chosen to reimplement the string formatters for these strings in C++.
Note this is *not* a full c++ conversion of the full functionality
of assistant-loan. Only the string parsing has been redone.
The swig 3.0 generated python wrappers trigger a warning converted into an error issued
by gcc 8.0 for using strncpy as follows:
strncpy(buff, "swig_ptr: ", 10);
The reason is this call will truncate the trailing null byte from the string.
This appears to have been fixed in swig master already but that's not released yet
so let disable the warning when compiling the swig wrappers until it is.