[evolution-data-server] Bug 773656 - Fix various g-ir-scanner failures after switching to cmake



commit 69e54a36da5224fb51a428cc6c0cef47bdfd292d
Author: Ting-Wei Lan <lantw src gnome org>
Date:   Mon Oct 31 15:03:04 2016 +0100

    Bug 773656 - Fix various g-ir-scanner failures after switching to cmake

 cmake/modules/GObjectIntrospection.cmake         |   52 ++++++++++++++++++++-
 src/addressbook/libebook-contacts/CMakeLists.txt |    3 +-
 src/addressbook/libebook/CMakeLists.txt          |    4 +-
 src/camel/CMakeLists.txt                         |    2 +-
 src/libedataserver/CMakeLists.txt                |    2 -
 5 files changed, 53 insertions(+), 10 deletions(-)
---
diff --git a/cmake/modules/GObjectIntrospection.cmake b/cmake/modules/GObjectIntrospection.cmake
index cf23529..8d072ad 100644
--- a/cmake/modules/GObjectIntrospection.cmake
+++ b/cmake/modules/GObjectIntrospection.cmake
@@ -101,8 +101,9 @@ macro(gir_add_introspection gir)
                set(_gir_libtool "--no-libtool")
 
                add_custom_command(
-                       COMMAND ${CMAKE_COMMAND} -E env "CC='${CMAKE_C_COMPILER}'"
-                                ${G_IR_SCANNER}
+                       COMMAND ${CMAKE_COMMAND} -E env "CC='${CMAKE_C_COMPILER}'" LDFLAGS=
+                               ${INTROSPECTION_SCANNER_ENV}
+                               ${G_IR_SCANNER}
                                ${INTROSPECTION_SCANNER_ARGS}
                                --namespace=${_gir_namespace}
                                --nsversion=${_gir_version}
@@ -167,8 +168,8 @@ endmacro(_gir_deps_to_includedir)
 macro(gir_add_introspection_simple gir_library pkg_export_prefix gir_library_version c_include 
gir_identifies_prefixes_var gir_includes_var extra_cflags_var gir_extra_libdirs_var gir_libs_var gir_deps_var 
gir_sources_var)
        gir_construct_names(${gir_library} ${gir_library_version} gir_name gir_vars_prefix)
 
-       unset(INTROSPECTION_SCANNER_FLAGS)
        unset(INTROSPECTION_SCANNER_ARGS)
+       unset(INTROSPECTION_SCANNER_ENV)
        unset(INTROSPECTION_COMPILER_ARGS)
 
        set(${gir_vars_prefix} ${gir_library})
@@ -217,6 +218,51 @@ macro(gir_add_introspection_simple gir_library pkg_export_prefix gir_library_ver
                --verbose
        )
 
+       if(WIN32)
+               set(_loader_library_path_var "PATH")
+               set(_loader_library_path_native "$ENV{PATH}")
+       elseif(APPLE)
+               set(_loader_library_path_var "DYLD_LIBRARY_PATH")
+               set(_loader_library_path_native "$ENV{DYLD_LIBRARY_PATH}")
+       else()
+               set(_loader_library_path_var "LD_LIBRARY_PATH")
+               set(_loader_library_path_native "$ENV{LD_LIBRARY_PATH}")
+       endif ()
+
+       file(TO_CMAKE_PATH
+               "${_loader_library_path_native}"
+               _loader_library_path_cmake
+       )
+
+       set(_extra_loader_library_path_cmake
+               ${CMAKE_BINARY_DIR}
+               ${CMAKE_BINARY_DIR}/src
+               ${CMAKE_CURRENT_BINARY_DIR}
+               ${${gir_extra_libdirs_var}}
+               ${LIB_INSTALL_DIR}
+               ${_loader_library_path_cmake}
+       )
+
+       file(TO_NATIVE_PATH
+               "${_extra_loader_library_path_cmake}"
+               _extra_loader_library_path_native
+       )
+
+       if(UNIX)
+               string(REPLACE ";" ":"
+                       _extra_loader_library_path_native
+                       "${_extra_loader_library_path_native}"
+               )
+               string(REPLACE "\\ " " "
+                       _extra_loader_library_path_native
+                       "${_extra_loader_library_path_native}"
+               )
+       endif(UNIX)
+
+       set(INTROSPECTION_SCANNER_ENV
+               ${_loader_library_path_var}="${_extra_loader_library_path_native}"
+       )
+
        gir_add_introspection(${gir_name})
 
 endmacro(gir_add_introspection_simple)
diff --git a/src/addressbook/libebook-contacts/CMakeLists.txt 
b/src/addressbook/libebook-contacts/CMakeLists.txt
index 44c0081..559e212 100644
--- a/src/addressbook/libebook-contacts/CMakeLists.txt
+++ b/src/addressbook/libebook-contacts/CMakeLists.txt
@@ -132,8 +132,6 @@ set(gir_sources ${SOURCES} ${HEADERS})
 set(gir_identifies_prefixes E)
 set(gir_includes GObject-2.0 GLib-2.0 Gio-2.0 libxml2-2.0)
 set(gir_cflags
-       ${CAMEL_INCLUDE_DIRS}
-       ${DATA_SERVER_INCLUDE_DIRS}
        -DLIBEBOOK_CONTACTS_COMPILATION
        -I${CMAKE_BINARY_DIR}/src/addressbook
        -I${CMAKE_BINARY_DIR}/src/addressbook/libebook-contacts
@@ -142,6 +140,7 @@ set(gir_cflags
 )
 set(gir_libdirs
        ${CMAKE_BINARY_DIR}/src/private
+       ${CMAKE_BINARY_DIR}/src/camel
        ${CMAKE_BINARY_DIR}/src/libedataserver
 )
 set(gir_libs
diff --git a/src/addressbook/libebook/CMakeLists.txt b/src/addressbook/libebook/CMakeLists.txt
index 6b54e0d..49d3ea6 100644
--- a/src/addressbook/libebook/CMakeLists.txt
+++ b/src/addressbook/libebook/CMakeLists.txt
@@ -92,8 +92,6 @@ set(gir_sources ${SOURCES} ${HEADERS})
 set(gir_identifies_prefixes E)
 set(gir_includes GObject-2.0 GLib-2.0 Gio-2.0 libxml2-2.0)
 set(gir_cflags
-       ${CAMEL_INCLUDE_DIRS}
-       ${DATA_SERVER_INCLUDE_DIRS}
        -DLIBEBOOK_COMPILATION
        -I${CMAKE_BINARY_DIR}/src/addressbook
        -I${CMAKE_BINARY_DIR}/src/addressbook/libebook
@@ -102,6 +100,8 @@ set(gir_cflags
 )
 set(gir_libdirs
        ${CMAKE_BINARY_DIR}/src/private
+       ${CMAKE_BINARY_DIR}/src/camel
+       ${CMAKE_BINARY_DIR}/src/libebackend
        ${CMAKE_BINARY_DIR}/src/libedataserver
        ${CMAKE_BINARY_DIR}/src/addressbook/libebook-contacts
        ${CMAKE_BINARY_DIR}/src/addressbook/libedata-book
diff --git a/src/camel/CMakeLists.txt b/src/camel/CMakeLists.txt
index 419a276..923e674 100644
--- a/src/camel/CMakeLists.txt
+++ b/src/camel/CMakeLists.txt
@@ -311,7 +311,7 @@ add_pkgconfig_file(camel.pc.in camel-${API_VERSION}.pc)
 set(gir_sources ${SOURCES} ${HEADERS})
 set(gir_identifies_prefixes Camel camel)
 set(gir_includes GObject-2.0 Gio-2.0 libxml2-2.0)
-set(gir_cflags ${CAMEL_INCLUDE_DIRS} -DCAMEL_COMPILATION)
+set(gir_cflags -DCAMEL_COMPILATION)
 set(gir_libdirs)
 set(gir_libs camel)
 set(gir_deps)
diff --git a/src/libedataserver/CMakeLists.txt b/src/libedataserver/CMakeLists.txt
index e7edf15..bc482ad 100644
--- a/src/libedataserver/CMakeLists.txt
+++ b/src/libedataserver/CMakeLists.txt
@@ -265,8 +265,6 @@ set(gir_sources ${SOURCES} ${HEADERS})
 set(gir_identifies_prefixes E)
 set(gir_includes GObject-2.0 Gio-2.0 Soup-2.4 libxml2-2.0)
 set(gir_cflags
-       ${CAMEL_INCLUDE_DIRS}
-       ${DATA_SERVER_INCLUDE_DIRS}
        -DLIBEDATASERVER_COMPILATION
 )
 set(gir_libdirs


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]