CMake - remove parameter repetition in else() and endif() statements - part 2

This follows Professional CMake's recommended practises
I missed plenty of these in my first commit. This one should fix
these remaining occurrences.
This commit is contained in:
Geert Janssens
2020-02-06 16:16:31 +01:00
parent 7f794bb26b
commit 90e95ba8ef
25 changed files with 113 additions and 113 deletions

View File

@@ -109,7 +109,7 @@ if (MINGW)
if(${IS_MSYS2} GREATER_EQUAL 0)
set(MINGW64 ON)
endif()
endif(MINGW)
endif()
# Find a proper bash executable
@@ -183,13 +183,13 @@ 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(PkgConfig REQUIRED)
if (NOT PKG_CONFIG_FOUND)
message (SEND_ERROR "pkg-config not found, but is required")
endif (NOT PKG_CONFIG_FOUND)
endif()
if (CMAKE_VERSION VERSION_LESS 3.6)
include(GncPkgConfig)
@@ -213,7 +213,7 @@ if (WITH_GNUCASH)
_pkg_create_imp_target(WEBKIT)
endif()
set(WEBKIT1 1 CACHE INTERNAL "WebKitGtk")
else (WIN32 OR APPLE)
else()
If (NOT CMAKE_VERSION VERSION_LESS 3.6)
pkg_check_modules (WEBKIT IMPORTED_TARGET webkit2gtk-4.0)
else()
@@ -226,15 +226,15 @@ if (WITH_GNUCASH)
pkg_check_modules (WEBKIT REQUIRED webkit2gtk-3.0)
endif()
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()
endif()
if (CMAKE_VERSION VERSION_LESS 3.6)
_pkg_create_imp_target(WEBKIT)
endif()
endif (WIN32 OR APPLE)
endif()
if (NOT CMAKE_VERSION VERSION_LESS 3.6)
pkg_check_modules (GTK3 REQUIRED IMPORTED_TARGET gtk+-3.0>=3.10.0)
@@ -242,7 +242,7 @@ if (WITH_GNUCASH)
pkg_check_modules (GTK3 REQUIRED gtk+-3.0>=3.10.0)
_pkg_create_imp_target(GTK3)
endif()
endif (WITH_GNUCASH)
endif()
pkg_check_modules (ZLIB REQUIRED zlib)
@@ -252,7 +252,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)
@@ -262,7 +262,7 @@ 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)
@@ -271,25 +271,25 @@ find_library (REGEX_LIBRARY NAMES regex)
# I18N
if (ALLOW_OLD_GETTEXT)
find_package (Gettext REQUIRED)
else (ALLOW_OLD_GETTEXT)
else()
find_package (Gettext 0.20)
if (NOT GETTEXT_FOUND)
message (FATAL_ERROR "Note the build can be configured with an older version of gettext by setting ALLOW_OLD_GETTEXT=ON but then some files will not be translated:
- gnucash.desktop (requires at least gettext 0.19)
- gnucash.appdata.xml (requires at least gettext 0.19.6)
- tag developer_name from gnucash.appdata.xml (requires at least gettext 0.20)")
endif (NOT GETTEXT_FOUND)
endif (ALLOW_OLD_GETTEXT)
endif()
endif()
if (${GETTEXT_VERSION_STRING} VERSION_LESS 0.19)
message (WARNING "Got gettext version ${GETTEXT_VERSION_STRING}, however you need at least gettext version 0.19 in order to handle translation of the gnucash.desktop file. The build will be configured with an untranslated gnucash.desktop file.")
endif ()
endif()
if (${GETTEXT_VERSION_STRING} VERSION_LESS 0.19.6)
message (WARNING "Got gettext version ${GETTEXT_VERSION_STRING}, however you need at least gettext version 0.19.6 in order to handle translation of the gnucash.appdata file. The build will be configured with an untranslated gnucash.appdata file.")
endif ()
endif()
if (${GETTEXT_VERSION_STRING} VERSION_LESS 0.20)
message (WARNING "Got gettext version ${GETTEXT_VERSION_STRING}, however you need at least gettext version 0.20 in order to handle the translation of 'GnuCash Project' from the gnucash.appdata file. That message will be missing in gnucash.pot.")
endif ()
endif()
find_path (LIBINTL_INCLUDE_PATH NAMES libintl.h
PATHS /usr/include /opt/gnome/include)
@@ -300,7 +300,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()
# ############################################################
@@ -326,10 +326,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)
@@ -341,17 +341,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))"
@@ -362,7 +362,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))"
@@ -373,7 +373,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()
# ############################################################
if (WITH_AQBANKING)
@@ -384,17 +384,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>
@@ -421,7 +421,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)
@@ -441,9 +441,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})
@@ -454,10 +454,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})
@@ -473,10 +473,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.")
@@ -484,7 +484,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()
# ############################################################
@@ -524,7 +524,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)
@@ -551,9 +551,9 @@ find_package (Boost 1.54.0 REQUIRED COMPONENTS date_time regex locale filesystem
if (Boost_FOUND)
include_directories(${Boost_INCLUDE_DIRS})
set(HAVE_BOOST 1)
else (Boost_FOUND)
else()
message (SEND_ERROR "Boost 1.54.0 or later is not installed, and is required. Please install it and ensure that the following libraries are built: chrono, date_time, filesystem, log, program_options, regex, signals, system, and test.")
endif (Boost_FOUND)
endif()
# Compiler flags
@@ -588,16 +588,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 -std=gnu11 ${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")
@@ -675,9 +675,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)
@@ -702,17 +702,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)
@@ -725,7 +725,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)
@@ -751,11 +751,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
@@ -763,7 +763,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 2.46.0 OR GLIB2_VERSION VERSION_EQUAL 2.46.0)
set(HAVE_GLIB_2_46 1)
@@ -771,17 +771,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)
@@ -800,7 +800,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)
@@ -902,11 +902,11 @@ set(_MODULES gnc-core-utils gnc-module gnc-backend-xml-utils)
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}
@@ -960,6 +960,6 @@ endif()
if(UNIX)
set(CPACK_GENERATOR "TGZ")
endif(UNIX)
endif()
include (CPack)

View File

@@ -3,7 +3,7 @@ add_subdirectory(goffice)
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} ${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

@@ -34,11 +34,11 @@ function(gnc_add_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})
@@ -75,7 +75,7 @@ function(gnc_add_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}"
@@ -120,18 +120,18 @@ function(gnc_add_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)
@@ -143,7 +143,7 @@ function(gnc_add_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}
@@ -162,7 +162,7 @@ function(gnc_add_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})
install(FILES ${_TARGET_FILES} DESTINATION ${SCHEME_INSTALLED_CACHE_DIR}/${_OUTPUT_DIR})
install(FILES ${_SOURCE_FILES} DESTINATION ${SCHEME_INSTALLED_SOURCE_DIR}/${_OUTPUT_DIR})

View File

@@ -27,7 +27,7 @@ function(get_guile_env)
set(compiled_path "${LIBDIR_BUILD}/gnucash/scm/ccache/${GUILE_EFFECTIVE_VERSION}")
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}")
@@ -49,7 +49,7 @@ function(get_guile_env)
list(APPEND new_path ${load_item})
endforeach(load_item)
set(guile_load_path ${new_path})
endif (MINGW64)
endif()
if (WIN32 AND NOT MINGW64)
string(REPLACE ";" "\\\\;" GUILE_LOAD_PATH "${guile_load_path}")
else()

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

@@ -39,11 +39,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
@@ -62,7 +62,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 gncmod-report-gnome gnc-gnome gncmod-gnome-utils
@@ -111,7 +111,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.
@@ -238,7 +238,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})
@@ -254,7 +254,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

@@ -29,10 +29,10 @@ add_custom_command(
if (NOT have_mod_mask)
if (MAC_INTEGRATION)
add_definitions(-DGDK_MODIFIER_INTENT_DEFAULT_MOD_MASK=GDK_SHIFT_MASK|GDK_CONTROL_MASK|GDK_MOD1_MASK|GDK_MOD2_MASK|GDK_SUPER_MASK|GDK_HYPER_MASK|GDK_META_MASK)
else (MAC_INTEGRATION)
else()
add_definitions(-DGDK_MODIFIER_INTENT_DEFAULT_MOD_MASK=GDK_SHIFT_MASK|GDK_CONTROL_MASK|GDK_MOD1_MASK|GDK_SUPER_MASK|GDK_HYPER_MASK|GDK_META_MASK)
endif (MAC_INTEGRATION)
endif (NOT have_mod_mask)
endif()
endif()
set (gnome_utils_SOURCES
account-quickfill.c
@@ -220,12 +220,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

@@ -143,7 +143,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

@@ -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()
set_dist_list(html_DIST CMakeLists.txt ${html_HEADERS} ${html_SOURCES} gnc-html.i ${html_EXTRA_DIST})

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 migratable-prefs-aqbanking.xml
${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

@@ -15,7 +15,7 @@ gnc_add_test(test-link-qif-imp test-link.c QIF_IMP_TEST_INCLUDE_DIRS QIF_IMP_TES
if (HAVE_SRFI64)
gnc_add_scheme_tests("${scm_qifimp_test_with_srfi64_SOURCES}")
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

@@ -6,10 +6,10 @@ check_symbol_exists(GDK_MODIFIER_INTENT_DEFAULT_MOD_MASK gdk/gdktypes.h have_mod
if (NOT have_mod_mask)
if (MAC_INTEGRATION)
add_definitions(-DGDK_MODIFIER_INTENT_DEFAULT_MOD_MASK=GDK_SHIFT_MASK|GDK_CONTROL_MASK|GDK_MOD1_MASK|GDK_MOD2_MASK|GDK_SUPER_MASK|GDK_HYPER_MASK|GDK_META_MASK)
else (MAC_INTEGRATION)
else()
add_definitions(-DGDK_MODIFIER_INTENT_DEFAULT_MOD_MASK=GDK_SHIFT_MASK|GDK_CONTROL_MASK|GDK_MOD1_MASK|GDK_SUPER_MASK|GDK_HYPER_MASK|GDK_META_MASK)
endif(MAC_INTEGRATION)
endif(NOT have_mod_mask)
endif()
endif()
set (register_gnome_SOURCES
gncmod-register-gnome.c

View File

@@ -17,7 +17,7 @@ set(GUILE_DEPENDS
if (HAVE_SRFI64)
gnc_add_scheme_tests("${scm_test_business_reports_with_srfi64_SOURCES}")
endif (HAVE_SRFI64)
endif()
gnc_add_scheme_targets(scm-test-business-reports
"${scm_test_business_reports_SOURCES}"

View File

@@ -37,7 +37,7 @@ gnc_add_scheme_tests("${scm_test_report_system_SOURCES}")
if (HAVE_SRFI64)
gnc_add_scheme_tests ("${scm_test_report_system_with_srfi64_SOURCES}")
endif (HAVE_SRFI64)
endif()
gnc_add_scheme_targets(scm-test-report-system
"test-extras.scm"

View File

@@ -40,8 +40,8 @@ if (HAVE_SRFI64)
gnc_add_scheme_tests("${scm_test_with_srfi64_SOURCES}")
if (HAVE_TEXT_PORTS)
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_standard_reports_SOURCES}")

View File

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

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}