Revert "More conversions from pkg-config variables to imported targets."

This reverts commit 1a9fcfefad because
on MinGW cmake complains about the paths in pkgconfig files. This can
be addressed by using the MSYS2 cmake instead of the MINGW32 one, but
that requires some other changes... and there's also a path separator
bug in that version of FindPkgConfig.cmake.
This commit is contained in:
John Ralls
2019-09-21 15:28:09 -07:00
parent 980daeec83
commit b8b33b9591
37 changed files with 154 additions and 98 deletions

View File

@@ -193,14 +193,14 @@ if (NOT PKG_CONFIG_FOUND)
endif (NOT PKG_CONFIG_FOUND)
# glib et al.
pkg_check_modules (GLIB2 REQUIRED IMPORTED_TARGET glib-2.0>=2.40)
pkg_check_modules (GIO REQUIRED IMPORTED_TARGET gio-2.0)
pkg_check_modules (GOBJECT REQUIRED IMPORTED_TARGET gobject-2.0>=2.20)
pkg_check_modules (GMODULE REQUIRED IMPORTED_TARGET gmodule-2.0>=2.20)
pkg_check_modules (GTHREAD REQUIRED IMPORTED_TARGET gthread-2.0>=2.20)
pkg_check_modules (GLIB2 REQUIRED glib-2.0>=2.40)
pkg_check_modules (GIO REQUIRED gio-2.0)
pkg_check_modules (GOBJECT REQUIRED gobject-2.0>=2.20)
pkg_check_modules (GMODULE REQUIRED gmodule-2.0>=2.20)
pkg_check_modules (GTHREAD REQUIRED gthread-2.0>=2.20)
pkg_check_modules (LIBXML2 REQUIRED IMPORTED_TARGET libxml-2.0>=2.7.0)
pkg_check_modules (LIBXSLT REQUIRED IMPORTED_TARGET libxslt)
pkg_check_modules (LIBXML2 REQUIRED libxml-2.0>=2.7.0)
pkg_check_modules (LIBXSLT REQUIRED libxslt)
if (WITH_GNUCASH)
if (WIN32 OR APPLE)
pkg_check_modules (WEBKIT REQUIRED IMPORTED_TARGET webkitgtk-3.0)
@@ -220,7 +220,7 @@ if (WITH_GNUCASH)
pkg_check_modules (GTK3 REQUIRED IMPORTED_TARGET gtk+-3.0>=3.18.0)
endif (WITH_GNUCASH)
pkg_check_modules (ZLIB REQUIRED IMPORTED_TARGET zlib)
pkg_check_modules (ZLIB REQUIRED zlib)
if (MSVC)
message (STATUS "Hint: To create the import libraries for the gnome DLLs (e.g. gconf-2.lib), use the dlltool as follows: pexports bin/libgconf-2-4.dll > lib/libgconf-2.def ; dlltool -d lib/libgconf-2.def -D bin/libgconf-2-4.dll -l lib/gconf-2.lib")
@@ -268,23 +268,42 @@ string(REGEX MATCH "^[0-9]+[.]" SWIG_MAJOR ${SWIG_VERSION})
# Look for guile versions in this order: 2.2 > 2.0
# guile library and include dir
pkg_check_modules (GUILE IMPORTED_TARGET guile-2.2 QUIET)
if (GUILE_FOUND)
if (NOT GUILE_EFFECTIVE_VERSION) # found guile-2.2
set(GUILE_EFFECTIVE_VERSION 2.2)
endif()
else(GUILE_FOUND)
pkg_check_modules (GUILE REQUIRED IMPORTED_TARGET guile-2.0>=2.0.9 QUIET)
set(GUILE_EFFECTIVE_VERSION 2.0)
endif(GUILE_FOUND)
find_program (GUILD_EXECUTABLE NAMES guild2.2 guild2.0 guild)
if (NOT GUILD_EXECUTABLE)
message (SEND_ERROR "The guild executable was not found, but is required.")
endif (NOT GUILD_EXECUTABLE)
pkg_check_modules (GUILE22 guile-2.2 QUIET)
if (GUILE22_FOUND) # found guile-2.2
add_definitions (-DHAVE_GUILE22)
set(HAVE_GUILE2 TRUE)
set(GUILE_EFFECTIVE_VERSION 2.2)
set(GUILE_INCLUDE_DIRS ${GUILE22_INCLUDE_DIRS})
set(GUILE_LDFLAGS ${GUILE22_LDFLAGS})
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)
message(STATUS "Using guile-2.2.x")
find_program (GUILE_EXECUTABLE NAMES guile2.2 guile)
else(GUILE22_FOUND)
pkg_check_modules (GUILE2 guile-2.0>=2.0.9 QUIET)
if (GUILE2_FOUND) # found guile-2.0
add_definitions (-DHAVE_GUILE20)
set(HAVE_GUILE2 TRUE)
set(GUILE_EFFECTIVE_VERSION 2.0)
set(GUILE_INCLUDE_DIRS ${GUILE2_INCLUDE_DIRS})
set(GUILE_LDFLAGS ${GUILE2_LDFLAGS})
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)
message(STATUS "Using guile-2.0.x")
find_program (GUILE_EXECUTABLE NAMES guile2.2 guile2.0 guile)
find_program (GUILE_EXECUTABLE NAMES guile2.0 guile)
else(GUILE2_FOUND)
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)
if (NOT GUILE_EXECUTABLE)
message (SEND_ERROR "The guile executable was not found, but is required.")
message (SEND_ERROR "The guile executable was not found, but is required. Please set GUILE_EXECUTABLE.")
endif (NOT GUILE_EXECUTABLE)
# Test that guile has SRFI-64. This is required for some unit tests.
@@ -314,8 +333,15 @@ find_guile_dirs()
# ############################################################
if (WITH_AQBANKING)
pkg_check_modules (GWENHYWFAR REQUIRED IMPORTED_TARGET gwenhywfar>=4.9.99)
pkg_check_modules (AQBANKING REQUIRED IMPORTED_TARGET aqbanking>=5.3.4)
pkg_check_modules (GWENHYWFAR REQUIRED gwenhywfar>=4.9.99)
pkg_check_modules (AQBANKING REQUIRED aqbanking>=5.3.4)
set(CMAKE_REQUIRED_INCLUDES "${AQBANKING_INCLUDE_DIRS}"
"${GWENHYWFAR_INCLUDE_DIRS}")
set(CMAKE_REQUIRED_LIBRARIES "-laqbanking")
check_symbol_exists("AB_Banking_RuntimeConfig_SetCharValue"
"aqbanking/banking.h" AQB_HAS_RUNTIME_CONFIG)
set(CMAKE_REQUIRED_INCLUDES)
set(CMAKE_REQUIRED_LIBRARIES)
if(WITH_GNUCASH)
pkg_check_modules (GWEN_GTK3 gwengui-gtk3)
if(GWEN_GTK3_FOUND AND GWEN_GTK3_VERSION VERSION_GREATER "4.20.0")
@@ -325,7 +351,7 @@ if (WITH_AQBANKING)
endif (WITH_AQBANKING)
if (WITH_OFX)
pkg_check_modules (LIBOFX REQUIRED IMPORTED_TARGET libofx)
pkg_check_modules (LIBOFX REQUIRED libofx)
include(CheckCXXSourceRuns)
if (WIN32)
set(CMAKE_REQUIRED_LIBRARIES "-L ${CMAKE_PREFIX_PATH}/libofx/lib -lofx")
@@ -468,9 +494,10 @@ get_filename_component(PERL_DIR ${PERL_EXECUTABLE} DIRECTORY)
find_program(POD2MAN_EXECUTABLE pod2man HINTS ${PERL_DIR})
#ICU
find_package(ICU REQUIRED COMPONENTS i18n uc)
pkg_check_modules (ICU4C REQUIRED icu-uc)
pkg_check_modules (ICU4C_I18N REQUIRED icu-i18n)
pkg_check_modules (LIBSECRET IMPORTED_TARGET libsecret-1>=0.18)
pkg_check_modules (LIBSECRET libsecret-1>=0.18)
IF (LIBSECRET_FOUND)
SET (HAVE_LIBSECRET ON)
ENDIF (LIBSECRET_FOUND)