Introduce gnucash-guile shared library

This (currently empty) library is intented to become
the standard api library for guile code that wants
to use the libgnucash functionality.
This commit is contained in:
Geert Janssens 2019-09-30 20:41:54 +02:00
parent a0aa105826
commit e493d42def
4 changed files with 65 additions and 3 deletions

View File

@ -868,7 +868,7 @@ configure_file(
add_custom_target(uninstall
COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake)
set(_MODULES gnc-core-utils gnc-module gnc-backend-xml-utils)
set(_MODULES gnc-core-utils gnc-module gnc-backend-xml-utils gnucash-guile)
if (WITH_SQL)
list(APPEND _MODULES gnc-backend-sql)

View File

@ -1,7 +1,23 @@
add_subdirectory(test)
set(GUILE_DEPENDS scm-core-utils scm-gnc-module gncmod-engine)
set(guile_HEADERS )
set(guile_SOURCES
gnc-guile-bindings.c)
set(guile_bindings_ALL_INCLUDES
${CMAKE_BINARY_DIR}/common
${CMAKE_CURRENT_SOURCE_DIR})
add_library(gnucash-guile SHARED ${guile_SOURCES} ${guile_HEADERS})
target_include_directories(gnucash-guile PUBLIC ${guile_bindings_ALL_INCLUDES})
install(TARGETS gnucash-guile
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
)
set(GUILE_DEPENDS scm-core-utils scm-gnc-module gncmod-engine)
gnc_add_scheme_targets(scm-scm
"utilities.scm"
@ -18,7 +34,9 @@ gnc_add_scheme_targets(price-quotes
FALSE)
set_local_dist(guile_DIST_local CMakeLists.txt utilities.scm price-quotes.scm)
set_local_dist(guile_DIST_local CMakeLists.txt utilities.scm price-quotes.scm
${guile_SOURCES} ${guile_HEADERS}
)
set(guile_DIST ${guile_DIST_local} ${test_guile_DIST} PARENT_SCOPE)

View File

@ -0,0 +1,43 @@
/*********************************************************************
* gnc-guile-bindings.c
* library to enable guile bindings for libgnucash
*
* Copyright (c) 2019 GnuCash Development Team
*********************************************************************/
/********************************************************************\
* This program is free software; you can redistribute it and/or *
* modify it under the terms of the GNU General Public License as *
* published by the Free Software Foundation; either version 2 of *
* the License, or (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License*
* along with this program; if not, contact: *
* *
* Free Software Foundation Voice: +1-617-542-5942 *
* 51 Franklin Street, Fifth Floor Fax: +1-617-542-2652 *
* Boston, MA 02110-1301, USA gnu@gnu.org *
* *
\********************************************************************/
#include <config.h>
#include <libguile.h>
void gnc_guile_bindings_init(void);
static int is_initialized = 0;
void
gnc_guile_bindings_init(void)
{
if (!is_initialized)
{
/* Do what's necessary to initialize the bindings */
is_initialized = 1;
}
}

View File

@ -1,5 +1,6 @@
# This is a list of files which contain translatable strings.
# This file was autogenerated by cmake.
bindings/guile/gnc-guile-bindings.c
bindings/guile/price-quotes.scm
bindings/guile/utilities.scm
borrowed/goffice/go-charmap-sel.c