2018-03-17 19:25:39 -05:00
|
|
|
# NB: Unit tests which require GSchemas should be made conditional on COMPILE_GSCHEMAS.
|
2018-05-03 16:18:15 -05:00
|
|
|
add_subdirectory(test)
|
2015-12-07 11:17:08 -06:00
|
|
|
# Build the library
|
|
|
|
|
2018-05-03 16:18:15 -05:00
|
|
|
set (app_utils_noinst_HEADERS
|
2015-12-07 11:17:08 -06:00
|
|
|
calculation/finvar.h
|
|
|
|
calculation/finproto.h
|
|
|
|
calculation/fin_spl_protos.h
|
|
|
|
calculation/fin_static_proto.h
|
|
|
|
)
|
2010-03-14 16:01:32 -05:00
|
|
|
|
2018-05-03 16:18:15 -05:00
|
|
|
set (app_utils_HEADERS
|
2011-01-27 13:22:16 -06:00
|
|
|
QuickFill.h
|
2015-12-07 11:17:08 -06:00
|
|
|
business-options.h
|
2010-03-14 16:01:32 -05:00
|
|
|
file-utils.h
|
|
|
|
gfec.h
|
|
|
|
gnc-basic-gobject.h
|
|
|
|
gnc-account-merge.h
|
|
|
|
gnc-accounting-period.h
|
2011-02-10 15:49:12 -06:00
|
|
|
gnc-addr-quickfill.h
|
2010-03-14 16:01:32 -05:00
|
|
|
gnc-component-manager.h
|
2011-01-27 13:22:16 -06:00
|
|
|
gnc-entry-quickfill.h
|
2010-03-14 16:10:26 -05:00
|
|
|
gnc-euro.h
|
2010-03-14 16:01:32 -05:00
|
|
|
gnc-exp-parser.h
|
2015-12-07 11:17:08 -06:00
|
|
|
gnc-gsettings.h
|
2010-03-14 16:01:32 -05:00
|
|
|
gnc-help-utils.h
|
|
|
|
gnc-helpers.h
|
2015-12-07 11:17:08 -06:00
|
|
|
gnc-prefs-utils.h
|
|
|
|
gnc-state.h
|
2010-03-14 16:01:32 -05:00
|
|
|
gnc-sx-instance-model.h
|
2010-03-14 16:10:26 -05:00
|
|
|
gnc-ui-util.h
|
2011-08-25 02:57:55 -05:00
|
|
|
gnc-ui-balances.h
|
2010-03-14 16:01:32 -05:00
|
|
|
option-util.h
|
|
|
|
)
|
|
|
|
|
2018-01-29 11:54:13 -06:00
|
|
|
# Command to generate the swig-app-utils-guile.c wrapper file
|
|
|
|
gnc_add_swig_guile_command (swig-apputils-guile-c
|
|
|
|
SWIG_APP_UTILS_GUILE_C swig-app-utils-guile.c
|
2019-09-30 15:31:46 -05:00
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/app-utils.i ""
|
2018-01-29 11:54:13 -06:00
|
|
|
)
|
2017-02-01 21:48:46 -06:00
|
|
|
|
2018-01-29 11:54:13 -06:00
|
|
|
# Command to generate the swig-app-utils-python.c wrapper file
|
2018-01-29 11:04:08 -06:00
|
|
|
gnc_add_swig_python_command (swig-app-utils-python
|
|
|
|
SWIG_APP_UTILS_PYTHON_C SWIG_APP_UTILS_PYTHON_PY
|
|
|
|
swig-app-utils-python.c sw_app_utils.py
|
2019-09-30 15:31:46 -05:00
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/app-utils.i ""
|
2018-01-29 11:04:08 -06:00
|
|
|
)
|
|
|
|
|
2018-05-03 16:18:15 -05:00
|
|
|
set (app_utils_SOURCES
|
2012-03-13 08:18:51 -05:00
|
|
|
calculation/expression_parser.c
|
|
|
|
calculation/fin.c
|
2015-12-07 11:17:08 -06:00
|
|
|
business-options.c
|
2011-01-27 13:22:16 -06:00
|
|
|
QuickFill.c
|
2010-03-14 16:01:32 -05:00
|
|
|
file-utils.c
|
|
|
|
gfec.c
|
|
|
|
gnc-account-merge.c
|
|
|
|
gnc-accounting-period.c
|
2011-02-10 15:49:12 -06:00
|
|
|
gnc-addr-quickfill.c
|
2010-03-14 16:01:32 -05:00
|
|
|
gnc-component-manager.c
|
2011-01-27 13:22:16 -06:00
|
|
|
gnc-entry-quickfill.c
|
2010-03-14 16:10:26 -05:00
|
|
|
gnc-euro.c
|
2010-03-14 16:01:32 -05:00
|
|
|
gnc-exp-parser.c
|
2015-12-07 11:17:08 -06:00
|
|
|
gnc-gsettings.c
|
2010-03-14 16:01:32 -05:00
|
|
|
gnc-helpers.c
|
2015-12-07 11:17:08 -06:00
|
|
|
gnc-prefs-utils.c
|
2010-03-14 16:01:32 -05:00
|
|
|
gnc-sx-instance-model.c
|
2015-12-07 11:17:08 -06:00
|
|
|
gnc-state.c
|
2010-03-14 16:10:26 -05:00
|
|
|
gnc-ui-util.c
|
2011-08-25 02:57:55 -05:00
|
|
|
gnc-ui-balances.c
|
2010-03-14 16:01:32 -05:00
|
|
|
gncmod-app-utils.c
|
|
|
|
option-util.c
|
|
|
|
)
|
|
|
|
|
2018-05-03 16:18:15 -05:00
|
|
|
set_source_files_properties (${app_utils_SOURCES} PROPERTIES OBJECT_DEPENDS ${CONFIG_H})
|
2015-12-07 11:17:08 -06:00
|
|
|
|
2018-05-03 16:18:15 -05:00
|
|
|
set(app_utils_ALL_SOURCES ${app_utils_SOURCES} ${app_utils_HEADERS} ${app_utils_noinst_HEADERS})
|
2019-10-01 04:57:56 -05:00
|
|
|
set(app_utils_ALL_LIBRARIES
|
|
|
|
gncmod-engine
|
|
|
|
gnc-module
|
|
|
|
gnucash-guile
|
|
|
|
${GIO_LDFLAGS}
|
|
|
|
${LIBXML2_LDFLAGS}
|
|
|
|
${LIBXSLT_LDFLAGS})
|
|
|
|
set(app_utils_ALL_INCLUDES
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/calculation
|
|
|
|
${GIO_INCLUDE_DIRS}
|
|
|
|
${LIBXML2_INCLUDE_DIRS}
|
|
|
|
${LIBXSLT_INCLUDE_DIRS}
|
|
|
|
${CMAKE_SOURCE_DIR}/libgnucash/backend
|
|
|
|
${CMAKE_SOURCE_DIR}/libgnucash/engine)
|
2015-12-07 11:17:08 -06:00
|
|
|
|
2018-05-03 16:18:15 -05:00
|
|
|
if (WIN32)
|
|
|
|
list(APPEND app_utils_ALL_SOURCES gnc-help-utils.c)
|
|
|
|
list(APPEND app_utils_ALL_LIBRARIES ${HTMLHELP_LIBRARY})
|
|
|
|
list(APPEND app_utils_ALL_INCLUDES ${HTMLHELP_INCLUDE_PATH})
|
|
|
|
endif()
|
2015-12-07 11:17:08 -06:00
|
|
|
|
2017-02-01 21:48:46 -06:00
|
|
|
|
2018-05-03 16:18:15 -05:00
|
|
|
add_library (gncmod-app-utils ${app_utils_ALL_SOURCES} ${SWIG_APP_UTILS_GUILE_C})
|
|
|
|
target_link_libraries(gncmod-app-utils ${app_utils_ALL_LIBRARIES})
|
2015-12-07 11:17:08 -06:00
|
|
|
|
2018-05-03 16:18:15 -05:00
|
|
|
target_include_directories (gncmod-app-utils
|
2015-12-07 11:17:08 -06:00
|
|
|
PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}
|
2016-08-26 13:59:33 -05:00
|
|
|
PRIVATE ${app_utils_ALL_INCLUDES}
|
2015-12-07 11:17:08 -06:00
|
|
|
)
|
2018-05-03 16:18:15 -05:00
|
|
|
target_compile_definitions (gncmod-app-utils PRIVATE -DG_LOG_DOMAIN=\"gnc.app-utils\")
|
2015-12-07 11:17:08 -06:00
|
|
|
|
2018-05-03 16:18:15 -05:00
|
|
|
if (APPLE)
|
|
|
|
set_target_properties (gncmod-app-utils PROPERTIES INSTALL_NAME_DIR "${CMAKE_INSTALL_FULL_LIBDIR}/gnucash")
|
|
|
|
endif()
|
2017-10-15 15:22:29 -05:00
|
|
|
|
2018-05-03 16:18:15 -05:00
|
|
|
install(TARGETS gncmod-app-utils
|
2017-11-28 16:25:35 -06:00
|
|
|
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}/gnucash
|
|
|
|
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}/gnucash
|
|
|
|
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
|
2015-12-07 11:17:08 -06:00
|
|
|
)
|
2016-08-26 13:59:33 -05:00
|
|
|
|
2018-05-03 16:18:15 -05:00
|
|
|
if (WITH_PYTHON)
|
|
|
|
set(PYEXEC_FILES sw_app_utils.py)
|
|
|
|
add_library (sw_app_utils MODULE ${SWIG_APP_UTILS_PYTHON_C})
|
2016-08-26 13:59:33 -05:00
|
|
|
|
2018-05-03 16:18:15 -05:00
|
|
|
target_link_libraries(sw_app_utils gncmod-app-utils ${app_utils_ALL_LIBRARIES} ${PYTHON_LIBRARIES})
|
|
|
|
set_target_properties(sw_app_utils PROPERTIES PREFIX "_")
|
2018-05-09 10:20:13 -05:00
|
|
|
if (HAVE_STRINGOP_TRUNCATION)
|
|
|
|
target_compile_options(sw_app_utils PRIVATE -Wno-error=stringop-truncation)
|
|
|
|
endif()
|
2016-08-26 13:59:33 -05:00
|
|
|
|
2018-05-03 16:18:15 -05:00
|
|
|
target_include_directories (sw_app_utils
|
2016-08-26 13:59:33 -05:00
|
|
|
PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}
|
|
|
|
PRIVATE ${app_utils_ALL_INCLUDES} ${PYTHON_INCLUDE_DIRS}
|
|
|
|
)
|
2018-05-03 16:18:15 -05:00
|
|
|
target_compile_definitions (sw_app_utils PRIVATE -DG_LOG_DOMAIN=\"gnc.app-utils\")
|
2016-08-26 13:59:33 -05:00
|
|
|
|
2018-05-03 16:18:15 -05:00
|
|
|
if (APPLE)
|
|
|
|
set_target_properties (sw_app_utils PROPERTIES INSTALL_NAME_DIR "${CMAKE_INSTALL_FULL_LIBDIR}/gnucash")
|
|
|
|
endif()
|
2017-10-15 15:22:29 -05:00
|
|
|
|
2018-05-03 16:18:15 -05:00
|
|
|
install(TARGETS sw_app_utils
|
2018-03-18 13:59:13 -05:00
|
|
|
LIBRARY DESTINATION ${PYTHON_SYSCONFIG_OUTPUT}/gnucash
|
|
|
|
ARCHIVE DESTINATION ${PYTHON_SYSCONFIG_OUTPUT}/gnucash
|
2016-08-26 13:59:33 -05:00
|
|
|
)
|
2018-03-18 13:59:13 -05:00
|
|
|
|
2018-05-03 16:18:15 -05:00
|
|
|
add_custom_target(sw-app-utils-py ALL
|
2018-03-18 13:59:13 -05:00
|
|
|
COMMAND ${CMAKE_COMMAND} -E copy ${SWIG_APP_UTILS_PYTHON_PY} ${PYTHON_SYSCONFIG_BUILD}/gnucash
|
|
|
|
DEPENDS ${SWIG_APP_UTILS_PYTHON_C})
|
|
|
|
|
2018-05-03 16:18:15 -05:00
|
|
|
add_custom_target(sw-app-utils-build ALL
|
2018-03-18 13:59:13 -05:00
|
|
|
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR_BUILD}/gnucash/_sw_app_utils${CMAKE_SHARED_MODULE_SUFFIX} ${PYTHON_SYSCONFIG_BUILD}/gnucash
|
|
|
|
DEPENDS sw_app_utils)
|
2016-08-26 13:59:33 -05:00
|
|
|
|
2018-05-03 16:18:15 -05:00
|
|
|
endif()
|
2016-08-26 13:59:33 -05:00
|
|
|
|
|
|
|
|
2015-12-07 11:17:08 -06:00
|
|
|
|
2018-05-03 16:18:15 -05:00
|
|
|
install(FILES ${app_utils_HEADERS} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/gnucash)
|
2015-12-07 11:17:08 -06:00
|
|
|
|
|
|
|
# And now handle scheme files
|
|
|
|
|
2018-05-03 16:18:15 -05:00
|
|
|
set (app_utils_SCHEME_1
|
2015-12-07 11:17:08 -06:00
|
|
|
business-options.scm
|
2019-06-08 11:04:50 -05:00
|
|
|
business-prefs.scm
|
2015-12-07 11:17:08 -06:00
|
|
|
c-interface.scm
|
|
|
|
date-utilities.scm
|
|
|
|
options.scm
|
2018-02-19 12:25:50 -06:00
|
|
|
fin.scm
|
2015-12-07 11:17:08 -06:00
|
|
|
)
|
|
|
|
|
2019-06-08 11:04:50 -05:00
|
|
|
set (app_utils_SCHEME_2
|
|
|
|
app-utils.scm
|
2015-12-07 11:17:08 -06:00
|
|
|
)
|
|
|
|
|
2018-05-03 16:18:15 -05:00
|
|
|
set(GUILE_DEPENDS
|
2018-02-18 17:59:00 -06:00
|
|
|
gncmod-app-utils
|
|
|
|
scm-core-utils
|
|
|
|
scm-engine
|
|
|
|
scm-gnc-module
|
|
|
|
)
|
2015-12-07 11:17:08 -06:00
|
|
|
|
2018-05-03 16:18:15 -05:00
|
|
|
gnc_add_scheme_targets(scm-app-utils-1
|
2015-12-07 11:17:08 -06:00
|
|
|
"${app_utils_SCHEME_1}"
|
2019-06-08 11:04:50 -05:00
|
|
|
"gnucash/app-utils"
|
2019-11-10 11:15:34 -06:00
|
|
|
"${GUILE_DEPENDS}"
|
2019-06-08 11:04:50 -05:00
|
|
|
TRUE
|
2015-12-07 11:17:08 -06:00
|
|
|
)
|
|
|
|
|
2018-05-03 16:18:15 -05:00
|
|
|
gnc_add_scheme_targets(scm-app-utils-2
|
2015-12-07 11:17:08 -06:00
|
|
|
"${app_utils_SCHEME_2}"
|
|
|
|
"gnucash"
|
2018-02-19 12:25:50 -06:00
|
|
|
"scm-app-utils-1"
|
2015-12-07 11:17:08 -06:00
|
|
|
FALSE
|
|
|
|
)
|
|
|
|
|
2019-06-15 09:12:25 -05:00
|
|
|
# Module interfaces deprecated in 4.x, will be removed for 5.x
|
|
|
|
gnc_add_scheme_deprecated_module ("migrate-prefs" "" "" "")
|
|
|
|
gnc_add_scheme_deprecated_module ("migrate-prefs-user" "" "" "")
|
2019-11-10 11:15:34 -06:00
|
|
|
gnc_add_scheme_deprecated_module ("gnucash gettext" "gnucash core-utils" "scm-core-utils" "")
|
2019-06-15 09:12:25 -05:00
|
|
|
|
2019-11-10 11:15:34 -06:00
|
|
|
add_custom_target(scm-app-utils ALL DEPENDS scm-app-utils-2 scm-app-utils-1)
|
2017-02-01 21:48:46 -06:00
|
|
|
|
2018-05-03 16:18:15 -05:00
|
|
|
set_local_dist(app_utils_DIST_local
|
2019-11-10 11:15:34 -06:00
|
|
|
${app_utils_ALL_SOURCES} ${app_utils_SCHEME_1} ${app_utils_SCHEME_2} ${app_utils_SCHEME_3}
|
2019-06-08 08:54:41 -05:00
|
|
|
app-utils.i CMakeLists.txt gnc-help-utils.c README)
|
2018-05-03 16:18:15 -05:00
|
|
|
set(app_utils_DIST ${app_utils_DIST_local} ${test_app_utils_DIST} PARENT_SCOPE)
|