Commit Graph

54 Commits

Author SHA1 Message Date
Geert Janssens
29b7a9099d Fix cmake warnings while searching for python
There is a new find module since cmake 3.12. Cmake 3.27 will start
emitting warnings if the old modules are still in use.

Current implementation supports both. As soon as we can bump our minimal
cmake version to 3.12, the old support code can be dropped as well.
2023-08-17 18:23:33 +02:00
John Ralls
4d46a8191d Merge Simon Arlott's 'test-xml-save' into stable. 2023-08-03 11:05:11 -07:00
Richard Cohen
66c5e398ae Change g_assert() -> g_assert_true() in tests
g_assert() can be compiled out, so should not be used for tests

g_assert_true was removed
to fis https://bugs.gnucash.org/show_bug.cgi?id=792008 because
g_assert_true was introduced in glib-2.38 and at the time GnuCash required
only glib-2.26. GnuCash has required glib >= 2.40 since 8acbc41c6 so
g_assert_true can be restored.
2023-07-16 10:09:12 -07:00
Simon Arlott
ab4e595670
Add failuref() test function that allows the use of format strings 2023-06-27 19:58:01 +01:00
Richard Cohen
bddb4468fa Import GLIB2 as a target, and use it to simplify the CMakeLists 2023-02-21 12:59:42 +00:00
Richard Cohen
e3515185d3 Make the cmake command lowercase 2023-01-31 16:25:12 +00:00
Richard Cohen
1cec0cb3f3 Use internal extern "C" { ... } for C++
- removes warnings compiling swig engine
...
[ 10%] Generating swig-engine.cpp
.../libgnucash/engine/engine-helpers.h:31: Warning 313: Unrecognized extern type "C++".
.../libgnucash/engine/gnc-date.h:83: Warning 313: Unrecognized extern type "C++".
.../libgnucash/engine/qofquery.h:90: Warning 302: Identifier 'QofQuery' redefined (ignored),
.../libgnucash/engine/gnc-option.hpp:55: Warning 302: previous definition of 'QofQuery'.
.../libgnucash/engine/gnc-commodity.h:56: Warning 313: Unrecognized extern type "C++".
.../libgnucash/engine/gncBusiness.h:40: Warning 313: Unrecognized extern type "C++".
.../libgnucash/engine/gncEntry.h:37: Warning 313: Unrecognized extern type "C++".
2023-01-23 18:40:01 +00:00
Mike Alexander
3c306eae65 Merge branch 'maint' 2022-10-09 22:27:55 -04:00
Mike Alexander
2d3e80ea08 Compatibility with XCode's "new build system"
With XCode 14 or newer CMake tries to use the "new build system" which has a
requirement that if two targets depend on the same generated file one of them
must depend on the other.  This commit adds reduntant dependencies to satisfy
this requirement.
2022-10-09 01:10:06 -04:00
John Ralls
95487eb4a0 Merge branch 'maint'
# Conflicts:
#	gnucash/gnome/window-reconcile2.c
#	libgnucash/app-utils/options.scm
#	libgnucash/engine/gnc-numeric.cpp
2022-04-14 18:02:17 -07:00
luz paz
8adedc2248 Fix various typos
Found via `codespell -q 3 -S *.po,./po,*.min.js,./ChangeLog*,./NEWS,./borrowed,./doc/README*,./AUTHORS,./libgnucash/tax/us/txf-de*,./data/accounts -L ans,ba,cas,dragable,gae,iff,iif,mut,nd,numer,parm,parms,startd,stoll`
2022-04-08 14:12:50 -04:00
John Ralls
c1c75e8f81 Revert "Revert "Merge Stefan Bayer's 'SepaInternalTransfer' into maint.""
The original merge was of a PR based on master into maint, bringing
along all of the development changes in master along with it. We don't
want that so the merge was reverted and the PR's two changes
cherry-picked in. That fixed maint, but then the next regular merge of
maint into master naturally included that revert commit undoing the
changes in master. Not so good. Reverting the revert, this commit,
restores the changes, albeit with messed up history.
2022-01-08 15:10:53 -08:00
John Ralls
5c7967c4a5 Revert "Merge Stefan Bayer's 'SepaInternalTransfer' into maint."
This reverts commit 17a3f7fef2, reversing
changes made to b8458d0732.
2021-12-03 13:58:07 -08:00
Christopher Lam
bbcffa3eca Remove deprecated scheme modules 2021-01-30 00:42:20 +08: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
06ff8a292d Use new keyword parameters for all calls to gnc_add_scheme_test_targets 2020-03-30 08:41:29 +02: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
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
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
John Ralls
76979554a0 Ubuntu 18.04 requires explicit link to pthreads. 2019-09-14 11:49:12 -07: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
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
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
John Ralls
827c43d935 Add jenny to the dist and compile it. 2018-07-23 12:47:25 -07: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
Bill Nottingham
0a3f2dd3ef Allow building against a shared libgmock (an option in gtest-1.8.0). 2018-04-03 21:59:50 -04:00
John Ralls
f4965ae2ac Move direct check dependencies to the originating CMakeLists.txt.
Removing transitive dependencies from being declared direct.
2018-02-18 22:16:27 -08:00
Geert Janssens
49a936c1fd Rewrite gnc_add_swig_guile_command to work in dist tarball as well
When building from git it will add targets to generate the swig files.
When building from tarball it will just point at the generated source
files from the tarball.
2018-01-29 19:46:44 +01:00
Geert Janssens
36cb167b68 Rewrite gnc_add_swig_python_command to work in dist tarball as well
When building from git it will add targets to generate the swig files.
When building from tarball it will just point at the generated source
files from the tarball.
2018-01-29 19:46:44 +01:00
Geert Janssens
4317d8a8f6 Improve handling of generated distributable files
- the two dist_add_... macros now both take a list of file names
as argument so more files can be added at once to the dist tarball.
- dist_add_generated now creates the right target by itself. There's
  no need to pass one any more
- make the swig generated *.py module files explicit output files
- change a couple of custom_targets into custom_commands. The only
  reason they were defined as targets was to ensure they got built
  before the dist tarball. This is now properly handled by the
  dist_add_... macros.
- correctly handle dependency on swig-runtime.h (using OBJECT_DEPENDS
  was not the way to do it according to that property's help page)
2018-01-29 19:46:44 +01:00
Geert Janssens
3dff4e5211 Fix make dist on a clean checkout
cmake with unix makefiles fails to resolve dist dependencies
added from COPY_FROM_BUILD if these dependencies aren't built yet.

This commit replaces the COPY_FROM_BUILD based logic with two new functions
'dist_add_configured' and 'dist_add_generated' to indicate which files should
be included in the dist tarball. The latter also adds a target level dependency
to the dist tarball custom command. Hence the former should
be used for files that get generated during a cmake run while the latter
should be used for files generated as the result of a 'make/ninja-build' run
(like files for which an add_custom_command rule exists).

Note: this commit also temporarily disables the dist target when building
from a tarball (and hence it won't be tested in distcheck either). This
will be handled in a future commit.
2018-01-29 19:46:44 +01:00
Rob Gowin
54ac7f23e0 Remove Autotools 2018-01-13 12:52:57 -06:00
John Ralls
44fc5b0555 Fix CXX Flags for g++. 2017-12-26 18:23:09 -08:00
John Ralls
91727525b9 Enforce -Werror on C++ files and fix resulting errors. 2017-12-26 15:18:43 -08:00
lmat
34e0d6cfa0 kvp frame to template and correcting failure macro
The template avoids the need to cast to and from void*, and adds flexibility to
the targeted function's signature.

test-stuff.h defines a macro, "failure" which is used as an identifier
in the standard IO library, so I moved any inclusion of test-stuff.h to
the last include position so that "failure" wouldn't be defined before
the IO library was included.
2017-12-21 07:39:32 -05:00
lmat
eb6c741bf9 Account.c to Account.cpp
Since Account.c is now Account.cpp, the function signatures look a bit
different internally. The tests rely on function signatures in error
messages. Instead of trying to figure out what the exact
function signature might be, I use a substring matching strategy to
ensure that the correct error was issued.
2017-12-21 07:39:32 -05:00
Geert Janssens
3d910ad2b1 Drop guile 1.8 support
And with it all quirks we still had in the code to support that version.
2017-12-20 14:55:40 +01:00
John Ralls
84929c8e5b One more stray header in libexec. 2017-12-02 10:34:07 -08:00
John Ralls
5ca129d82d Remove unset variable SWIG_ARGS from Makefile.am 2017-11-30 13:31:23 -08:00
Guy Taylor
c9c5876431 Use glib.h over custom typedefs in Python SWIG
Use the native glib.h (mainly gint, gfloat ...) over custom typedefs in
SWIG type files. This is for Python only.
2017-11-28 16:27:50 -08:00
John Ralls
5204100d53 Use GNUInstallDirs in CMake Builds
Provides correct file layout when building distribution tarballs.
Fixes Bugs 790840 and 790841.
2017-11-28 14:25:35 -08:00
John Ralls
e92a1b3723 Fix python tests in tarball builds. 2017-11-28 14:25:24 -08:00
John Ralls
831640b546 Remove common/test-core/unittest_support.py from git.
It's a SWIG-generated file accidentally added during directory
rearrangement.
2017-11-28 09:53:06 -08:00
John Ralls
f412795ef2 Remove extraneous parameters from GNC_ADD_SCHEME_TARGETS 2017-11-07 15:04:16 -08:00