Commit Graph

206 Commits

Author SHA1 Message Date
John Ralls
76a4389a92 Bomb out immediately if or aren't set
Instead of spewing dozens of errors about file(TO_CMAKE_PATH) needing 3 parameters.
2021-03-25 13:53:58 -07:00
Christopher Lam
092040c7fe Merge branch 'maint' 2021-02-16 18:44:02 +08:00
John Ralls
96dcca997f Bug 798019 - Currency rates in OFX file are ignored
Use currency_rate information from OFX file if available. Requires
LibOFX v 0.10.0 or later.
2021-02-09 15:10:59 -08:00
Christopher Lam
bbcffa3eca Remove deprecated scheme modules 2021-01-30 00:42:20 +08:00
John Ralls
273841eabc Fix variable reversal in GncAddTest.cmake. 2021-01-17 11:08:24 -08:00
John Ralls
d86b30b628 Force scheme to make links before any builds.
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.
2020-12-13 16:45:18 -08:00
John Ralls
401299cdd3 Fix adding Scheme tests to check target.
TEST isn't a variable name, SCHEME_TGT_TESTS is.
2020-09-26 13:11:12 -07:00
John Ralls
4ee573e23a Link with libm.so on those platforms that require it. 2020-07-06 12:30:37 -07:00
Christopher Lam
14ea5d9751 Merge branch 'maint' 2020-05-04 23:31:21 +08:00
John Ralls
1e59819176 Respect the environment LD_LIBRARY_PATH for loading Scheme modules and tests. 2020-04-29 17:11:52 -07:00
John Ralls
396ddbd472 Remove support on Linux/BSD for ancient versions of WebKitGtk.
Still supporting 2.4.11 on Mac/Win.
2020-04-24 14:22:18 -07:00
John Ralls
758bd7b656 Merge branch 'maint' 2020-04-24 13:52:21 -07:00
John Ralls
4b8649f77b Set CONFIGURATIONS property on tests only for Xcode.
Having it in the general case disabled a large number of tests.
2020-04-18 13:09:32 -07:00
John Ralls
3ca8fa1229 Merge branch 'maint' 2020-04-13 11:27:14 -07:00
John Ralls
1365a19e2e Force WITH_PYTHON=YES for distcheck.
To ensure that it works from the tarball.
2020-04-12 15:51:05 -07:00
c-holtermann
ab843c0b7a include gnucash_core of python bindings in python swig app-utils 2020-04-06 07:03:40 +02:00
Geert Janssens
e78313147c Cmake - rework gnc_add_scheme_deprecated_module to use keyword parameters
Update all invocations accordingly
2020-03-30 08:41:29 +02:00
Geert Janssens
ba15cf7f7f Combine the two scheme target generation functions
Add another keyword TEST to set when test targets are to be created
2020-03-30 08:41:29 +02:00
Geert Janssens
25e08f88a5 Document the two primary functions for adding scheme targets 2020-03-30 08:41:29 +02:00
Geert Janssens
06ff8a292d Use new keyword parameters for all calls to gnc_add_scheme_test_targets 2020-03-30 08:41:29 +02:00
Geert Janssens
c05281c582 Use new keyword parameters for all calls to gnc_add_scheme_targets 2020-03-30 08:41:29 +02:00
Geert Janssens
91ecdcb5dd Rework SchemeTargets module to use keyword parameters 2020-03-30 08:41:29 +02:00
Geert Janssens
ba7362d895 CMake - Drop oldstyle endfunction invocations
The form without repeating the function name is preferred
2020-03-30 08:41:29 +02:00
John Ralls
f85be03bb5 Merge branch 'maint' 2020-03-29 14:46:55 -07:00
John Ralls
33902a6793 Improve test building with the Xcode generator.
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.
2020-03-23 17:52:26 -07:00
Geert Janssens
987fc15fc9 Drop our local copy of pkg_check_modules
It was needed for cmake versions older than 3.6, but we
require at least 3.10 now
2020-02-24 13:33:06 +01:00
Geert Janssens
301db9020d Merge branch 'maint' 2020-02-06 16:50:08 +01:00
Geert Janssens
90e95ba8ef CMake - remove parameter repetition in else() and endif() statements - part 2
This follows Professional CMake's recommended practises
I missed plenty of these in my first commit. This one should fix
these remaining occurrences.
2020-02-06 16:16:36 +01:00
Geert Janssens
490b20d2da Merge branch 'maint' 2020-01-17 18:35:30 +01:00
Geert Janssens
d8a304c2c9 Housekeeping - reduce the number of PACKAGE and VERSION related cmake variables
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.
2020-01-17 18:15:27 +01:00
Geert Janssens
45cfb8937a Merge branch 'maint'
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.
2020-01-14 19:56:35 +01:00
John Ralls
53ed90862c Bug 797536 - cmake errors out because it cannot find GncPkgConfig (cmake 3.5.2) 2019-12-29 12:35:13 -08:00
Christopher Lam
279a5fcde8 Merge branch 'maint' 2019-12-08 20:34:49 +08:00
Geert Janssens
88706e5657 bindings/guile - remove gnc-module wrapper
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.
2019-12-06 20:38:21 +01:00
Geert Janssens
4c77f7670e engine - remove gncmod boilerplate
engine is now an ordinary shared library

This requires a few more places to run gnc_engine_init as
this is no longer done as part of module loading.
2019-12-06 20:38:21 +01:00
Geert Janssens
a6b7eecd81 core-utils - make the swig generated source file dependent on the core-utils headers
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
2019-12-06 19:59:11 +01:00
Geert Janssens
33e1ff645c Allow to pass include directories to the add_swig_xyz commands
This will be needed when the wrappers no longer live in
the same directory as the objects they are wrapping.
2019-12-06 19:59:11 +01:00
Christopher Lam
1c64385614 base-typemaps: avoid slow g_list_nth_data
scan GList via glist pointer links rather than incrementing index.
2019-12-05 10:17:12 +08:00
Robert Fewell
cbc8cc8d8c Remove file committed by mistake 2019-11-25 20:43:39 +00:00
Robert Fewell
161bb5f65d Change import-main-matcher to display matched information
Change the import-main-matcher tree view to use a tree store and add
the matched information as a child row.
2019-11-25 16:18:21 +00:00
Geert Janssens
0eb0b922d7 Python - remove 2.x only code paths 2019-10-02 12:35:25 +02:00
John Ralls
b8b33b9591 Revert "More conversions from pkg-config variables to imported targets."
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.
2019-09-21 15:53:25 -07:00
Geert Janssens
980daeec83 Make swig wrapper generation just another build step
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.
2019-09-21 22:50:51 +02:00
Geert Janssens
9214f2ed5b Merge branch 'maint' 2019-09-18 22:42:48 +02:00
Christopher Lam
16da1acf1d Merge branch 'typos1' of git://github.com/luzpaz/gnucash into luzpaz-typos1 2019-09-18 21:36:29 +08:00
Christian Stimming
ccaaa14187 [aqbanking] Again use aqbanking version number for new function instead of cmake_symbol_check
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.
2019-09-17 22:09:47 +02:00
Geert Janssens
797654133b Use newer cmake version checks 2019-09-17 15:46:50 +02:00
John Ralls
76979554a0 Ubuntu 18.04 requires explicit link to pthreads. 2019-09-14 11:49:12 -07:00
luz.paz
65bb60d621 Fix typos for gnuchash/ doc/ bindings/ and misc.
Typos found via `codespell -q 3 -D ~/Projects/codespell/codespell_lib/data/dictionary.txt -S *.po,./po,*.min.js,./ChangeLog*,./NEWS,./doc/README*,./AUTHORS,./libgnucash/tax/us/txf-de*,./data/accounts -L ans,cas,dragable,gae,iff,iif,mut,nd,numer,startd,stoll`
2019-09-13 20:26:03 -04:00
John Ralls
e38cc91452 Merge branch 'maint'
Bumping the required cmake to 3.10 and removing GncPkgConfig.cmake as
no longer required.
2019-09-13 09:43:04 -07:00
John Ralls
41c58ec00a Convert Gtk3 and Webkit to imported targets.
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.
2019-09-12 21:20:29 -07:00
Geert Janssens
70eb7172d5 Drop special case for old cmake versions
We require 3.5 which is more recent than 3.3
2019-09-12 22:54:24 +02:00
Geert Janssens
82b3af9695 Change scheme file compile command invocation
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.
2019-09-12 22:54:24 +02:00
Christian Gruber
97a81980e5 Remove support for GoogleTest/GoogleMock <= v1.8.0
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.
2019-09-04 22:06:32 +02:00
Christian Gruber
3c93f18115 Additionally search for system headers, if sources are found in /usr/src 2019-09-04 00:02:27 +02:00
Christian Gruber
d637c53fff Separate search for GTEST/GMOCK sources into different cases
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.
2019-09-03 23:59:28 +02:00
Christian Gruber
53fe478ce1 Do not search for headers anymore, if sources are already found
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.
2019-09-03 23:54:48 +02:00
Christian Gruber
84d9f1c9a5 Change search strategy for prebuilt GoogleTest/GoogleMock libraries
Prebuilt GoogleTest/GoogleMock libraries are now only searched, if
GTEST_ROOT and GMOCK_ROOT are not defined.
2019-09-03 23:45:09 +02:00
Christian Gruber
b303fc6d99 Use target gtest instead of GTEST_LIB and GTEST_INCLUDE_DIR
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.
2019-09-03 23:45:09 +02:00
Christian Gruber
7e71a9724f Change search strategy for prebuilt GoogleTest/GoogleMock libraries
Prebuilt GoogleTest/GoogleMock libraries are now only searched, if
GoogleTest source code wasn't found.
2019-09-03 23:45:06 +02:00
Geert Janssens
0e93e95c6c Merge maint 2019-08-17 12:53:55 +02:00
Christian Gruber
1b4e481296 Add gtest_main.cc to libgtest.a
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.
2019-08-15 23:20:45 +02:00
John Ralls
adae341def Use cmake_symbol_check to test for AB_Banking_RuntimeConfig_SetCharValue
instead of relying on AQBanking versions.
2019-08-13 09:52:31 -07:00
Christopher Lam
720f176417 Merge branch 'maint' 2019-07-25 20:30:32 +08:00
Thomas Klausner
507ef68dc7 Bug 795251 - googletest detection cannot be overridden
For the part about the GTest linking problem.
2019-07-20 18:05:13 -07:00
Geert Janssens
06fae12265 RptCleanup - Add compat interface for all module interfaces that were deprecated so far
These can be permanently removed for the gnucash 5.x series. A comment has been added to that effect.
2019-06-18 15:18:46 +02:00
Geert Janssens
f39275be32 RptCleanup - Add cmake command to generated compat modules for deprecated guile modules
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.
2019-06-18 14:25:04 +02:00
Geert Janssens
32a83678c9 RptCleanup - Install our guile api as a guile site module
This is similar to how our python code is installed as a python site module
2019-06-18 14:25:04 +02:00
Geert Janssens
91adf868f4 BuildSystem - drop load path for no longer existing build-config.scm 2019-06-14 16:21:43 +02:00
Geert Janssens
8aa696223b Always add share/scm to GUILE_LOAD_PATH
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.
2019-06-12 15:16:30 +02:00
John Ralls
9ec5eab714 Merge branch 'maint' 2019-06-09 12:43:12 -07:00
Geert Janssens
15a35e6a3b Housekeeping - replace plenty of http links with https
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.
2019-06-06 15:52:30 +02:00
Geert Janssens
cc7ca438c0 Merge branch 'maint' 2019-05-27 11:58:18 +02:00
Geert Janssens
be1484841c One more minor cmake cleanup 2019-05-25 12:11:53 +02:00
Geert Janssens
b7479e8fb0 Bump minimum cmake version to 3.5
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
2019-05-25 12:04:51 +02:00
Geert Janssens
d35eabd636 Prevent autocompilation of the guile test scripts
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.
2019-05-25 10:09:12 +02:00
John Ralls
cac307602f Build or link all Scheme test files into a directory "tests".
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.
2019-05-25 10:09:07 +02:00
John Ralls
141e777893 Suppress installing Scheme test programs. 2019-05-25 10:07:42 +02:00
Frank H. Ellenberger
7cb4c1d7b1 Cleanup of no longer used Gettext flags
We don't need HAVE_GETTEXT conditional code
2019-05-14 23:44:18 +02:00
John Ralls
3815e17e9f Replace VERSION_GREATER_EQUAL with VERSION_GREATER OR VERSION_EQUAL.
The former wasn't introduced until Cmake 3.7.
2019-04-22 12:12:03 -07:00
John Ralls
79f4536a0f Fix typo 2019-04-22 11:28:08 -07:00
John Ralls
4f51f17223 Remove unset _GUILE_LD_LIBRARY_PATH from GncAddSchemeTargets. 2019-04-22 11:26:19 -07:00
John Ralls
b1fdf781ec Adjust GncAddSchemeTargets.cmake to build with Guile2.2 on MinGS64. 2019-04-22 11:26:19 -07:00
Christian Stimming
dac94ce038 Remove ktoblzcheck dependency.
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.
2019-02-13 11:26:39 +01:00
Geert Janssens
d22e1db340 gnc-uri - refer to 'scheme' instead of 'protocol' as that's the more formal term used in uris
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.
2018-12-27 22:33:17 +01:00
Frank H. Ellenberger
b2e4148d6e Replace misleading comment for config.h 2018-12-21 07:21:04 +01:00
John Ralls
5e426aa935 gcc-4.8 seems to dislike a space between # and cmakedefine. 2018-10-29 15:35:35 -07:00
John Ralls
f93310426d Fix WORDS_BIGENDIAN setting in config.h. 2018-10-29 14:28:47 -07:00
John Ralls
59a6ebc33a Fix TravisCI build failure. 2018-09-18 15:07:47 -07:00
John Ralls
0cf42a75b3 Bug 796858 - TypeError: in method 'qof_query_int32_predicate',...
argument 2 of type 'gint32' on gnucash.gnucash_core.QueryInt32Predicate

Add gint32 to typemap.
Also replace a couple of PyString_ calls leftover from Py2.
2018-09-18 10:23:11 -07:00
John Ralls
1a7c5b9a32 Merge Christoff Holterman's Bug 796137 repair into maint. 2018-09-08 13:20:51 -07:00
Christoph Holtermann
6384854319 Bug 796137 - Fix QofIdType and QofIdTypeConst to work with python3
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
2018-09-08 09:31:45 +02:00
Geert Janssens
54a5097c60 Bug 796777 - CVE-2008-1391: Integer overflow in included strfmon function
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.
2018-08-17 16:23:12 +02:00
John Ralls
827c43d935 Add jenny to the dist and compile it. 2018-07-23 12:47:25 -07:00
Geert Janssens
00ef7f3ab3 Guile 2: stop suppressing guile deprecated messages
All known deprecations have been dealt with and if new uses
of deprecated methods appear we want know this.
2018-07-05 14:25:38 +02:00
goodvibes2
5f53e2926a Use HINTS instead of PATHS to tell cmake where to look for GTEST + GMOCK
files so it selects the paths in GTEST_ROOT + GMOCK_ROOT rather than the
system libraries.
2018-06-11 18:30:04 +10:00
Geert Janssens
dc7135920b Minor build error message improvement 2018-06-08 14:27:58 +02:00
Geert Janssens
1f3cf845c4 Work around a conflict between gcc 8.0 and swig 3.0
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.
2018-05-09 22:18:29 +02:00
Geert Janssens
a9f35ed7ae Lowercase cmake commands
A huge bikeshed fest but it distracted me enough to do it anyway.
2018-05-03 23:18:15 +02:00
John Ralls
c4e5e18c0a Redefine some more buggy Guile string conversions. 2018-04-24 17:57:52 -07:00