CMakeLists.txt (gnucash-5.0.tar.bz2) | : | CMakeLists.txt (gnucash-5.1.tar.bz2) | ||
---|---|---|---|---|
# CMakeLists.txt for GnuCash | # CMakeLists.txt for GnuCash | |||
cmake_minimum_required (VERSION 3.10) | cmake_minimum_required (VERSION 3.10) | |||
if (CMAKE_VERSION VERSION_GREATER_EQUAL 3.14.0) | if (CMAKE_VERSION VERSION_GREATER_EQUAL 3.14.0) | |||
cmake_policy(SET CMP0082 NEW) | cmake_policy(SET CMP0082 NEW) | |||
endif() | endif() | |||
project (gnucash | project (gnucash | |||
VERSION 5.0 | VERSION 5.1 | |||
) | ) | |||
enable_testing() | enable_testing() | |||
set (PACKAGE_NAME GnuCash) | set (PACKAGE_NAME GnuCash) | |||
set (PACKAGE_BUGREPORT "https://bugs.gnucash.org") | set (PACKAGE_BUGREPORT "https://bugs.gnucash.org") | |||
set (PACKAGE_STRING "${PACKAGE_NAME} ${PROJECT_VERSION}") | set (PACKAGE_STRING "${PACKAGE_NAME} ${PROJECT_VERSION}") | |||
set (PACKAGE_URL "https://www.gnucash.org/") | set (PACKAGE_URL "https://www.gnucash.org/") | |||
# Change this in development versions when changing anything that | # Change this in development versions when changing anything that | |||
skipping to change at line 292 | skipping to change at line 292 | |||
pkg_check_modules (GUILE3 guile-3.0 QUIET) | pkg_check_modules (GUILE3 guile-3.0 QUIET) | |||
pkg_check_modules (GUILE22 guile-2.2 QUIET) | pkg_check_modules (GUILE22 guile-2.2 QUIET) | |||
pkg_check_modules (GUILE2 guile-2.0>=2.0.9 QUIET) | pkg_check_modules (GUILE2 guile-2.0>=2.0.9 QUIET) | |||
if (GUILE3_FOUND) # found guile-3.0 | if (GUILE3_FOUND) # found guile-3.0 | |||
add_definitions (-DHAVE_GUILE30) | add_definitions (-DHAVE_GUILE30) | |||
set(HAVE_GUILE3 TRUE) | set(HAVE_GUILE3 TRUE) | |||
set(GUILE_EFFECTIVE_VERSION 3.0) | set(GUILE_EFFECTIVE_VERSION 3.0) | |||
set(GUILE_INCLUDE_DIRS ${GUILE3_INCLUDE_DIRS}) | set(GUILE_INCLUDE_DIRS ${GUILE3_INCLUDE_DIRS}) | |||
set(GUILE_LDFLAGS ${GUILE3_LDFLAGS}) | set(GUILE_LDFLAGS ${GUILE3_LDFLAGS}) | |||
find_program (GUILD_EXECUTABLE NAMES guild3.0 guild) | pkg_get_variable (GUILD_EXECUTABLE guile-3.0 guild) | |||
pkg_get_variable (GUILE_EXECUTABLE guile-3.0 guile) | ||||
if (NOT GUILD_EXECUTABLE) | ||||
find_program (GUILD_EXECUTABLE NAMES guild3.0 guild) | ||||
endif() | ||||
if (NOT GUILD_EXECUTABLE) | if (NOT GUILD_EXECUTABLE) | |||
message (SEND_ERROR "The guild executable was not found, but is required. Pl ease set GUILD_EXECUTABLE.") | message (SEND_ERROR "The guild executable was not found, but is required. Pl ease set GUILD_EXECUTABLE.") | |||
endif() | endif() | |||
message(STATUS "Using guile-3.0.x") | message(STATUS "Using guile-3.0.x") | |||
find_program (GUILE_EXECUTABLE NAMES guile3.0 guile) | if (NOT GUILE_EXECUTABLE) | |||
find_program (GUILE_EXECUTABLE NAMES guile3.0 guile) | ||||
endif() | ||||
elseif (GUILE22_FOUND) # found guile-2.2 | elseif (GUILE22_FOUND) # found guile-2.2 | |||
add_definitions (-DHAVE_GUILE22) | add_definitions (-DHAVE_GUILE22) | |||
set(HAVE_GUILE2 TRUE) | set(HAVE_GUILE2 TRUE) | |||
set(GUILE_EFFECTIVE_VERSION 2.2) | set(GUILE_EFFECTIVE_VERSION 2.2) | |||
set(GUILE_INCLUDE_DIRS ${GUILE22_INCLUDE_DIRS}) | set(GUILE_INCLUDE_DIRS ${GUILE22_INCLUDE_DIRS}) | |||
set(GUILE_LDFLAGS ${GUILE22_LDFLAGS}) | set(GUILE_LDFLAGS ${GUILE22_LDFLAGS}) | |||
find_program (GUILD_EXECUTABLE NAMES guild2.2 guild) | pkg_get_variable (GUILD_EXECUTABLE guile-2.2 guild) | |||
pkg_get_variable (GUILE_EXECUTABLE guile-2.2 guile) | ||||
if (NOT GUILD_EXECUTABLE) | ||||
find_program (GUILD_EXECUTABLE NAMES guild2.2 guild) | ||||
endif() | ||||
if (NOT GUILD_EXECUTABLE) | if (NOT GUILD_EXECUTABLE) | |||
message (SEND_ERROR "The guild executable was not found, but is required. Pl ease set GUILD_EXECUTABLE.") | message (SEND_ERROR "The guild executable was not found, but is required. Pl ease set GUILD_EXECUTABLE.") | |||
endif() | endif() | |||
message(STATUS "Using guile-2.2.x") | message(STATUS "Using guile-2.2.x") | |||
find_program (GUILE_EXECUTABLE NAMES guile2.2 guile) | if (NOT GUILE_EXECUTABLE) | |||
find_program (GUILE_EXECUTABLE NAMES guile2.2 guile) | ||||
endif() | ||||
elseif (GUILE2_FOUND) # found guile-2.0 | elseif (GUILE2_FOUND) # found guile-2.0 | |||
add_definitions (-DHAVE_GUILE20) | add_definitions (-DHAVE_GUILE20) | |||
set(HAVE_GUILE2 TRUE) | set(HAVE_GUILE2 TRUE) | |||
set(GUILE_EFFECTIVE_VERSION 2.0) | set(GUILE_EFFECTIVE_VERSION 2.0) | |||
set(GUILE_INCLUDE_DIRS ${GUILE2_INCLUDE_DIRS}) | set(GUILE_INCLUDE_DIRS ${GUILE2_INCLUDE_DIRS}) | |||
set(GUILE_LDFLAGS ${GUILE2_LDFLAGS}) | set(GUILE_LDFLAGS ${GUILE2_LDFLAGS}) | |||
find_program (GUILD_EXECUTABLE NAMES guild2.0 guild) | pkg_get_variable (GUILD_EXECUTABLE guile-2.0 guild) | |||
pkg_get_variable (GUILE_EXECUTABLE guile-2.0 guile) | ||||
if (NOT GUILD_EXECUTABLE) | ||||
find_program (GUILD_EXECUTABLE NAMES guild2.0 guild) | ||||
endif() | ||||
if (NOT GUILD_EXECUTABLE) | if (NOT GUILD_EXECUTABLE) | |||
message (SEND_ERROR "The guild executable was not found, but is required. Pl ease set GUILD_EXECUTABLE.") | message (SEND_ERROR "The guild executable was not found, but is required. Pl ease set GUILD_EXECUTABLE.") | |||
endif() | endif() | |||
message(STATUS "Using guile-2.0.x") | message(STATUS "Using guile-2.0.x") | |||
find_program (GUILE_EXECUTABLE NAMES guile2.0 guile) | if (NOT GUILE_EXECUTABLE) | |||
find_program (GUILE_EXECUTABLE NAMES guile2.0 guile) | ||||
endif() | ||||
else() | else() | |||
message (FATAL_ERROR "Neither guile 3.0, guile 2.2, nor guile 2.0 were found G nuCash can't run without one of them. Ensure that one is installed and can be fo und with pkg-config.") | message (FATAL_ERROR "Neither guile 3.0, guile 2.2, nor guile 2.0 were found G nuCash can't run without one of them. Ensure that one is installed and can be fo und with pkg-config.") | |||
endif() | endif() | |||
if (NOT GUILE_EXECUTABLE) | if (NOT GUILE_EXECUTABLE) | |||
message (SEND_ERROR "The guile executable was not found, but is required. Plea se set GUILE_EXECUTABLE.") | message (SEND_ERROR "The guile executable was not found, but is required. Plea se set GUILE_EXECUTABLE.") | |||
endif() | endif() | |||
# Test that guile has SRFI-64. This is required for some unit tests. | # Test that guile has SRFI-64. This is required for some unit tests. | |||
skipping to change at line 480 | skipping to change at line 498 | |||
message (SEND_ERROR "No libdbi drivers found, SQL tests will fail.") | message (SEND_ERROR "No libdbi drivers found, SQL tests will fail.") | |||
else() | else() | |||
get_filename_component(drivers_dir ${LIBDBI_DRIVERS} DIRECTORY) | get_filename_component(drivers_dir ${LIBDBI_DRIVERS} DIRECTORY) | |||
set(LIBDBI_DRIVERS_DIR ${drivers_dir} CACHE FILEPATH "Directory containing t he libdbi driver modules." FORCE) | set(LIBDBI_DRIVERS_DIR ${drivers_dir} CACHE FILEPATH "Directory containing t he libdbi driver modules." FORCE) | |||
endif() | endif() | |||
endif() | endif() | |||
# ############################################################ | # ############################################################ | |||
if (WITH_PYTHON) | if (WITH_PYTHON) | |||
find_package(PythonInterp 3) | set (PYTHON_MIN_VERSION 3.6.0) | |||
find_package(PythonInterp ${PYTHON_MIN_VERSION}) | ||||
if (NOT PYTHONINTERP_FOUND) | if (NOT PYTHONINTERP_FOUND) | |||
message(SEND_ERROR "Python support enabled, but Python interpreter not found .") | message(SEND_ERROR "Python support enabled, but Python interpreter not found .") | |||
endif() | endif() | |||
if (PYTHON_VERSION_STRING VERSION_LESS "3.2.0") | find_package(PythonLibs ${PYTHON_MIN_VERSION}) | |||
message(SEND_ERROR "Found python version ${PYTHON_VERSION_STRING}, but it's | ||||
too old. Need python >= 3.2.0") | ||||
endif() | ||||
find_package(PythonLibs 3) | ||||
if (NOT PYTHONLIBS_FOUND) | if (NOT PYTHONLIBS_FOUND) | |||
message(SEND_ERROR "Python support enabled, but Python libraries not found." ) | message(SEND_ERROR "Python support enabled, but Python libraries not found." ) | |||
endif() | endif() | |||
# Determine where to install the python libraries. | # Determine where to install the python libraries. | |||
execute_process( | execute_process( | |||
COMMAND ${PYTHON_EXECUTABLE} -c "from distutils import sysconfig; print(sysc onfig.get_python_lib(prefix='${CMAKE_INSTALL_PREFIX}', plat_specific=True))" | COMMAND ${PYTHON_EXECUTABLE} -c "from distutils import sysconfig; print(sysc onfig.get_python_lib(prefix='${CMAKE_INSTALL_PREFIX}', plat_specific=True))" | |||
RESULT_VARIABLE PYTHON_SYSCONFIG_RESULT | RESULT_VARIABLE PYTHON_SYSCONFIG_RESULT | |||
OUTPUT_VARIABLE PYTHON_SYSCONFIG_OUTPUT | OUTPUT_VARIABLE PYTHON_SYSCONFIG_OUTPUT | |||
ERROR_VARIABLE PYTHON_SYSCONFIG_ERROR | ERROR_VARIABLE PYTHON_SYSCONFIG_ERROR | |||
skipping to change at line 770 | skipping to change at line 785 | |||
if (APPLE) | if (APPLE) | |||
# FIXME: HANDLE gtk-mac-integration-gtk2 | # FIXME: HANDLE gtk-mac-integration-gtk2 | |||
set(GNC_PLATFORM_DARWIN 1) | set(GNC_PLATFORM_DARWIN 1) | |||
set(GNC_PLATFORM_OSX 1) | set(GNC_PLATFORM_OSX 1) | |||
set(PLATFORM_OSX 1) | set(PLATFORM_OSX 1) | |||
set(HAVE_OSX_KEYCHAIN 1) | set(HAVE_OSX_KEYCHAIN 1) | |||
endif() | endif() | |||
string(REGEX MATCH "^([0-9]+)\.([0-9]+)" GLIB_MIN_MATCH ${GLIB_MIN_VERSION}) | string(REGEX MATCH "^([0-9]+)\.([0-9]+)" GLIB_MIN_MATCH ${GLIB_MIN_VERSION}) | |||
set(GLIB_API ${CMAKE_MATCH_1}_${CMAKE_MATCH_2}) | set(GLIB_API ${CMAKE_MATCH_1}_${CMAKE_MATCH_2}) | |||
target_compile_definitions(PkgConfig::GLIB2 INTERFACE | set_property(TARGET PkgConfig::GLIB2 PROPERTY INTERFACE_COMPILE_DEFINITIONS | |||
GLIB_VERSION_MIN_REQUIRED=GLIB_VERSION_${GLIB_API} | GLIB_VERSION_MIN_REQUIRED=GLIB_VERSION_${GLIB_API} | |||
GLIB_VERSION_MAX_ALLOWED=GLIB_VERSION_${GLIB_API}) | GLIB_VERSION_MAX_ALLOWED=GLIB_VERSION_${GLIB_API}) | |||
string(REGEX MATCH "^([0-9]+)\.([0-9]+)" GTK_MIN_MATCH ${GTK_MIN_VERSION}) | string(REGEX MATCH "^([0-9]+)\.([0-9]+)" GTK_MIN_MATCH ${GTK_MIN_VERSION}) | |||
set(GTK_API ${CMAKE_MATCH_1}_${CMAKE_MATCH_2}) | set(GTK_API ${CMAKE_MATCH_1}_${CMAKE_MATCH_2}) | |||
target_compile_definitions(PkgConfig::GTK3 INTERFACE | set_property(TARGET PkgConfig::GTK3 PROPERTY INTERFACE_COMPILE_DEFINITIONS | |||
GDK_VERSION_MIN_REQUIRED=GDK_VERSION_${GTK_API} | GDK_VERSION_MIN_REQUIRED=GDK_VERSION_${GTK_API} | |||
GDK_VERSION_MAX_ALLOWED=GDK_VERSION_${GTK_API}) | GDK_VERSION_MAX_ALLOWED=GDK_VERSION_${GTK_API}) | |||
add_definitions (-DHAVE_CONFIG_H) | add_definitions (-DHAVE_CONFIG_H) | |||
set (CONFIG_H ${CMAKE_CURRENT_BINARY_DIR}/common/config.h) | set (CONFIG_H ${CMAKE_CURRENT_BINARY_DIR}/common/config.h) | |||
configure_file (${CMAKE_CURRENT_SOURCE_DIR}/common/config.h.cmake.in ${CONFIG_H} ) | configure_file (${CMAKE_CURRENT_SOURCE_DIR}/common/config.h.cmake.in ${CONFIG_H} ) | |||
# The subdirectories | # The subdirectories | |||
add_subdirectory (borrowed) | add_subdirectory (borrowed) | |||
add_subdirectory (data) | add_subdirectory (data) | |||
add_subdirectory (doc) | add_subdirectory (doc) | |||
End of changes. 11 change blocks. | ||||
18 lines changed or deleted | 32 lines changed or added |