Re: [Evolution-hackers] Checking installation of header files for data service components



In file included from /home/elfring/Projekte/Gnome/Evolution/lokal/src/e-util/e-util.h:266,
                 from /home/elfring/Projekte/Gnome/Evolution/lokal/src/e-util/test-proxy-preferences.c:18:
/home/elfring/Projekte/Gnome/Evolution/lokal/src/e-util/e-webdav-browser.h:26:10: fatal error: 
libedataserverui/libedataserverui.h: No such file or directory
   26 | #include <libedataserverui/libedataserverui.h>
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
ninja: build stopped: subcommand failed.


Now I imagine that the header file inclusion parameters can be extended somehow.
Would you like to clarify corresponding adjustment possibilities?

How should a path like the following be automatically chosen to resolve
such a software dependency?
~/Projekte/Test/Evolution/Service/current/home/elfring/Projekte/Test/Evolution/Service/current/include/evolution-data-server/libedataserverui/libedataserverui.h

Now I suggest to extend a build script like the following.
https://gitlab.gnome.org/GNOME/evolution/-/blob/d1f4010751c65a3ac5de3919905e2f14f5f4744f/CMakeLists.txt#L271

add_printable_variable(EVOLUTION_DATA_SERVER_LIBRARY_SUBDIR
                       "Choose a subdirectory for library files of the GNOME Evolution data server on demand"
                       "evolution-data-server")
add_printable_variable_path(EVOLUTION_DATA_SERVER_INSTALLATION_PREFIX
                            "Choose an installation prefix for the GNOME Evolution data server on demand"
                            "${CMAKE_INSTALL_PREFIX}")

if(EVOLUTION_DATA_SERVER_INSTALLATION_PREFIX)
        if(PKG_CONFIG_USE_CMAKE_PREFIX_PATH OR CMAKE_VERSION VERSION_GREATER_EQUAL 3.1)
                option(EVOLUTION_DATA_SERVER_USE_STATIC_LIBRARIES
                       "Should a configuration be used according to static libraries from the GNOME Evolution 
data server?"
                       ON)
                cmake_policy(SET CMP0057 NEW)
                set(EVOLUTION_DATA_SERVER_INSTALLATION_DIR
                    "${EVOLUTION_DATA_SERVER_INSTALLATION_PREFIX}${CMAKE_BINARY_DIR}")

                if(NOT EVOLUTION_DATA_SERVER_INSTALLATION_DIR IN_LIST CMAKE_PREFIX_PATH)
                        list(APPEND CMAKE_PREFIX_PATH "${EVOLUTION_DATA_SERVER_INSTALLATION_DIR}")
                endif()

                if(CMAKE_HOST_SYSTEM_NAME EQUAL "Darwin")
                        if(NOT EVOLUTION_DATA_SERVER_INSTALLATION_DIR IN_LIST CMAKE_FRAMEWORK_PATH)
                                list(APPEND CMAKE_FRAMEWORK_PATH "${EVOLUTION_DATA_SERVER_INSTALLATION_DIR}")
                        endif()

                        if(NOT EVOLUTION_DATA_SERVER_INSTALLATION_DIR IN_LIST CMAKE_APPBUNDLE_PATH)
                                list(APPEND CMAKE_APPBUNDLE_PATH "${EVOLUTION_DATA_SERVER_INSTALLATION_DIR}")
                        endif()
                endif()
        endif()
endif()

pkg_check_modules(EVOLUTION_DATA_SERVER REQUIRED
        camel-1.2>=${eds_minimum_version}
        libebook-1.2>=${eds_minimum_version}
        libecal-2.0>=${eds_minimum_version}
        libedataserver-1.2>=${eds_minimum_version}
        libedataserverui-1.2>=${eds_minimum_version}
        libebackend-1.2>=${eds_minimum_version}
)

if(EVOLUTION_DATA_SERVER_INSTALLATION_DIR)
        set(subdir "/${EVOLUTION_DATA_SERVER_LIBRARY_SUBDIR}")

        if(EVOLUTION_DATA_SERVER_USE_STATIC_LIBRARIES)
                set(pattern "(.*/include${subdir})")
                list(TRANSFORM EVOLUTION_DATA_SERVER_INCLUDE_DIRS REPLACE
                     "^${pattern}$" "${EVOLUTION_DATA_SERVER_INSTALLATION_PREFIX}\\1"
                     OUTPUT_VARIABLE x)
                message(STATUS "Static transformation approach:\n${x}")
                list(TRANSFORM EVOLUTION_DATA_SERVER_CFLAGS REPLACE
                     "^-I${pattern}$" "-I${EVOLUTION_DATA_SERVER_INSTALLATION_PREFIX}\\1"
                     OUTPUT_VARIABLE y)
        else()
                set(pattern
#                   "(${EVOLUTION_DATA_SERVER_INSTALLATION_PREFIX}.*/include(?!${subdir}))"
                    "(${EVOLUTION_DATA_SERVER_INSTALLATION_PREFIX}.*/include)"
                   )
                list(TRANSFORM EVOLUTION_DATA_SERVER_INCLUDE_DIRS REPLACE
                     "^${pattern}$" "\\1${subdir}"
                     OUTPUT_VARIABLE x)
                message(STATUS "Dynamic transformation approach:\n${x}")
                list(TRANSFORM EVOLUTION_DATA_SERVER_CFLAGS REPLACE
                     "^-I${pattern}$" "-I\\1${subdir}"
                     OUTPUT_VARIABLE y)
        endif()

        if(EVOLUTION_DATA_SERVER_INCLUDE_DIRS EQUAL x)
                message(FATAL_ERROR "An adjustment approach failed for the variable 
“EVOLUTION_DATA_SERVER_INCLUDE_DIRS”.\nPlease check the corresponding dependencies once more.")
        endif()

        if(EVOLUTION_DATA_SERVER_CFLAGS EQUAL y)
                message(FATAL_ERROR "An adjustment approach failed for the variable 
“EVOLUTION_DATA_SERVER_CFLAGS”.\nPlease check the corresponding dependencies once more.")
        endif()
else()
        set(x "${EVOLUTION_DATA_SERVER_INCLUDE_DIRS}")
        set(y "${EVOLUTION_DATA_SERVER_CFLAGS}")
endif()

set(EVOLUTION_DATA_SERVER_CFLAGS_SELECTION "${y}"
    CACHE INTERNAL "Selection of compilation parameters")
set(EVOLUTION_DATA_SERVER_INCLUDE_DIRS_SELECTION "${x}"
    CACHE INTERNAL "Selection of directories for file inclusion")


How do you think about to take further software extension possibilities
into account here?

Regards,
Markus


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