[evolution-mapi] CMake: Add FORCE_INSTALL_PREFIX compile time option
- From: Milan Crha <mcrha src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution-mapi] CMake: Add FORCE_INSTALL_PREFIX compile time option
- Date: Wed, 24 Feb 2021 17:11:12 +0000 (UTC)
commit c1a4f42ebd5a2befc8070a9af9cd077ad5e439a6
Author: Milan Crha <mcrha redhat com>
Date: Wed Feb 24 18:10:51 2021 +0100
CMake: Add FORCE_INSTALL_PREFIX compile time option
This allows to install evolution-data-server and evolution files
files into the CMAKE_INSTALL_PREFIX instead of the prefix advertised
by respective pkg-config files. It's useful, when the eds/evo prefixes
are not writable for the builder.
Also use EBookMetaBackendClass::backend_module_directory, which is
closely related to this new option.
CMakeLists.txt | 18 ++++++++++++++++--
src/addressbook/e-book-backend-mapi.c | 1 +
2 files changed, 17 insertions(+), 2 deletions(-)
---
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 81bb97b..97fa542 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -172,16 +172,30 @@ unset(CMAKE_REQUIRED_LIBRARIES)
set(privlibdir "${LIB_INSTALL_DIR}/${PROJECT_NAME}")
-pkg_check_variable(errordir evolution-shell-3.0 errordir)
-pkg_check_variable(evo_privlibdir evolution-shell-3.0 privlibdir)
pkg_check_variable(camel_providerdir camel-1.2 camel_providerdir)
pkg_check_variable(ebook_backenddir libedata-book-1.2 backenddir)
pkg_check_variable(ecal_backenddir libedata-cal-2.0 backenddir)
pkg_check_variable(eds_moduledir libebackend-1.2 moduledir)
+pkg_check_variable(evo_privlibdir evolution-shell-3.0 privlibdir)
+pkg_check_variable(errordir evolution-shell-3.0 errordir)
pkg_check_variable(evo_moduledir evolution-shell-3.0 moduledir)
pkg_check_variable(mapidatadir evolution-data-server-1.2 privdatadir)
pkg_check_variable(libmapi_ldif_dir libmapi datadir)
+add_printable_variable(FORCE_INSTALL_PREFIX "Whether to force install evolution-data-server and evolution
files into the install prefix" OFF)
+if(FORCE_INSTALL_PREFIX)
+ pkg_check_variable(eds_prefix evolution-data-server-1.2 prefix)
+ string(REGEX REPLACE "^${eds_prefix}" "${CMAKE_INSTALL_PREFIX}" camel_providerdir
"${camel_providerdir}")
+ string(REGEX REPLACE "^${eds_prefix}" "${CMAKE_INSTALL_PREFIX}" ebook_backenddir
"${ebook_backenddir}")
+ string(REGEX REPLACE "^${eds_prefix}" "${CMAKE_INSTALL_PREFIX}" ecal_backenddir "${ecal_backenddir}")
+ string(REGEX REPLACE "^${eds_prefix}" "${CMAKE_INSTALL_PREFIX}" eds_moduledir "${eds_moduledir}")
+ string(REGEX REPLACE "^${eds_prefix}" "${CMAKE_INSTALL_PREFIX}" mapidatadir "${mapidatadir}")
+
+ pkg_check_variable(evo_prefix evolution-shell-3.0 prefix)
+ string(REGEX REPLACE "^${evo_prefix}" "${CMAKE_INSTALL_PREFIX}" errordir "${errordir}")
+ string(REGEX REPLACE "^${evo_prefix}" "${CMAKE_INSTALL_PREFIX}" evo_moduledir "${evo_moduledir}")
+endif(FORCE_INSTALL_PREFIX)
+
set(mapidatadir "${mapidatadir}/mapi")
set(libmapi_ldif_dir "${libmapi_ldif_dir}/setup")
diff --git a/src/addressbook/e-book-backend-mapi.c b/src/addressbook/e-book-backend-mapi.c
index c924ca2..bf5e034 100644
--- a/src/addressbook/e-book-backend-mapi.c
+++ b/src/addressbook/e-book-backend-mapi.c
@@ -1139,6 +1139,7 @@ e_book_backend_mapi_class_init (EBookBackendMAPIClass *klass)
EBookMetaBackendClass *meta_backend_class;
meta_backend_class = E_BOOK_META_BACKEND_CLASS (klass);
+ meta_backend_class->backend_module_directory = BACKENDDIR;
meta_backend_class->backend_module_filename = "libebookbackendmapi.so";
meta_backend_class->connect_sync = ebb_mapi_connect_sync;
meta_backend_class->disconnect_sync = ebb_mapi_disconnect_sync;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]