Merge branch 'maint'

This commit is contained in:
Geert Janssens 2020-02-06 16:50:08 +01:00
commit 301db9020d
41 changed files with 290 additions and 329 deletions

View File

@ -107,7 +107,7 @@ if (MINGW)
if(${IS_MSYS2} GREATER_EQUAL 0)
set(MINGW64 ON)
endif()
endif(MINGW)
endif()
# Find a proper bash executable
@ -177,14 +177,14 @@ if (WIN32)
#set(LIBXSLT_XSLTPROC_EXECUTABLE ${CMAKE_PREFIX_PATH}/libxslt/bin/xsltproc)
#Prevent creating a console window on startup.
set(CMAKE_EXE_LINKER_FLAGS -mwindows)
endif(WIN32)
endif()
find_package(Threads REQUIRED)
find_package(PkgConfig REQUIRED)
if (NOT PKG_CONFIG_FOUND)
message (SEND_ERROR "pkg-config not found, but is required")
endif (NOT PKG_CONFIG_FOUND)
endif()
# glib et al.
pkg_check_modules (GLIB2 REQUIRED glib-2.0>=2.40)
@ -199,20 +199,20 @@ if (WITH_GNUCASH)
if (WIN32 OR APPLE)
pkg_check_modules (WEBKIT REQUIRED IMPORTED_TARGET webkitgtk-3.0)
set(WEBKIT1 1 CACHE INTERNAL "WebKitGtk")
else (WIN32 OR APPLE)
else()
pkg_check_modules (WEBKIT IMPORTED_TARGET webkit2gtk-4.0)
if (NOT WEBKIT_FOUND)
pkg_check_modules (WEBKIT REQUIRED IMPORTED_TARGET webkit2gtk-3.0)
set(WEBKIT2_3 1 CACHE INTERNAL "WebKit2Gtk3")
else (NOT WEBKIT_FOUND)
else()
if (NOT WEBKIT2_3)
set(WEBKIT2_4 1 CACHE INTERNAL "WebKit2Gtk4")
endif(NOT WEBKIT2_3)
endif (NOT WEBKIT_FOUND)
endif (WIN32 OR APPLE)
endif()
endif()
endif()
pkg_check_modules (GTK3 REQUIRED IMPORTED_TARGET gtk+-3.0>=3.18.0)
endif (WITH_GNUCASH)
endif()
pkg_check_modules (ZLIB REQUIRED zlib)
@ -222,7 +222,7 @@ if (MSVC)
# Disable the obnoxious min/max macros in MSVC - we want to use the
# function versions of them.
add_definitions ( -DNOMINMAX )
endif (MSVC)
endif()
find_path (LTDL_INCLUDE_PATH NAMES ltdl.h PATHS /usr/include)
if(NOT LTDL_INCLUDE_PATH-NOTFOUND)
@ -232,14 +232,14 @@ endif()
find_program(GLIB_COMPILE_SCHEMAS glib-compile-schemas HINTS ${CMAKE_PREFIX_PATH}/gnome/bin)
if (NOT GLIB_COMPILE_SCHEMAS)
message(SEND_ERROR "Can't find glib-compile-schemas program. Please set GLIB_COMPILE_SCHEMAS.")
endif(NOT GLIB_COMPILE_SCHEMAS)
endif()
find_path (REGEX_INCLUDE_PATH NAMES regex.h
PATHS /usr/include /opt/gnome/include)
find_library (REGEX_LIBRARY NAMES regex)
# I18N
find_package (Gettext 0.19.6 REQUIRED)
find_package (Gettext 0.20 REQUIRED)
find_path (LIBINTL_INCLUDE_PATH NAMES libintl.h
PATHS /usr/include /opt/gnome/include)
find_library (LIBINTL_LIBRARY NAMES intl)
@ -249,7 +249,7 @@ if (WIN32)
message(STATUS "Looking for htmlhelp.h and htmlhelp.a")
find_path (HTMLHELP_INCLUDE_PATH NAMES htmlhelp.h)
find_library (HTMLHELP_LIBRARY htmlhelp)
endif (WIN32)
endif()
# ############################################################
@ -273,10 +273,10 @@ if (GUILE22_FOUND) # found guile-2.2
find_program (GUILD_EXECUTABLE NAMES guild2.2 guild)
if (NOT GUILD_EXECUTABLE)
message (SEND_ERROR "The guild executable was not found, but is required. Please set GUILD_EXECUTABLE.")
endif (NOT GUILD_EXECUTABLE)
endif()
message(STATUS "Using guile-2.2.x")
find_program (GUILE_EXECUTABLE NAMES guile2.2 guile)
else(GUILE22_FOUND)
else()
pkg_check_modules (GUILE2 guile-2.0>=2.0.9 QUIET)
if (GUILE2_FOUND) # found guile-2.0
add_definitions (-DHAVE_GUILE20)
@ -288,17 +288,17 @@ else(GUILE22_FOUND)
find_program (GUILD_EXECUTABLE NAMES guild2.0 guild)
if (NOT GUILD_EXECUTABLE)
message (SEND_ERROR "The guild executable was not found, but is required. Please set GUILD_EXECUTABLE.")
endif (NOT GUILD_EXECUTABLE)
endif()
message(STATUS "Using guile-2.0.x")
find_program (GUILE_EXECUTABLE NAMES guile2.0 guile)
else(GUILE2_FOUND)
else()
message (FATAL_ERROR "Neither guile 2.2 nor guile 2.0 were found GnuCash can't run without one of them. Ensure that one is installed and can be found with pkg-config.")
endif(GUILE2_FOUND)
endif(GUILE22_FOUND)
endif()
endif()
if (NOT GUILE_EXECUTABLE)
message (SEND_ERROR "The guile executable was not found, but is required. Please set GUILE_EXECUTABLE.")
endif (NOT GUILE_EXECUTABLE)
endif()
# Test that guile has SRFI-64. This is required for some unit tests.
execute_process (COMMAND ${GUILE_EXECUTABLE} -c "(use-modules (srfi srfi-64))"
@ -309,7 +309,7 @@ execute_process (COMMAND ${GUILE_EXECUTABLE} -c "(use-modules (srfi srfi-64))"
if (GNC_SRFI64_RESULT EQUAL 0)
message (STATUS "Using guile SRFI-64")
set (HAVE_SRFI64 TRUE)
endif ()
endif()
# Test that guile has textual-ports. This is required for the stress test.
execute_process (COMMAND ${GUILE_EXECUTABLE} -c "(use-modules (ice-9 textual-ports))"
@ -320,7 +320,7 @@ execute_process (COMMAND ${GUILE_EXECUTABLE} -c "(use-modules (ice-9 textual-por
if (GNC_TEXT_PORTS_RESULT EQUAL 0)
message (STATUS "Using guile textual-ports")
set (HAVE_TEXT_PORTS TRUE)
endif ()
endif()
# Determine where to install our guile modules libraries.
find_guile_dirs()
@ -342,17 +342,17 @@ if (WITH_AQBANKING)
if(GWEN_GTK3_FOUND AND GWEN_GTK3_VERSION VERSION_GREATER "4.20.0")
set(HAVE_GWEN_GTK3 1 CACHE BOOL "True if gwen-gtk3.pc exists")
endif()
endif(WITH_GNUCASH)
endif (WITH_AQBANKING)
endif()
endif()
if (WITH_OFX)
pkg_check_modules (LIBOFX REQUIRED libofx)
include(CheckCXXSourceRuns)
if (WIN32)
set(CMAKE_REQUIRED_LIBRARIES "-L ${CMAKE_PREFIX_PATH}/libofx/lib -lofx")
else (WIN32)
else()
set(CMAKE_REQUIRED_LIBRARIES "-lofx")
endif (WIN32)
endif()
CHECK_CXX_SOURCE_RUNS("
#include <time.h>
#include <stdlib.h>
@ -379,7 +379,7 @@ int main(int argc, char** argv)
" HAVE_OFX_BUG_39)
set(HAVE_OFX_BUG_39 ${HAVE_OFX_BUG_39})
set(CMAKE_REQUIRED_LIBRARIES)
endif(WITH_OFX)
endif()
# ############################################################
if(APPLE)
@ -399,9 +399,9 @@ if(APPLE)
find_library(CARBON_LIBRARY Carbon)
set(OSX_EXTRA_COMPILE_FLAGS $<$<COMPILE_LANGUAGE:C>:-xobjective-c> $<$<COMPILE_LANGUAGE:CXX>:-xobjective-c++>)
set(OSX_EXTRA_LIBRARIES objc ${COCOA_LIBRARY} ${SECURITY_LIBRARY} ${CARBON_LIBRARY})
endif(GTK_MAC_FOUND)
endif()
endif()
endif(APPLE)
endif()
# find_package(LibXslt) eats PKG_CONFIG_EXECUTABLE, so preserve it.
set(GNC_PKG_CONFIG_EXE ${PKG_CONFIG_EXECUTABLE})
@ -412,10 +412,10 @@ find_package(LibXslt)
if (NOT LIBXSLT_FOUND)
message(FATAL_ERROR "libxslt library not found.")
endif(NOT LIBXSLT_FOUND)
endif()
if (${LIBXSLT_XSLTPROC_EXECUTABLE} STREQUAL "LIBXSLT_XSLTPROC_EXECUTABLE-NOTFOUND")
message(FATAL_ERROR "xsltproc executable not found")
endif ()
endif()
# ############################################################
set(PKG_CONFIG_EXECUTABLE ${GNC_PKG_CONFIG_EXE})
@ -431,10 +431,10 @@ find_library (LIBDBI_DRIVERS_DIR
if (WITH_SQL)
if (NOT LIBDBI_INCLUDE_PATH)
message (SEND_ERROR "Include file <dbi/dbi.h> was not found - did you install libdbi0-dev or libdbi-dev?")
endif (NOT LIBDBI_INCLUDE_PATH)
endif()
if (NOT LIBDBI_LIBRARY)
message (SEND_ERROR "Library libdbi was not found")
endif (NOT LIBDBI_LIBRARY)
endif()
set(HAVE_DBI_DBI_H 1)
if (NOT LIBDBI_DRIVERS_DIR)
message (SEND_ERROR "No libdbi drivers found, SQL tests will fail.")
@ -442,7 +442,7 @@ if (WITH_SQL)
get_filename_component(drivers_dir ${LIBDBI_DRIVERS_DIR} DIRECTORY)
set(LIBDBI_DRIVERS_DIR ${drivers_dir} CACHE FILEPATH "Directory containing the libdbi driver modules." FORCE)
endif()
endif (WITH_SQL)
endif()
# ############################################################
@ -482,7 +482,7 @@ find_package(Perl)
if (NOT PERL_FOUND)
message(SEND_ERROR "Perl executable not found. Please set PERL_EXECUTABLE.")
endif(NOT PERL_FOUND)
endif()
get_filename_component(PERL_DIR ${PERL_EXECUTABLE} DIRECTORY)
@ -509,7 +509,7 @@ find_package (Boost 1.67.0 COMPONENTS date_time regex locale filesystem system)
if (Boost_FOUND)
include_directories(${Boost_INCLUDE_DIRS})
set(HAVE_BOOST 1)
else ()
else()
find_package (Boost 1.60.0 REQUIRED COMPONENTS date_time regex locale filesystem system)
if (Boost_FOUND)
include (CheckIncludeFileCXX)
@ -554,16 +554,16 @@ if (UNIX)
set( CMAKE_CXX_FLAGS "-Werror -Wall -Wmissing-declarations -Wno-unused -Wno-error=parentheses ${CMAKE_CXX_FLAGS}")
set( CMAKE_CXX_FLAGS "-Wno-error=deprecated-declarations ${REGISTER_CXXFLAG} ${CMAKE_CXX_FLAGS}")
set( CMAKE_C_FLAGS_RELEASE "-O3 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 ${CMAKE_C_FLAGS}")
endif (UNIX)
endif()
if (MINGW)
set( CMAKE_C_FLAGS "-Werror -Wdeclaration-after-statement -Wno-pointer-sign -Wall -Wunused -Wmissing-prototypes -Wmissing-declarations -Wno-unused -Wno-error=deprecated-declarations ${CMAKE_C_FLAGS}")
set( CMAKE_CXX_FLAGS "-DWINVER=0x0500 -D_EMULATE_GLIBC=0 ${CMAKE_CXX_FLAGS}") # Workaround for bug in gtest on mingw, see https://github.com/google/googletest/issues/893 and https://github.com/google/googletest/issues/920
endif (MINGW)
endif()
if (APPLE AND WITH_GNUCASH)
set(CMAKE_MACOSX_RPATH ON)
set(CMAKE_INSTALL_NAME_DIR "${CMAKE_INSTALL_FULL_LIBDIR}")
endif (APPLE AND WITH_GNUCASH)
endif()
if (UNIX)
set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_FULL_LIBDIR}:${CMAKE_INSTALL_FULL_LIBDIR}/gnucash")
@ -641,9 +641,9 @@ if (MINGW)
set (HAVE_SCANF_LLD 1)
else ()
set (HAVE_SCANF_I64D 1)
endif ()
endif()
set (HAVE_HTMLHELPW 1)
endif (WIN32)
endif()
check_include_files (dirent.h HAVE_DIRENT_H)
check_include_files (dlfcn.h HAVE_DLFCN_H)
@ -668,17 +668,17 @@ check_include_files (wctype.h HAVE_WCTYPE_H)
test_big_endian(IS_BIGENDIAN)
if (IS_BIGENDIAN)
set(WORDS_BIGENDIAN)
endif (IS_BIGENDIAN)
endif()
if (NOT DISABLE_NLS)
set(ENABLE_NLS 1)
endif(NOT DISABLE_NLS)
endif()
if (ENABLE_BINRELOC)
if (UNIX OR MINGW)
set(BR_PTHREAD 1)
endif(UNIX OR MINGW)
endif(ENABLE_BINRELOC)
endif()
endif()
if (UNIX OR MINGW)
set (HAVE_GETTIMEOFDAY 1)
@ -691,7 +691,7 @@ set (_GNU_SOURCE 1)
set (_POSIX_PTHREAD_SEMANTICS 1)
set (_TANDEM_SOURCE 1)
set (__EXTENSIONS__ 1)
endif (UNIX OR MINGW)
endif()
if (UNIX)
set (HAVE_CHOWN 1)
@ -717,11 +717,11 @@ set (HAVE_STRUCT_TM_GMTOFF 1)
set (HAVE_TIMEGM 1)
set (HAVE_TOWUPPER 1)
set (GNC_PLATFORM_POSIX 1)
endif (UNIX)
endif()
if (WIN32)
set (GNC_PLATFORM_WINDOWS 1)
endif (WIN32)
endif()
if (APPLE)
# FIXME: HANDLE gtk-mac-integration-gtk2
@ -729,7 +729,7 @@ set(GNC_PLATFORM_DARWIN 1)
set(GNC_PLATFORM_OSX 1)
set(PLATFORM_OSX 1)
set(HAVE_OSX_KEYCHAIN 1)
endif(APPLE)
endif()
if(GLIB2_VERSION VERSION_GREATER_EQUAL 2.46.0)
set(HAVE_GLIB_2_46 1)
@ -737,17 +737,17 @@ endif()
if(DISABLE_DEPRECATED_GNOME)
set(GNOME_DISABLE_DEPRECATED 1)
endif(DISABLE_DEPRECATED_GNOME)
endif()
if(DISABLE_DEPRECATED_GTK)
set(GTK_DISABLE_DEPRECATED 1)
set(GDK_DISABLE_DEPRECATED 1)
set(GDK_PIXMAP_DISABLE_DEPRECATED 1)
endif(DISABLE_DEPRECATED_GTK)
endif()
if(DISABLE_DEPRECATED_GLIB)
set(G_DISABLE_DEPRECATED 1)
endif(DISABLE_DEPRECATED_GLIB)
endif()
add_definitions (-DHAVE_CONFIG_H)
@ -763,7 +763,7 @@ add_subdirectory (common)
add_subdirectory (libgnucash)
if (WITH_GNUCASH)
add_subdirectory (gnucash)
endif (WITH_GNUCASH)
endif()
add_subdirectory (bindings)
add_subdirectory (test-templates)
add_subdirectory (util)
@ -864,11 +864,11 @@ set(_MODULES gnc-core-utils gnc-engine gnc-app-utils gnc-module gnc-locale-tax g
if (WITH_SQL)
list(APPEND _MODULES gnc-backend-sql)
endif(WITH_SQL)
endif()
if (WITH_GNUCASH)
list(APPEND _MODULES gnc-gnome)
endif(WITH_GNUCASH)
endif()
set_target_properties(${_MODULES} PROPERTIES
LIBRARY_OUTPUT_DIRECTORY ${LIBDIR_BUILD}
@ -922,6 +922,6 @@ endif()
if(UNIX)
set(CPACK_GENERATOR "TGZ")
endif(UNIX)
endif()
include (CPack)

View File

@ -65,7 +65,7 @@ Libraries/Deps
guile 2.2.0 or 2.0.0 Must be built with regex
support enabled
libxml2 2.5.10
gettext 0.19.6
gettext 0.20
libxslt, including xsltproc
ICU International Components for
Unicode

View File

@ -4,7 +4,7 @@ add_subdirectory(chartjs)
add_subdirectory(guile-json)
if (WITH_GNUCASH)
add_subdirectory(gwengui-gtk3)
endif (WITH_GNUCASH)
endif()
set_local_dist(borrowed_DIST_local jenny/jenny.c CMakeLists.txt README)
set(borrowed_DIST ${borrowed_DIST_local} ${chartjs_DIST} ${libc_DIST} ${guile-json_DIST} ${goffice_DIST} ${gwengui_gtk3_DIST} PARENT_SCOPE)

View File

@ -5,7 +5,7 @@ if (APPLE)
COMMAND /usr/bin/install_name_tool -add_rpath ${CMAKE_INSTALL_LIBDIR}
-add_rpath ${PKGLIBDIR}
${CMAKE_INSTALL_BINDIR}/gnucash)")
endif(APPLE)
endif()
set_dist_list(cmake_DIST CMakeLists.txt README_CMAKE.txt cmake_uninstall.cmake.in

View File

@ -2,7 +2,7 @@
if(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt")
message(FATAL_ERROR "Cannot find install manifest: @CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt")
endif(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt")
endif()
file(READ "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt" files)
string(REGEX REPLACE "\n" ";" files "${files}")
@ -16,8 +16,8 @@ foreach(file ${files})
)
if(NOT "${rm_retval}" STREQUAL 0)
message(FATAL_ERROR "Problem when removing $ENV{DESTDIR}${file}")
endif(NOT "${rm_retval}" STREQUAL 0)
else(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}")
endif()
else()
message(STATUS "File $ENV{DESTDIR}${file} does not exist.")
endif(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}")
endif()
endforeach(file)

View File

@ -112,11 +112,11 @@ function(make_scheme_targets _TARGET _SOURCE_FILES _OUTPUT_DIR _GUILE_DEPENDS
message(" SOURCE_FILES: ${_SOURCE_FILES}")
message(" GUILE_DEPENDS: ${_GUILE_DEPENDS}")
message(" DIRECTORIES: ${BINDIR_BUILD}, ${LIBDIR_BUILD}, ${DATADIR_BUILD}")
endif(__DEBUG)
endif()
set(_CMD "create_symlink")
if(WIN32)
set(_CMD "copy")
endif(WIN32)
endif()
set(current_srcdir ${CMAKE_CURRENT_SOURCE_DIR})
set(current_bindir ${CMAKE_CURRENT_BINARY_DIR})
set(build_bindir ${BINDIR_BUILD})
@ -153,7 +153,7 @@ function(make_scheme_targets _TARGET _SOURCE_FILES _OUTPUT_DIR _GUILE_DEPENDS
endif()
endforeach(scheme_file)
add_custom_target(${_TARGET}-links ALL DEPENDS ${_SCHEME_LINKS})
endif(MAKE_LINKS)
endif()
# Construct the guile source and compiled load paths
set(_GUILE_LOAD_PATH "${current_srcdir}" "${current_bindir}" "${current_bindir}/deprecated")
@ -195,18 +195,18 @@ function(make_scheme_targets _TARGET _SOURCE_FILES _OUTPUT_DIR _GUILE_DEPENDS
set(fpath "")
file(TO_CMAKE_PATH "$ENV{PATH}" fpath)
set(LIBRARY_PATH "PATH=${BINDIR_BUILD};${fpath}")
else (MINGW64)
else()
set (LIBRARY_PATH "LD_LIBRARY_PATH=${LIBDIR_BUILD}:${LIBDIR_BUILD}/gnucash")
endif (MINGW64)
endif()
if (APPLE)
set (LIBRARY_PATH "DYLD_LIBRARY_PATH=${LIBDIR_BUILD}:${LIBDIR_BUILD}/gnucash")
endif (APPLE)
endif()
set(_GNC_MODULE_PATH "")
if(MINGW64)
set(_GNC_MODULE_PATH "${build_bindir}")
else(MINGW64)
else()
set(_GNC_MODULE_PATH "${LIBDIR_BUILD}" "${LIBDIR_BUILD}/gnucash" "${GNC_MODULE_PATH}")
endif(MINGW64)
endif()
if(NOT MINGW64 OR ${GUILE_EFFECTIVE_VERSION} VERSION_LESS 2.2)
make_unix_path_list(_GUILE_LOAD_PATH)
make_unix_path_list(_GUILE_LOAD_COMPILED_PATH)
@ -218,7 +218,7 @@ function(make_scheme_targets _TARGET _SOURCE_FILES _OUTPUT_DIR _GUILE_DEPENDS
message(" GUILE_LOAD_PATH: ${_GUILE_LOAD_PATH}")
message(" GUILE_LOAD_COMPILED_PATH: ${_GUILE_LOAD_COMPILED_PATH}")
message(" GNC_MODULE_PATH: ${_GNC_MODULE_PATH}")
endif(__DEBUG)
endif()
#We quote the arguments to stop CMake stripping the path separators.
add_custom_command(
OUTPUT ${output_file}
@ -237,7 +237,7 @@ function(make_scheme_targets _TARGET _SOURCE_FILES _OUTPUT_DIR _GUILE_DEPENDS
endforeach(source_file)
if (__DEBUG)
message("TARGET_FILES are ${_TARGET_FILES}")
endif(__DEBUG)
endif()
add_custom_target(${_TARGET} ALL DEPENDS ${_TARGET_FILES})
set(_TARGET_FILES "${_TARGET_FILES}" PARENT_SCOPE)
endfunction(make_scheme_targets)

View File

@ -27,7 +27,7 @@ function(get_guile_env)
set(compiled_path "${CMAKE_BINARY_DIR}/${GUILE_REL_SITECCACHEDIR}")
string(REGEX REPLACE "^([A-Za-z]):" "/\\1" compiled_path ${compiled_path})
list(APPEND env GUILE_LOAD_COMPILED_PATH=${compiled_path})
endif(MINGW64)
endif()
list(APPEND env "GNC_MODULE_PATH=${_GNC_MODULE_PATH}")
list(APPEND env "GUILE=${GUILE_EXECUTABLE}")
@ -56,7 +56,7 @@ function(get_guile_env)
list(APPEND new_path ${load_item})
endforeach(load_item)
set(guile_load_compiled_path ${new_path})
endif (MINGW64)
endif()
if (WIN32 AND NOT MINGW64)
string(REPLACE ";" "\\\\;" GUILE_LOAD_PATH "${guile_load_path}")
string(REPLACE ";" "\\\\;" GUILE_LOAD_COMPILED_PATH "${guile_load_compiled_path}")

View File

@ -11,9 +11,9 @@ macro (macro_add_source_file_compile_flags _sourcefile _additionalflags)
get_source_file_property (_flags ${_sourcefile} COMPILE_FLAGS)
if (_flags)
set(_flags "${_flags} ${_additionalflags}")
else (_flags)
else()
set(_flags "${_additionalflags}")
endif (_flags)
endif()
set_source_files_properties (${_sourcefile} PROPERTIES COMPILE_FLAGS "${_flags}")
endmacro (macro_add_source_file_compile_flags)

View File

@ -20,7 +20,7 @@ function(run_dist_check PACKAGE_PREFIX EXT)
FIND_PROGRAM(NINJA_COMMAND NAMES ninja ninja-build)
if (${NINJA_COMMAND} STREQUAL "NINJA_COMMAND-NOTFOUND")
message(FATAL_ERROR "Can't find the 'ninja' or 'ninja-build' program.")
endif ()
endif()
execute_process_and_check_result(
COMMAND ${CMAKE_COMMAND} -E tar ${TAR_OPTION} ${tarball}

View File

@ -25,11 +25,11 @@ if (WIN32)
set (GNUCASH_RESOURCE_FILE ${CMAKE_CURRENT_BINARY_DIR}/gnucash.rc)
configure_file(gnucash.rc.in gnucash.rc @ONLY NEWLINE_STYLE WIN32)
else (WIN32)
else()
# All other platforms use these settings:
set (PLATFORM_FILES gnucash-valgrind)
endif (WIN32)
endif()
set (gnucash_SOURCES
gnucash-bin.c
@ -48,7 +48,7 @@ target_compile_definitions(gnucash PRIVATE -DG_LOG_DOMAIN=\"gnc.bin\")
if (BUILDING_FROM_VCS)
target_compile_definitions(gnucash PRIVATE -DGNC_VCS=\"git\")
target_compile_definitions(gncmod-gnome-utils PRIVATE -DGNC_VCS=\"git\")
endif (BUILDING_FROM_VCS)
endif()
target_link_libraries (gnucash
gncmod-ledger-core gnc-gnome gncmod-gnome-utils gnc-app-utils
@ -97,7 +97,7 @@ add_custom_command(
if (MAC_INTEGRATION)
target_compile_options(gnucash PRIVATE ${OSX_EXTRA_COMPILE_FLAGS})
target_link_libraries(gnucash ${OSX_EXTRA_LIBRARIES})
endif(MAC_INTEGRATION)
endif()
install(TARGETS gnucash DESTINATION ${CMAKE_INSTALL_BINDIR})
# No headers to install.
@ -224,7 +224,7 @@ if (WIN32)
file(TO_NATIVE_PATH ${CMAKE_PREFIX_PATH}/${dir}/bin PATH_ITEM)
list(APPEND CMD_LINES "set PATH=${PATH_ITEM}\;%PATH%\n")
endforeach(dir)
endif (NOT ${MINGW64})
endif()
set(CMD_FILE ${CMAKE_CURRENT_BINARY_DIR}/gnucash-launcher.cmd)
file(WRITE ${CMD_FILE} "@echo off\nsetlocal\n\n")
foreach(line ${CMD_LINES})
@ -240,7 +240,7 @@ if (WIN32)
file(APPEND ${BUILD_CMD_FILE} "\nstart gnucash %*\n")
install(PROGRAMS ${CMD_FILE} DESTINATION ${CMAKE_INSTALL_BINDIR})
endif(WIN32)
endif()
# The GResource Files are absolute paths but set_local_dist requires
# relative paths.

View File

@ -222,12 +222,12 @@ target_compile_definitions(gncmod-gnome-utils PUBLIC ${GTK_MAC_CFLAGS_OTHER}
if (BUILDING_FROM_VCS)
target_compile_definitions(gncmod-gnome-utils PRIVATE -DGNC_VCS=\"git\")
endif (BUILDING_FROM_VCS)
endif()
if (MAC_INTEGRATION)
target_compile_options(gncmod-gnome-utils PRIVATE ${OSX_EXTRA_COMPILE_FLAGS})
target_link_libraries(gncmod-gnome-utils ${OSX_EXTRA_LIBRARIES})
endif(MAC_INTEGRATION)
endif()
target_include_directories(gncmod-gnome-utils
PUBLIC

View File

@ -167,7 +167,7 @@ add_dependencies (gnc-gnome swig-runtime-h)
if (MAC_INTEGRATION)
target_compile_options(gnc-gnome PRIVATE ${OSX_EXTRA_COMPILE_FLAGS})
target_link_libraries(gnc-gnome ${OSX_EXTRA_LIBRARIES})
endif(MAC_INTEGRATION)
endif()
install(TARGETS gnc-gnome

View File

@ -94,11 +94,10 @@ struct _GncBudgetViewClass
enum
{
TOTALS_TYPE_INCOME, /**< This total is Income type*/
TOTALS_TYPE_EXPENSES, /**< This total is Expenses type*/
TOTALS_TYPE_ASSET, /**< This total is Assets type*/
TOTALS_TYPE_LIABILITY, /**< This total is Liabilities type*/
TOTALS_TYPE_EQUITY /**< This total is for Equity type*/
TOTALS_TYPE_INCOME, /**< This total is Income type*/
TOTALS_TYPE_EXPENSES, /**< This total is Expenses type*/
TOTALS_TYPE_ASSET_LIAB_EQ, /**< This total is Asset/Liab/Equity type*/
TOTALS_TYPE_REMAINDER /**< This total is Remaining to Budget*/
};
/**< \brief ENUM for different budget totals types.
@ -448,17 +447,15 @@ gbv_create_widget (GncBudgetView *budget_view)
G_CALLBACK(gbv_totals_scrollbar_value_changed_cb), budget_view);
// Create totals tree view
totals_tree_model = gtk_list_store_new (2, G_TYPE_STRING, G_TYPE_INT);
gtk_list_store_append (totals_tree_model, &iter);
gtk_list_store_set (totals_tree_model, &iter, 0, _("Income"), 1, TOTALS_TYPE_INCOME, -1);
gtk_list_store_append (totals_tree_model, &iter);
gtk_list_store_set (totals_tree_model, &iter, 0, _("Expenses"), 1, TOTALS_TYPE_EXPENSES, -1);
gtk_list_store_append (totals_tree_model, &iter);
gtk_list_store_set (totals_tree_model, &iter, 0, _("Assets"), 1, TOTALS_TYPE_ASSET, -1);
gtk_list_store_append (totals_tree_model, &iter);
gtk_list_store_set (totals_tree_model, &iter, 0, _("Liabilities"), 1, TOTALS_TYPE_LIABILITY, -1);
gtk_list_store_append (totals_tree_model, &iter);
gtk_list_store_set (totals_tree_model, &iter, 0, _("Equity"), 1, TOTALS_TYPE_EQUITY, -1);
totals_tree_model = gtk_list_store_new(2, G_TYPE_STRING, G_TYPE_INT);
gtk_list_store_append(totals_tree_model, &iter);
gtk_list_store_set(totals_tree_model, &iter, 0, _("Inflow from Income"), 1, TOTALS_TYPE_INCOME, -1);
gtk_list_store_append(totals_tree_model, &iter);
gtk_list_store_set(totals_tree_model, &iter, 0, _("Outflow to Expenses"), 1, TOTALS_TYPE_EXPENSES, -1);
gtk_list_store_append(totals_tree_model, &iter);
gtk_list_store_set(totals_tree_model, &iter, 0, _("Outflow to Asset/Equity/Liability"), 1, TOTALS_TYPE_ASSET_LIAB_EQ, -1);
gtk_list_store_append(totals_tree_model, &iter);
gtk_list_store_set(totals_tree_model, &iter, 0, _("Remaining to Budget"), 1, TOTALS_TYPE_REMAINDER, -1);
totals_tree_view = GTK_TREE_VIEW(gtk_tree_view_new());
priv->totals_tree_view = totals_tree_view;
@ -1213,7 +1210,7 @@ totals_col_source (GtkTreeViewColumn *col, GtkCellRenderer *cell,
gchar amtbuff[100]; //FIXME: overkill, where's the #define?
gint i;
gint num_top_accounts;
gboolean red;
gboolean red, neg;
GNCPriceDB *pdb;
gnc_commodity *total_currency, *currency;
@ -1236,33 +1233,72 @@ totals_col_source (GtkTreeViewColumn *col, GtkCellRenderer *cell,
for (i = 0; i < num_top_accounts; ++i)
{
GNCAccountType acctype;
account = gnc_account_nth_child (priv->rootAcct, i);
currency = gnc_account_get_currency_or_parent (account);
acctype = xaccAccountGetType (account);
switch (xaccAccountGetType (account))
{
case ACCT_TYPE_INCOME:
if (row_type != TOTALS_TYPE_INCOME)
continue;
break;
case ACCT_TYPE_EXPENSE:
if (row_type != TOTALS_TYPE_EXPENSES)
continue;
break;
case ACCT_TYPE_ASSET:
if (row_type != TOTALS_TYPE_ASSET)
continue;
break;
case ACCT_TYPE_LIABILITY:
if (row_type != TOTALS_TYPE_LIABILITY)
continue;
break;
case ACCT_TYPE_EQUITY:
if (row_type != TOTALS_TYPE_EQUITY)
continue;
break;
default:
continue;
if (gnc_using_unreversed_budgets(gnc_account_get_book(account)))
{ /* using book with unreversed-budgets feature. This will be
the default in 4.x after budget scrubbing*/
neg = gnc_reverse_balance (account);
switch (row_type)
{
case TOTALS_TYPE_ASSET_LIAB_EQ:
if ((acctype == ACCT_TYPE_LIABILITY) ||
(acctype == ACCT_TYPE_EQUITY))
neg = !neg;
else if (acctype != ACCT_TYPE_ASSET)
continue;
break;
case TOTALS_TYPE_EXPENSES:
if (acctype != ACCT_TYPE_EXPENSE)
continue;
break;
case TOTALS_TYPE_INCOME:
if (acctype != ACCT_TYPE_INCOME)
continue;
neg = !neg;
break;
case TOTALS_TYPE_REMAINDER:
if ((acctype == ACCT_TYPE_ASSET) ||
(acctype == ACCT_TYPE_INCOME) ||
(acctype == ACCT_TYPE_EXPENSE))
neg = !neg;
break;
default:
continue; /* don't count if unexpected total row type is passed in... */
}
}
else
{ /* this section is for backward compatibility, to be
removed when unreversed-budgets are mandatory */
neg = FALSE;
switch (row_type)
{
case TOTALS_TYPE_ASSET_LIAB_EQ:
if ((acctype != ACCT_TYPE_ASSET) &&
(acctype != ACCT_TYPE_LIABILITY) &&
(acctype != ACCT_TYPE_EQUITY))
continue;
break;
case TOTALS_TYPE_EXPENSES:
if (acctype != ACCT_TYPE_EXPENSE)
continue;
break;
case TOTALS_TYPE_INCOME:
if (acctype != ACCT_TYPE_INCOME)
continue;
break;
case TOTALS_TYPE_REMAINDER:
neg = (acctype != ACCT_TYPE_INCOME);
break;
default:
continue; /* don't count if unexpected total row type is passed in... */
}
}
// find the total for this account
@ -1279,6 +1315,9 @@ totals_col_source (GtkTreeViewColumn *col, GtkCellRenderer *cell,
gnc_budget_get_period_start_date (budget, period_num));
}
if (neg)
value = gnc_numeric_neg (value);
total = gnc_numeric_add (total, value, GNC_DENOM_AUTO, GNC_HOW_DENOM_LCD);
}

View File

@ -46,7 +46,7 @@ if (COMPILE_GSCHEMAS)
execute_process(
COMMAND ${SHELL} -c \"echo Compiling gschema files in \$ENV\{DESTDIR\}${CMAKE_INSTALL_FULL_DATADIR}/glib-2.0/schemas ;
${GLIB_COMPILE_SCHEMAS} \$ENV\{DESTDIR\}${CMAKE_INSTALL_FULL_DATADIR}/glib-2.0/schemas\")")
endif ()
endif()
set(gschemas_DIST_local "")
foreach(file ${gschema_SOURCES})

View File

@ -30,7 +30,7 @@ else ()
list(APPEND html_HEADERS gnc-html-webkit2.h)
list(APPEND html_SOURCES gnc-html-webkit2.c)
set(html_EXTRA_DIST gnc-html-webkit1.h gnc-html-webkit1.c)
endif ()
endif()

View File

@ -89,7 +89,7 @@ endif()
DESTINATION ${DATADIR_BUILD}/gnucash/ui)
file(COPY ${aqbanking_GLADE}
DESTINATION ${DATADIR_BUILD}/gnucash/gtkbuilder)
endif(WITH_AQBANKING)
endif()
set_local_dist(aqbanking_DIST_local CMakeLists.txt
${aqbanking_SOURCES} ${aqbanking_noinst_HEADERS} ${aqbanking_EXTRA_DIST}

View File

@ -3,6 +3,6 @@ if (WITH_AQBANKING)
set(aqb_GSCHEMA org.gnucash.dialogs.import.hbci.gschema.xml)
add_gschema_targets("${aqb_GSCHEMA}")
endif(WITH_AQBANKING)
endif()
set_dist_list(aqbanking_gschema_DIST CMakeLists.txt org.gnucash.dialogs.import.hbci.gschema.xml.in)

View File

@ -3,6 +3,6 @@ if (WITH_OFX)
set(ofx_GSCHEMA org.gnucash.dialogs.import.ofx.gschema.xml)
add_gschema_targets("${ofx_GSCHEMA}")
endif (WITH_OFX)
endif()
set_dist_list(ofx_gschema_DIST CMakeLists.txt org.gnucash.dialogs.import.ofx.gschema.xml.in)

View File

@ -5,6 +5,6 @@ if(WITH_OFX)
set(OFX_TEST_LIBS)
gnc_add_test(test-link-ofx test-link.c OFX_TEST_INCLUDE_DIRS OFX_TEST_LIBS)
endif(WITH_OFX)
endif()
set_dist_list(test_ofx_DIST CMakeLists.txt test-link.c)

View File

@ -29,7 +29,7 @@ if (HAVE_SRFI64)
FALSE
)
add_dependencies(check scm-qif-import-2 scm-qif-import)
endif (HAVE_SRFI64)
endif()
set_dist_list(test_qif_import_DIST CMakeLists.txt test-link.c
${scm_qifimp_test_with_srfi64_SOURCES})

View File

@ -33,7 +33,7 @@ endif()
file(COPY ${pycons_DATA} DESTINATION ${CMAKE_BINARY_DIR}/share/gnucash/python/pycons)
file(COPY init.py DESTINATION ${CMAKE_BINARY_DIR}/share/gnucash/python)
endif(WITH_PYTHON)
endif()
set_local_dist(pycons_DIST ${pycons_DATA})
set_local_dist(python_DIST_local CMakeLists.txt gncmod-python.c init.py)

View File

@ -586,10 +586,9 @@
;; total balances from get-exchange-totals are divided by each
;; other.
(map
(lambda (e)
(list (car e)
(abs (/ ((cdadr e) 'total #f)
((caadr e) 'total #f)))))
(match-lambda
((comm (domestic . foreign))
(list comm (abs (/ (foreign 'total #f) (domestic 'total #f))))))
(gnc:get-exchange-totals report-commodity end-date)))
(define (gnc:make-exchange-cost-alist report-commodity end-date)
@ -597,12 +596,10 @@
;; total balances from get-exchange-totals are divided by each
;; other.
(map
(lambda (e)
(list (car e)
(if (zero? ((caadr e) 'total #f))
0
(abs (/ ((cdadr e) 'total #f)
((caadr e) 'total #f))))))
(match-lambda
((comm (domestic . foreign))
(let ((denom (domestic 'total #f)))
(list comm (if (zero? denom) 0 (abs (/ (foreign 'total #f) denom)))))))
(gnc:get-exchange-cost-totals report-commodity end-date)))
@ -850,7 +847,7 @@
(define (gnc:uniform-commodity? amt report-commodity)
;; function to see if the commodity-collector amt
;; contains any foreign commodities
(let ((list-of-commodities (amt 'format (lambda (comm amt) comm) #f)))
(or (null? list-of-commodities)
(and (null? (cdr list-of-commodities))
(gnc-commodity-equiv report-commodity (car list-of-commodities))))))
(match (amt 'format (lambda (comm amt) comm) #f)
(() #t)
((comm) (gnc-commodity-equiv report-commodity comm))
(_ #f)))

View File

@ -22,6 +22,7 @@
;; Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
;; 02111-1307 USA
(use-modules (ice-9 match))
; using all of these seems like overkill --
; not sure which are really required
(use-modules (gnucash engine))
@ -32,13 +33,10 @@
(define-public (fmtnumber n)
;; Format a number (integer or real) into something printable
(number->string (if (integer? n)
(inexact->exact n)
n)))
(number->string (if (integer? n) (inexact->exact n) n)))
(define-public (fmtnumeric n)
;; Format gnc-numeric n with as many decimal places as required
(fmtnumber (gnc-numeric-to-double n)))
;; Format gnc-numeric n with as many decimal places as required
(define-public fmtnumeric fmtnumber)
(define-public (gnc-monetary-neg? monetary)
; return true if the monetary value is negative
@ -46,14 +44,15 @@
;; 'Safe' versions of cdr and cadr that don't crash
;; if the list is empty (is there a better way?)
(define-public (safe-cdr l)
(if (null? l) '()
(cdr l)))
(define-public (safe-cadr l)
(cond
((null? l) '())
((null? (cdr l)) '())
(else (cadr l))))
(define-public safe-cdr
(match-lambda
((_ . x) x)
(_ '())))
(define-public safe-cadr
(match-lambda
((_ x . _) x)
(_ '())))
; deprecated - use find-stylesheet or find-template instead
(define-public (find-file fname)

View File

@ -87,6 +87,7 @@
(use-modules (ice-9 rdelim)) ; for read-line
(use-modules (ice-9 local-eval)) ; for the-environment
(use-modules (gnucash app-utils)) ; for _
(use-modules (gnucash utilities)) ; for gnc:html-string-sanitize
(define-public (string-substitute-alist str sub-alist)
(with-output-to-string
@ -98,15 +99,6 @@
c)))
str))))
;; This is needed for displaying error messages -- note that it assumes that
;; the output is HTML, which is a pity, because otherwise this module is
;; non-specific -- it is designed to output a mixture of Guile and any other
;; sort of text. Oh well.
(define-public (escape-html s1)
(string-substitute-alist s1 '((#\< . "&lt;")
(#\> . "&gt;")
(#\& . "&amp;"))))
;; regexps used to find start and end of code segments
(define startre (and (defined? 'make-regexp) (make-regexp "<\\?scm(:d)?[[:space:]]")))
(define endre (and (defined? 'make-regexp) (make-regexp "(^|[[:space:]])\\?>")))
@ -183,65 +175,39 @@
;; env - environment in which to do the evaluation;
;; if #f, (the-environment) will be used
(define (script->output env)
; Placeholder for the normal stack and error stack in case of an error
(define good-stack #f)
(define error-stack #f)
; Actual evaluation function. This is where the work happens.
(define (eval-input)
(let ((s-expression (read)))
(while (not (eof-object? s-expression))
; Capture the current stack, so we can detect from where we
; need to display the stack trace
(set! good-stack (make-stack #t))
(local-eval s-expression (or env (the-environment)))
(set! s-expression (read)))))
; Error handler to display any errors while evaluating the template
;; Placeholder for the error stack in case of an error
(define error-stack #f)
(define local-env (or env (the-environment)))
;; Actual evaluation function. This is where the work happens.
(define (eval-input)
(let lp ((next (read)))
(cond
((eof-object? next) #f)
(else
(local-eval next local-env)
(lp (read))))))
;; Error handler to display any errors while evaluating the template
(define (error-handler key subr message args . rest)
(display "<p>")
(display (_ "An error occurred when processing the template:"))
(display "<br><pre>")
(display "<br/><pre>")
(display
(escape-html
(with-output-to-string
(lambda ()
(display-error #f (current-output-port) subr message args rest)))))
; Find out how many frames are interesting. From the
; good-stack, all but the bottom two frames are in
; error-stack as well, so we can remove the top #good - 2
; right away. Below that, there is still one frame in error
; stack, the call to local-eval, which we'll remove as well.
; So (#good - 2) + 1 == #good - 1 to remove from the top.
; We remove the bottom three frames as well: the pre-unwind
; handler, make-trace and one frame inside make-trace.
(let* ((remove-top (- (stack-length good-stack) 1))
(remove-bottom 3)
(error-length (stack-length error-stack)))
; Show the backtrace. Remove one extra from the "first"
; argument, since that is an index, not a count.
(display-backtrace error-stack
(current-output-port)
(- (- error-length remove-top) 1)
(- (- error-length remove-top) remove-bottom)))
(display "</pre><br>"))
(gnc:html-string-sanitize
(with-output-to-string
(lambda ()
(display-backtrace error-stack (current-output-port))
(newline)
(display-error #f (current-output-port) subr message args rest)))))
(display "</pre><br/>"))
; This handler will be called by catch before unwinding the
; stack, so we can capture it. The above handler will then be called
; to actually handle the exception. This technique is based on the
; example in the guile manual. See:
; https://www.gnu.org/software/guile/manual/html_node/Debug-on-Error.html
(define (pre-unwind-handler key . rest)
; Save the current stack. Note that this will include a couple of
; extra entries (this error handler, the call to make-stack and
; another one to gsubr-apply) which we'll cutt off at the display
; above.
(set! error-stack (make-stack #t))
; And throw the error again
(apply throw key rest))
;; Capture the stack here, cut the last 3 frames which are
;; make-stack, this one, and the throw handler.
(set! error-stack (make-stack #t 3)))
; Use two nested catches. The inner one is lazy and does not unwind,
; so it can catch th stack. The outer one does the real error
; handling.
(catch #t eval-input error-handler pre-unwind-handler))
; end of (script->output)

View File

@ -132,6 +132,7 @@
(gnc:html-document-set-style-text!
ssdoc
(string-append
"@media (prefers-color-scheme: dark) {body {color: #000; background-color: #fff;}}\n"
"h3 { " title-info " }\n"
"a { " account-link-info " }\n"
"body, p, table, tr, td { vertical-align: top; " text-cell-info " }\n"

View File

@ -336,11 +336,10 @@
;; usage: (gnc:monetaries-add monetary1 monetary2 ...)
;; output: a monetary object
(define (gnc:monetary+ . monetaries)
(let* ((coll (apply gnc:monetaries-add monetaries))
(list-of-monetaries (coll 'format gnc:make-gnc-monetary #f)))
(if (null? (cdr list-of-monetaries))
(car list-of-monetaries)
(throw "gnc:monetary+ expects 1 currency " (gnc:strify monetaries)))))
(let ((coll (apply gnc:monetaries-add monetaries)))
(match (coll 'format gnc:make-gnc-monetary #f)
((mon) mon)
(_ (throw "gnc:monetary+ expects 1 currency " (gnc:strify monetaries))))))
;; this function will scan through the account splitlist, building
;; a list of balances along the way at dates specified in dates-list.
@ -396,28 +395,26 @@
(() (reverse result))
((date . rest)
(define (before-date? s) (< (split->date s) date))
(define (after-date? s) (< date (split->date s)))
(match splits
;; end of splits, but still has dates. pad with last-result
;; until end of dates.
(() (lp '() rest (cons last-result result) last-result))
;; the next split is still before date.
((and (_ (? before-date?) . _) (head . tail))
(lp tail dates result (split->elt head)))
;; head split after date, accumulate previous result
(((? after-date?) . tail)
(lp splits rest (cons last-result result) last-result))
;; head split before date, next split after date, or end.
((head . tail)
(let ((next (and (pair? tail) (car tail))))
(cond
;; the next split is still before date.
((and next (< (split->date next) date))
(lp tail dates result (split->elt head)))
;; head split after date, accumulate previous result
((< date (split->date head))
(lp splits rest (cons last-result result) last-result))
;; head split before date, next split after date, or end.
(else
(let ((head-result (split->elt head)))
(lp tail rest (cons head-result result) head-result)))))))))))
(let ((head-result (split->elt head)))
(lp tail rest (cons head-result result) head-result))))))))
;; This works similar as above but returns a commodity-collector,
;; thus takes care of children accounts with different currencies.

View File

@ -1645,17 +1645,12 @@
) ;;end of let*
)
;; Recursively validate children if parent is not a tax account.
;; Don't check children if parent is valid.
;; Returns the Parent if a child or grandchild is valid.
;; Returns #t if account is tax related.
(define (validate accounts)
(filter (lambda (a)
(if (xaccAccountGetTaxRelated a)
#t
;; check children
(if (null? (validate (gnc-account-get-descendants a)))
#f
#t)))
#f))
accounts))
(define (generate-tax-schedule report-name
@ -1823,10 +1818,6 @@
)
selected-accounts-sorted-by-form-line-acct)
);; end of if
(if (not (null? children))
(make-form-line-acct-list children tax-year)
selected-accounts-sorted-by-form-line-acct
)
);; end let*
);; end lambda
accounts)
@ -1999,7 +1990,7 @@
(selected-accounts (if (not (null? user-sel-accnts))
valid-user-sel-accnts
(validate (reverse
(gnc-account-get-children-sorted
(gnc-account-get-descendants-sorted
(gnc-get-current-root-account))))))
(work-to-do 0)

View File

@ -22,6 +22,7 @@
(define-module (gnucash reports standard lot-viewer))
(use-modules (srfi srfi-1))
(use-modules (srfi srfi-11)) ;for let-values
(use-modules (ice-9 match))
(use-modules (gnucash utilities))
(use-modules (gnucash gnc-module))
@ -35,7 +36,7 @@
(define optname-from-date (N_ "Start Date"))
(define optname-to-date (N_ "End Date"))
(define optname-account (N_ "Account"))
(define optname-desc-filter (N_ "Desc Filter"))
(define optname-desc-filter "Description Filter")
(define txn-type-alist
(list (cons TXN-TYPE-NONE "None")
@ -133,6 +134,9 @@
(let ((title (gnc-lot-get-title lot)))
(if (string-null? title) "None" title)))
(define (lot->guid lot)
(string-take (gncLotReturnGUID lot) 8))
(define (to-cell elt)
(gnc:make-html-table-cell/markup "number-cell" elt))
@ -158,8 +162,9 @@
(else
(let ((table (gnc:make-html-table)))
(gnc:html-table-set-col-headers!
table `("Date" "Desc" "Type" ,@(map lot->title lots) "Non-APAR"))
(gnc:html-table-set-multirow-col-headers!
table `(("Date" "Desc" "Type" ,@(map lot->title lots) "Other Account")
(#f #f #f ,@(map lot->guid lots) #f)))
(gnc:html-table-append-row!
table `(#f "Document" #f ,@(map lot->document lots)))
@ -180,11 +185,8 @@
(() (map (compose to-cell list->text) (reverse (cons splits accum))))
((this-lot . rest-lots)
(define (in-lot? s) (member s (car lots-splits)))
(let lp1 ((splits splits) (next '()) (this '()))
(match splits
(() (lp rest-lots (cdr lots-splits) next (cons this accum)))
(((? in-lot? head) . tail) (lp1 tail next (cons head this)))
((head . tail) (lp1 tail (cons head next) this))))))))))
(let-values (((this next) (partition in-lot? splits)))
(lp rest-lots (cdr lots-splits) next (cons this accum)))))))))
(sort transactions (lambda (a b) (< (xaccTransOrder a b) 0))))
(gnc:html-table-append-row!

View File

@ -180,34 +180,15 @@
(cols-list (assq-ref cols-alist section)))
(count identity cols-list)))
(define columns-used-size 10)
(define (build-column-used options)
(define (opt-val section name)
(define (opt-val name)
(gnc:option-value
(gnc:lookup-option options section name)))
(define (make-set-col col-vector)
(let ((col 0))
(lambda (used? index)
(if used?
(begin
(vector-set! col-vector index col)
(set! col (+ col 1)))
(vector-set! col-vector index #f)))))
(let* ((col-vector (make-vector columns-used-size #f))
(set-col (make-set-col col-vector)))
(set-col (opt-val "Display Columns" date-header) 0)
(set-col (opt-val "Display Columns" due-date-header) 1)
(set-col (opt-val "Display Columns" reference-header) 2)
(set-col (opt-val "Display Columns" type-header) 3)
(set-col (opt-val "Display Columns" desc-header) 4)
(set-col (opt-val "Display Columns" sale-header) 5)
(set-col (opt-val "Display Columns" tax-header) 6)
(set-col (opt-val "Display Columns" debit-header) 7)
(set-col (opt-val "Display Columns" credit-header) 8)
(set-col (opt-val "Display Columns" balance-header) 9)
col-vector))
(gnc:lookup-option options "Display Columns" name)))
(list->vector
(map opt-val
(list date-header due-date-header reference-header type-header
desc-header sale-header tax-header debit-header credit-header
balance-header))))
(define (make-heading-list column-vector link-option acct-type)
(let ((heading-list '())
@ -251,8 +232,6 @@
(reverse heading-list)))
(define num-buckets 6)
(define (new-bucket-vector)
(make-vector num-buckets 0))
(define (sign-equal? a b)
(or (= 0 a b) (< 0 (* a b))))
@ -579,39 +558,39 @@
;; each invoice payment split's peer splits are analysed.
(let lp1 ((lot-txn-splits (xaccTransGetSplitList lot-txn))
(non-APAR '())
(non-document '())
(result result))
(cond
;; finished. loop up, adding single row with non-APAR
;; finished. loop up, adding single row with non-document
((null? lot-txn-splits)
(lp (cdr lot-splits)
(if (null? non-APAR)
(if (null? non-document)
result
(cons (make-link-data
(qof-print-date (xaccTransGetDate lot-txn))
(split->reference lot-split)
(split->type-str lot-split)
(splits->desc non-APAR)
(splits->desc non-document)
(gnc:make-html-text (split->anchor lot-split #t))
(list->cell
(map (lambda (s) (split->anchor s #f)) non-APAR))
(map (lambda (s) (split->anchor s #f)) non-document))
(gncTransGetGUID lot-txn))
result))))
;; this payment peer is non-APAR, accumulate it.
;; this payment peer is non-document, accumulate it.
((not (memv (xaccAccountGetType
(xaccSplitGetAccount (car lot-txn-splits)))
(list ACCT-TYPE-RECEIVABLE ACCT-TYPE-PAYABLE)))
(lp1 (cdr lot-txn-splits)
(cons (car lot-txn-splits) non-APAR)
(cons (car lot-txn-splits) non-document)
result))
;; this payment's peer split has same sign as the
;; payment split. ignore.
((sign-equal? (xaccSplitGetAmount (car lot-txn-splits))
(xaccSplitGetAmount lot-split))
(lp1 (cdr lot-txn-splits) non-APAR result))
(lp1 (cdr lot-txn-splits) non-document result))
;; this payment's peer APAR split is a document lot
;; reducing split.
@ -622,7 +601,7 @@
(xaccSplitGetParent posting-split)))
(posting-txn (xaccSplitGetParent posting-split)))
(lp1 (cdr lot-txn-splits)
non-APAR
non-document
(cons (make-link-data
(qof-print-date (xaccTransGetDate posting-txn))
(split->reference posting-split)
@ -639,19 +618,9 @@
(else
(gnc:warn (car lot-txn-splits) " in APAR but can't find "
"owner; is likely an old-style link transaction.")
(let* ((lot-txn-split (car lot-txn-splits))
(posting-txn (xaccSplitGetParent lot-txn-split)))
(lp1 (cdr lot-txn-splits)
non-APAR
(cons (make-link-data
(qof-print-date (xaccTransGetDate posting-txn))
(split->reference lot-txn-split)
(split->type-str lot-txn-split)
(splits->desc (list lot-txn-split))
(gnc:make-html-text (split->anchor lot-txn-split #t))
(gnc:make-html-text (split->anchor lot-txn-split #t))
(gncTransGetGUID posting-txn))
result))))))))))))
(lp1 (cdr lot-txn-splits)
(cons (car lot-txn-splits) non-document)
result))))))))))

View File

@ -54,8 +54,8 @@ if (HAVE_SRFI64)
FALSE
)
gnc_add_scheme_tests("${scm_test_with_textual_ports_SOURCES}")
endif (HAVE_TEXT_PORTS)
endif (HAVE_SRFI64)
endif()
endif()
gnc_add_scheme_tests("${scm_test_reports_standard_SOURCES}")

View File

@ -72,7 +72,7 @@ if (HAVE_SRFI64)
)
gnc_add_scheme_tests("${test_app_utils_scheme_SRFI64_SOURCES}")
endif ()
endif()
# Doesn't work yet:
gnc_add_test_with_guile(test-app-utils "${test_app_utils_SOURCES}" APP_UTILS_TEST_INCLUDE_DIRS APP_UTILS_TEST_LIBS)

View File

@ -32,7 +32,7 @@ if (WITH_SQL)
set(WINSOCK_LIB "")
if(MINGW64)
set(WINSOCK_LIB "-lws2_32")
endif(MINGW64)
endif()
target_link_libraries(gncmod-backend-dbi gnc-backend-sql gnc-engine ${GTK2_LDFLAGS} ${Boost_REGEX_LIBRARY} ${LIBDBI_LIBRARY} ${WINSOCK_LIB})
target_compile_definitions(gncmod-backend-dbi PRIVATE -DG_LOG_DOMAIN=\"gnc.backend.dbi\")
@ -48,4 +48,4 @@ if (WITH_SQL)
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}/gnucash
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
# No headers to install
endif(WITH_SQL)
endif()

View File

@ -81,4 +81,4 @@ if(WITH_SQL)
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
# No headers to install
endif(WITH_SQL)
endif()

View File

@ -24,4 +24,4 @@ if(WITH_SQL)
BACKEND_SQL_TEST_INCLUDE_DIRS BACKEND_SQL_TEST_LIBS
)
target_compile_definitions(test-sqlbe PRIVATE TESTPROG=test_sqlbe)
endif(WITH_SQL)
endif()

View File

@ -112,7 +112,7 @@ target_compile_definitions (gncmod-backend-xml PRIVATE -DG_LOG_DOMAIN=\"gnc.back
set(LIB_DIR ${CMAKE_INSTALL_LIBDIR}/gnucash)
if (WIN32)
set(LIB_DIR ${CMAKE_INSTALL_BINDIR})
endif(WIN32)
endif()
if (APPLE)

View File

@ -25,7 +25,7 @@ endif()
if (MAC_INTEGRATION)
target_compile_options(test-userdata-dir PRIVATE ${OSX_EXTRA_COMPILE_FLAGS})
target_compile_definitions(test-userdata-dir PRIVATE ${GTK_MAC_CFLAGS_OTHER})
endif(MAC_INTEGRATION)
endif()
set(gtest_core_utils_INCLUDES
${MODULEPATH}

View File

@ -38,7 +38,7 @@ if (NOT ${MAKEINFO} STREQUAL "MAKEINFO-NOTFOUND")
COMMAND ${MAKEINFO} -I ${TEXI_BINARY_DIR} ${TEXI_SOURCE_FILE}
DEPENDS ${gnucash_design_TEXINFOS}
)
endif (NOT ${MAKEINFO} STREQUAL "MAKEINFO-NOTFOUND")
endif()
dist_add_generated (${BUILDING_FROM_VCS} gnucash-design.info)
set_dist_list(doc_design_DIST CMakeLists.txt gnucash-design.texi ${gnucash_design_TEXINFOS})

View File

@ -265,7 +265,7 @@ set(engine_EXTRA_DIST
if (NOT WIN32)
list(APPEND engine_EXTRA_DIST qof-win32.cpp)
endif (NOT WIN32)
endif()
set_local_dist(engine_DIST_local CMakeLists.txt ${engine_SOURCES} ${engine_HEADERS}
${engine_noinst_HEADERS} ${engine_EXTRA_DIST})
set(engine_DIST ${engine_DIST_local} ${engine_test_core_DIST} ${test_engine_DIST} PARENT_SCOPE)

View File

@ -118,7 +118,7 @@ if (WIN32)
${MODULEPATH}/qof-win32.cpp
../../../borrowed/libc/strptime.c
)
endif (WIN32)
endif()
set(test_gnc_guid_SOURCES
${MODULEPATH}/guid.cpp

View File

@ -155,7 +155,7 @@
(cons 'N497 #(not-impl "Sched C-EZ" "Schedule C-EZ" 1 #t ""))
(cons 'N498 #(not-impl "Sched C-EZ" "Spouse" 0 #t "" ((1992 ""))))
(cons 'N501 #(not-impl "Sched C-EZ" "Principal business/prof" 2 #t "" ((1992 "A"))))
(cons 'N499 #(none "Sched C-EZ" "Gross receipts" 1 #t "" ((2012 "1") (2011 "1b") (1992 "1"))))
(cons 'N499 #(none "Sched C-EZ" "Gross receipts" 1 #t "" ((2012 "1") (2011 "1b") (1992 "1")) 2018))
(cons 'N320 #(not-impl "Sched D" "Schedule D" 1 #f ""))
(cons 'N321 #(not-impl "Form 8949 Copy A" "Short Term gain/loss - security" 5 #f "" ((2013 "Part I, 1") (2011 "1") (1993 "Sched D, line 1") (1991 "Sched D, line 1a") (1986 "Sched D, line 2a") (1985 "Sched D, line 1b") (1980 "Sched D, line 1"))))

View File

@ -91,7 +91,7 @@ function(make_gnucash_potfiles)
AND
NOT ${path} MATCHES "/[.][^/]*$")
list (APPEND GOOD_FILES ${path})
endif ()
endif()
endforeach (path)
# Remove the paths that we have marked as explicitly skipped
@ -142,7 +142,7 @@ if(BUILDING_FROM_VCS)
if (${XGETTEXT} STREQUAL "XGETTEXT-NOTFOUND")
message(FATAL_ERROR "Can't find the 'xgettext' program.")
endif ()
endif()
add_custom_command(OUTPUT gnucash.pot
COMMAND ${CMAKE_COMMAND}