### Define Installation Directories Source: https://github.com/gnome/evolution-data-server/blob/master/CMakeLists.txt Defines and prints variables for installation directories, such as binary, include, library, and share directories. These paths are crucial for installing the project correctly. ```cmake add_printable_variable_bare(CMAKE_BUILD_TYPE) add_printable_variable(LIB_SUFFIX "Library directory suffix, usually defined to '64' for x86_64 systems" "") add_printable_variable_bare(CMAKE_INSTALL_PREFIX) add_printable_variable_path(BIN_INSTALL_DIR "Install directory for binary files, defaults to CMAKE_INSTALL_PREFIX/bin" "") add_printable_variable_path(INCLUDE_INSTALL_DIR "Install directory for header files, defaults to CMAKE_INSTALL_PREFIX/include" "") add_printable_variable_path(LIB_INSTALL_DIR "Install directory for library files, defaults to CMAKE_INSTALL_PREFIX/lib{LIB_SUFFIX}" "") add_printable_variable_path(LIBEXEC_INSTALL_DIR "Install directory for library executable files, defaults to CMAKE_INSTALL_PREFIX/libexec" "") add_printable_variable_path(SHARE_INSTALL_PREFIX "Install directory for shared files, defaults to CMAKE_INSTALL_PREFIX/share" "") add_printable_variable_path(LOCALE_INSTALL_DIR "Install directory for locale files, defaults to SHARE_INSTALL_PREFIX/locale" "") add_printable_variable_path(SYSCONF_INSTALL_DIR "Install directory for system configuration files, defaults to CMAKE_INSTALL_PREFIX/etc" "") add_printable_variable_path(EXTENSIONS_DIR "Directory, where out-of-tree extensions can be installed, defaults to LIBEXEC_INSTALL_DIR/evolution/extensions" "") ``` -------------------------------- ### Install Library Source: https://github.com/gnome/evolution-data-server/blob/master/src/addressbook/backends/file/CMakeLists.txt Installs the 'ebookbackendfile' target to the specified backend directory. ```cmake install(TARGETS ebookbackendfile DESTINATION ${ebook_backenddir} ) ``` -------------------------------- ### Install Library Source: https://github.com/gnome/evolution-data-server/blob/master/src/calendar/backends/file/CMakeLists.txt Installs the ecalbackendfile library to the specified backend directory. ```cmake install(TARGETS ecalbackendfile DESTINATION ${ecal_backenddir} ) ``` -------------------------------- ### Install Executable Source: https://github.com/gnome/evolution-data-server/blob/master/src/tools/list-sources/CMakeLists.txt Installs the 'list-sources' executable to the specified destination directory. ```cmake install(TARGETS list-sources DESTINATION ${privlibexecdir} ) ``` -------------------------------- ### Install Executable Source: https://github.com/gnome/evolution-data-server/blob/master/src/services/evolution-source-registry/CMakeLists.txt Installs the built evolution-source-registry executable to the specified destination directory. ```cmake install(TARGETS evolution-source-registry DESTINATION ${LIBEXEC_INSTALL_DIR} ) ``` -------------------------------- ### Install Executable Source: https://github.com/gnome/evolution-data-server/blob/master/src/services/evolution-calendar-factory/CMakeLists.txt Installs the built evolution-calendar-factory executable to the specified destination. ```cmake install(TARGETS evolution-calendar-factory DESTINATION ${LIBEXEC_INSTALL_DIR} ) ``` -------------------------------- ### Installation Target Source: https://github.com/gnome/evolution-data-server/blob/master/src/services/evolution-alarm-notify/CMakeLists.txt Installs the evolution-alarm-notify target to the specified destination directory. ```cmake install(TARGETS evolution-alarm-notify DESTINATION ${privlibexecdir} ) ``` -------------------------------- ### Glob and Install VCF Files Source: https://github.com/gnome/evolution-data-server/blob/master/tests/libedata-book/CMakeLists.txt If installed tests are enabled, this block finds all .vcf files in the specified directory and installs them to the test execution directory. ```cmake if(ENABLE_INSTALLED_TESTS) file(GLOB VCARDS ${CMAKE_SOURCE_DIR}/tests/libebook/data/vcards/*.vcf) install(FILES ${VCARDS} DESTINATION ${INSTALLED_TESTS_EXEC_DIR}/vcards ) endif(ENABLE_INSTALLED_TESTS) ``` -------------------------------- ### Install addressbook-export Executable Source: https://github.com/gnome/evolution-data-server/blob/master/src/tools/addressbook-export/CMakeLists.txt Installs the built addressbook-export executable to the specified destination directory. ```cmake install(TARGETS addressbook-export DESTINATION ${privlibexecdir} ) ``` -------------------------------- ### Enable Build of Examples Source: https://github.com/gnome/evolution-data-server/blob/master/CMakeLists.txt Conditionally enables the build of example programs. Requires pkg-config to check for necessary dependencies like gtk+-3.0 and glib-2.0. ```cmake add_printable_option(ENABLE_EXAMPLES "Enable the build of examples" ON) if(ENABLE_EXAMPLES) pkg_check_modules_for_option(ENABLE_EXAMPLES "build the example program(s)" EXAMPLES gtk+-3.0>=3.10 glib-2.0>=${glib_minimum_version} ) set(BUILD_EXAMPLES 1) endif(ENABLE_EXAMPLES) ``` -------------------------------- ### Install Executable Source: https://github.com/gnome/evolution-data-server/blob/master/src/services/evolution-user-prompter/CMakeLists.txt Installs the compiled evolution-user-prompter executable to the specified destination directory. This makes the service available for execution. ```cmake install(TARGETS evolution-user-prompter DESTINATION ${LIBEXEC_INSTALL_DIR} ) ``` -------------------------------- ### Install HTTP Calendar Backend Library Source: https://github.com/gnome/evolution-data-server/blob/master/src/calendar/backends/http/CMakeLists.txt Installs the 'ecalbackendhttp' target library to the specified backend directory. ```cmake install(TARGETS ecalbackendhttp DESTINATION ${ecal_backenddir} ) ``` -------------------------------- ### Install GTasks Backend Library Source: https://github.com/gnome/evolution-data-server/blob/master/src/calendar/backends/gtasks/CMakeLists.txt Installs the built 'ecalbackendgtasks' library to the specified backend directory. ```cmake install(TARGETS ecalbackendgtasks DESTINATION ${ecal_backenddir} ) ``` -------------------------------- ### Install Executable Target Source: https://github.com/gnome/evolution-data-server/blob/master/src/services/evolution-addressbook-factory/CMakeLists.txt Installs the 'evolution-addressbook-factory' executable to the specified destination directory. ```cmake install(TARGETS evolution-addressbook-factory DESTINATION ${LIBEXEC_INSTALL_DIR} ) ``` -------------------------------- ### Install Vala VAPI Files Source: https://github.com/gnome/evolution-data-server/blob/master/src/vala/CMakeLists.txt Creates a custom target 'vala-files' and installs all generated VAPI files to the appropriate system directory. ```cmake add_custom_target(vala-files DEPENDS ${valafiles} ) add_dependencies(vala vala-files) install(FILES ${valafiles} DESTINATION ${SHARE_INSTALL_PREFIX}/vala/vapi ) ``` -------------------------------- ### Install LDAP Backend Library Source: https://github.com/gnome/evolution-data-server/blob/master/src/addressbook/backends/ldap/CMakeLists.txt Installs the compiled LDAP backend library to the appropriate backend directory. ```cmake install(TARGETS ebookbackendldap DESTINATION ${ebook_backenddir} ) ``` -------------------------------- ### Install CardDAV Backend Library Source: https://github.com/gnome/evolution-data-server/blob/master/src/addressbook/backends/carddav/CMakeLists.txt Installs the compiled CardDAV backend library to the specified backend directory. ```cmake install(TARGETS ebookbackendcarddav DESTINATION ${ebook_backenddir} ) ``` -------------------------------- ### Install Headers for libedataserver Source: https://github.com/gnome/evolution-data-server/blob/master/src/libedataserver/CMakeLists.txt Installs header files to the private include directory for libedataserver. ```cmake install(FILES ${HEADERS} DESTINATION ${privincludedir}/libedataserver ) ``` -------------------------------- ### Process POT file for installation Source: https://github.com/gnome/evolution-data-server/blob/master/po/CMakeLists.txt Uses the gettext_process_pot_file macro to handle the installation of translation files. It processes the main .pot file and installs translations for all specified languages. ```cmake gettext_process_pot_file(${CMAKE_CURRENT_BINARY_DIR}/${POT_FILE} ALL INSTALL_DESTINATION "${LOCALE_INSTALL_DIR}" LANGUAGES ${LINGUAS}) ``` -------------------------------- ### Install libedataserverui Target Source: https://github.com/gnome/evolution-data-server/blob/master/src/libedataserverui/CMakeLists.txt Installs the compiled edataserverui target library to the specified destination directory. ```cmake install(TARGETS edataserverui${UI_VERSION} DESTINATION ${LIB_INSTALL_DIR} ) ``` -------------------------------- ### Install Headers for libedataserverui Source: https://github.com/gnome/evolution-data-server/blob/master/src/libedataserverui/CMakeLists.txt Installs the header files for libedataserverui to a private include directory. ```cmake install(FILES ${HEADERS} DESTINATION ${privincludedir}/libedataserverui${UI_VERSION} ) ``` -------------------------------- ### Install VCF Data Files Source: https://github.com/gnome/evolution-data-server/blob/master/tests/libebook/CMakeLists.txt Conditionally installs VCF (vCard) files from the data directory to the test execution directory if installed tests are enabled. ```cmake if(ENABLE_INSTALLED_TESTS) file(GLOB VCARDS ${CMAKE_CURRENT_SOURCE_DIR}/data/vcards/*.vcf) install(FILES ${VCARDS} DESTINATION ${INSTALLED_TESTS_EXEC_DIR}/vcards ) endif(ENABLE_INSTALLED_TESTS) ``` -------------------------------- ### Install CalDAV Backend Library Source: https://github.com/gnome/evolution-data-server/blob/master/src/calendar/backends/caldav/CMakeLists.txt Installs the compiled CalDAV backend library to the system's backend directory, making it available for use by Evolution. ```cmake install(TARGETS ecalbackendcaldav DESTINATION ${ecal_backenddir} ) ``` -------------------------------- ### Install Target for edataserver Source: https://github.com/gnome/evolution-data-server/blob/master/src/libedataserver/CMakeLists.txt Installs the edataserver target to the specified library installation directory. ```cmake install(TARGETS edataserver DESTINATION ${LIB_INSTALL_DIR} ) ``` -------------------------------- ### Add Installable Test with Checks and Installation Source: https://github.com/gnome/evolution-data-server/blob/master/tests/CMakeLists.txt Macro to add an installable test, including running checks and installing it. It first calls `build_only_installable_test` and then adds test checks and installation logic. ```cmake macro(add_installable_test _test_ident _sourcesvar _depsvar _defsvar _cflagsvar _incdirsvar _ldflagsvar _ittype _itenviron) build_only_installable_test(${_test_ident} ${_sourcesvar} ${_depsvar} ${_defsvar} ${_cflagsvar} ${_incdirsvar} ${_ldflagsvar}) add_check_test(${_test_ident} --build-dir "${CMAKE_BINARY_DIR}" ${ARGN}) install_test_if_enabled(${_test_ident} ${_ittype} ${_itenviron}) endmacro(add_installable_test) ``` -------------------------------- ### Install LDAP Schema File Source: https://github.com/gnome/evolution-data-server/blob/master/src/addressbook/backends/ldap/CMakeLists.txt Installs the evolutionperson.schema file to the private data directory. ```cmake install(FILES evolutionperson.schema DESTINATION ${privdatadir} ) ``` -------------------------------- ### Build Installable Tests Source: https://github.com/gnome/evolution-data-server/blob/master/tests/libedataserver/CMakeLists.txt Iterates through the defined tests and uses the 'add_installable_test' macro to configure and build each one. This includes setting sources and various build options. ```cmake foreach(_test ${TESTS}) set(SOURCES ${_test}.c) add_installable_test(${_test} SOURCES extra_deps extra_defines extra_cflags extra_incdirs extra_ldflags "session-exclusive" "TEST_INSTALLED_SERVICES=1" ) endforeach(_test) ``` -------------------------------- ### Installing Component Files Source: https://github.com/gnome/evolution-data-server/blob/master/tests/libedata-cal/CMakeLists.txt Conditionally installs component files (*.ics) to the destination directory if ENABLE_INSTALLED_TESTS is set. ```cmake if(ENABLE_INSTALLED_TESTS) file(GLOB COMPONENTS ${CMAKE_CURRENT_SOURCE_DIR}/components/*.ics) install(FILES ${COMPONENTS} DESTINATION ${INSTALLED_TESTS_EXEC_DIR}/components ) endif(ENABLE_INSTALLED_TESTS) ``` -------------------------------- ### Loop Through Tests and Add Installable Tests Source: https://github.com/gnome/evolution-data-server/blob/master/tests/libedata-book/CMakeLists.txt Iterates through the defined test cases, setting source files and then adding each as an installable test with specific configurations. ```cmake foreach(_test ${TESTS}) set(SOURCES ${_test}.c) add_installable_test(${_test} SOURCES extra_deps extra_defines extra_cflags extra_incdirs extra_ldflags "session-exclusive" "TEST_INSTALLED_SERVICES=1" --data-dir "${CMAKE_CURRENT_SOURCE_DIR}/../libebook/data/vcards" ) endforeach(_test) ``` -------------------------------- ### Ensure Default Installation Directory Values Source: https://github.com/gnome/evolution-data-server/blob/master/CMakeLists.txt Ensures that installation directory variables are set to default values if they are not already defined. This macro helps maintain consistent installation paths. ```cmake macro(ensure_default_value _var _defvalue) if(${_var} STREQUAL "") set(${_var} ${_defvalue}) endif(${_var} STREQUAL "") endmacro(ensure_default_value) ensure_default_value(BIN_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/bin") ensure_default_value(INCLUDE_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/include") ensure_default_value(LIB_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}") ensure_default_value(LIBEXEC_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/libexec") ensure_default_value(SHARE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}/share") ensure_default_value(LOCALE_INSTALL_DIR "${SHARE_INSTALL_PREFIX}/locale") ensure_default_value(SYSCONF_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/etc") ensure_default_value(EXTENSIONS_DIR "${LIBEXEC_INSTALL_DIR}/evolution/extensions") ``` -------------------------------- ### Add Installable Test Cases Source: https://github.com/gnome/evolution-data-server/blob/master/tests/libebook/CMakeLists.txt Iterates through the defined test cases, creating an installable test executable for each. This includes specifying sources, dependencies, and test-specific configurations. ```cmake foreach(_test ${TESTS}) set(SOURCES ${_test}.c) add_installable_test(${_test} SOURCES extra_deps extra_defines extra_cflags extra_incdirs extra_ldflags "session-exclusive" "TEST_INSTALLED_SERVICES=1" --data-dir "${CMAKE_CURRENT_SOURCE_DIR}/data/vcards" ) endforeach(_test) ``` -------------------------------- ### Install camel-gpg-photo-saver Executable Source: https://github.com/gnome/evolution-data-server/blob/master/src/camel/CMakeLists.txt Installs the camel-gpg-photo-saver executable to the specified library execution directory. ```cmake install(TARGETS camel-gpg-photo-saver DESTINATION ${LIBEXEC_INSTALL_DIR} ) ``` -------------------------------- ### Install camel-index-control Executable Source: https://github.com/gnome/evolution-data-server/blob/master/src/camel/CMakeLists.txt Installs the camel-index-control executable to the specified library execution directory. ```cmake install(TARGETS camel-index-control DESTINATION ${LIBEXEC_INSTALL_DIR} ) ``` -------------------------------- ### Install Image Assets Source: https://github.com/gnome/evolution-data-server/blob/master/data/CMakeLists.txt Installs a list of image files to the designated image directory. These are likely category icons used within the Evolution application. ```cmake set(IMAGES category_birthday_16.png category_business_16.png category_favorites_16.png category_gifts_16.png category_goals_16.png category_holiday_16.png category_holiday-cards_16.png category_hot-contacts_16.png category_ideas_16.png category_international_16.png category_key-customer_16.png category_miscellaneous_16.png category_personal_16.png category_phonecalls_16.png category_status_16.png category_strategies_16.png category_suppliers_16.png category_time-and-expenses_16.png ) install(FILES ${IMAGES} DESTINATION ${imagesdir} ) ``` -------------------------------- ### Compile and Install GSettings Schemas Source: https://github.com/gnome/evolution-data-server/blob/master/data/CMakeLists.txt Defines the GSettings schema files to be compiled and installed. It uses a custom command to compile schemas and adds them as a dependency for the main data-files target. ```cmake set(SCHEMAS org.gnome.Evolution.DefaultSources.gschema.xml org.gnome.evolution-data-server.gschema.xml org.gnome.evolution-data-server.calendar.gschema.xml org.gnome.evolution-data-server.addressbook.gschema.xml org.gnome.evolution.eds-shell.gschema.xml org.gnome.evolution.shell.network-config.gschema.xml ) set(BUILT_SCHEMAS) foreach(_schema IN LISTS SCHEMAS) configure_file(${_schema}.in ${_schema} COPYONLY) list(APPEND BUILT_SCHEMAS ${CMAKE_CURRENT_BINARY_DIR}/${_schema}) endforeach(_schema) add_custom_command(OUTPUT gschemas.compiled COMMAND ${GLIB_COMPILE_SCHEMAS} . ) add_custom_target(data-files ALL DEPENDS gschemas.compiled $<$:org.gnome.Evolution-alarm-notify.desktop> org.gnome.evolution-data-server.OAuth2-handler.desktop ) add_gsettings_schemas(data-files ${BUILT_SCHEMAS}) ``` -------------------------------- ### Install GConf Convert File Source: https://github.com/gnome/evolution-data-server/blob/master/data/CMakeLists.txt Installs a GConf convert file to the specified destination directory. This file is likely used for migrating settings from GConf to GSettings. ```cmake install(FILES evolution-data-server.convert DESTINATION ${SHARE_INSTALL_PREFIX}/GConf/gsettings ) ``` -------------------------------- ### Configure D-Bus Service File Source: https://github.com/gnome/evolution-data-server/blob/master/src/services/evolution-user-prompter/CMakeLists.txt Configures and installs the D-Bus service file for the User Prompter. This allows other applications to communicate with the service via D-Bus. ```cmake configure_file(org.gnome.evolution.dataserver.UserPrompter.service.in ${USER_PROMPTER_DBUS_SERVICE_NAME}.service @ONLY ) install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${USER_PROMPTER_DBUS_SERVICE_NAME}.service DESTINATION ${WITH_DBUS_SERVICE_DIR} ) ``` -------------------------------- ### Configuring Installable Tests Source: https://github.com/gnome/evolution-data-server/blob/master/tests/libebook/client/CMakeLists.txt Iterates through the list of tests, defining them as installable using 'add_installable_test'. This includes specifying sources, dependencies, and test-specific options. ```cmake foreach(_test ${TESTS}) set(SOURCES ${_test}.c) add_installable_test(${_test} SOURCES extra_deps extra_defines extra_cflags extra_incdirs extra_ldflags "session-exclusive" "TEST_INSTALLED_SERVICES=1" --data-dir "${CMAKE_CURRENT_SOURCE_DIR}/../data/vcards" ) endforeach(_test) ``` -------------------------------- ### Adding Installable Tests Source: https://github.com/gnome/evolution-data-server/blob/master/tests/libedata-cal/CMakeLists.txt Iterates through the defined tests and adds each as an installable test target using a custom macro. ```cmake foreach(_test ${TESTS}) set(SOURCES ${_test}.c) add_installable_test(${_test} SOURCES extra_deps extra_defines extra_cflags extra_incdirs extra_ldflags "session-exclusive" "TEST_INSTALLED_SERVICES=1" --data-dir "${CMAKE_CURRENT_SOURCE_DIR}/components" ) endforeach(_test) ``` -------------------------------- ### Define Installable Test Target Source: https://github.com/gnome/evolution-data-server/blob/master/tests/CMakeLists.txt Macro to define an executable for an installable test. It sets up dependencies, compile definitions, options, include directories, and link libraries. ```cmake macro(build_only_installable_test _test_ident _sourcesvar _depsvar _defsvar _cflagsvar _incdirsvar _ldflagsvar) set(DEPENDENCIES edataserver etestserverutils ) # Not using EXCLUDE_FROM_ALL here, to have these built always add_executable(${_test_ident} ${${_sourcesvar}}) add_dependencies(${_test_ident} ${DEPENDENCIES} ${${_depsvar}} ) target_compile_definitions(${_test_ident} PRIVATE -DG_LOG_DOMAIN="${_test_ident}" -DSRCDIR="${CMAKE_CURRENT_SOURCE_DIR}" -DINSTALLED_TEST_DIR="${INSTALLED_TESTS_EXEC_DIR}" ${${_defsvar}} ) target_compile_options(${_test_ident} PUBLIC ${BACKEND_CFLAGS} ${DATA_SERVER_CFLAGS} ${${_cflagsvar}} ) target_include_directories(${_test_ident} PUBLIC ${CMAKE_BINARY_DIR} ${CMAKE_BINARY_DIR}/src ${CMAKE_BINARY_DIR}/tests/test-server-utils ${CMAKE_SOURCE_DIR}/src ${CMAKE_SOURCE_DIR}/tests/test-server-utils ${BACKEND_INCLUDE_DIRS} ${DATA_SERVER_INCLUDE_DIRS} ${${_incdirsvar}} ) target_link_libraries(${_test_ident} ${DEPENDENCIES} ${${_depsvar}} ${BACKEND_LDFLAGS} ${DATA_SERVER_LDFLAGS} ${${_ldflagsvar}} ) endmacro(build_only_installable_test) ``` -------------------------------- ### Configure and Install csv2vcard Script Source: https://github.com/gnome/evolution-data-server/blob/master/src/tools/addressbook-export/CMakeLists.txt Finds the Perl executable, configures a csv2vcard script from a template, and installs it if Perl is found. Otherwise, it issues a warning. ```cmake find_program(PERL perl) if(PERL) configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/csv2vcard.in ${CMAKE_CURRENT_BINARY_DIR}/csv2vcard @ONLY ) install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/csv2vcard DESTINATION ${privlibexecdir} ) else(PERL) message(WARNING "The 'perl' not found, not installing csv2vcard") endif(PERL) ``` -------------------------------- ### Configuring Build-Only Installable Tests Source: https://github.com/gnome/evolution-data-server/blob/master/tests/libebook/client/CMakeLists.txt Iterates through the list of skipped tests, defining them as build-only installable tests using 'build_only_installable_test'. This ensures they are built but not necessarily run or installed in the same way as standard tests. ```cmake foreach(_test ${TESTS_SKIP}) set(SOURCES ${_test}.c) build_only_installable_test(${_test} SOURCES extra_deps extra_defines extra_cflags extra_incdirs extra_ldflags ) endforeach(_test) ``` -------------------------------- ### Configure Systemd User Unit Source: https://github.com/gnome/evolution-data-server/blob/master/src/services/evolution-addressbook-factory/CMakeLists.txt Configures the evolution-addressbook-factory.service systemd user unit if WITH_SYSTEMD_USER_UNITS is enabled. Installs the service file to the systemd user unit directory. ```cmake set(SYSTEMD_SERVICE) if(WITH_SYSTEMD_USER_UNITS) set(SYSTEMD_SERVICE "SystemdService=evolution-addressbook-factory.service") configure_file(evolution-addressbook-factory.service.in evolution-addressbook-factory.service @ONLY ) install(FILES ${CMAKE_CURRENT_BINARY_DIR}/evolution-addressbook-factory.service DESTINATION ${WITH_SYSTEMDUSERUNITDIR} ) endif(WITH_SYSTEMD_USER_UNITS) ``` -------------------------------- ### Install edbus-private Library Source: https://github.com/gnome/evolution-data-server/blob/master/src/private/CMakeLists.txt Installs the edbus-private target library to the specified destination directory (${privsolibdir}). This makes the compiled library available for use by other parts of the system. ```cmake install(TARGETS edbus-private DESTINATION ${privsolibdir} ) ``` -------------------------------- ### Configure and Install Alarm Notification Desktop Entry Source: https://github.com/gnome/evolution-data-server/blob/master/data/CMakeLists.txt Generates and installs the autostart desktop entry for the alarm notification service if GTK is enabled. This ensures GNOME Shell can display notifications from the service. ```cmake set(desktopdir ${SHARE_INSTALL_PREFIX}/applications) if(HAVE_GTK) set(autostartdir ${SYSCONF_INSTALL_DIR}/xdg/autostart) set(alarm_notify_icon hicolor_apps_scalable/org.gnome.Evolution-alarm-notify.svg) configure_file(org.gnome.Evolution-alarm-notify.desktop.in.in org.gnome.Evolution-alarm-notify.desktop.in @ONLY ) i18n_merge_file(${CMAKE_CURRENT_BINARY_DIR}/org.gnome.Evolution-alarm-notify.desktop.in org.gnome.Evolution-alarm-notify.desktop ${CMAKE_SOURCE_DIR}/po) install(FILES ${CMAKE_CURRENT_BINARY_DIR}/org.gnome.Evolution-alarm-notify.desktop DESTINATION ${autostartdir} ) # To have GNOME Shell show the GNotification notifications from it; otherwise it ignores them install(FILES ${CMAKE_CURRENT_BINARY_DIR}/org.gnome.Evolution-alarm-notify.desktop DESTINATION ${desktopdir} ) add_icon_cache_files("${SHARE_INSTALL_PREFIX}" alarm_notify_icon) endif(HAVE_GTK) ``` -------------------------------- ### Defining Skipped Test Cases Source: https://github.com/gnome/evolution-data-server/blob/master/tests/libebook/client/CMakeLists.txt Lists test cases that should be skipped during 'make check' and when creating installed tests. These are typically long-running or require special setup. ```cmake set(TESTS_SKIP test-book-client-cursor-operations ) ``` -------------------------------- ### List of Tests to Build Source: https://github.com/gnome/evolution-data-server/blob/master/tests/libedataserver/CMakeLists.txt Defines the primary list of tests to be compiled and installed. The order is suggested to be from least to most complex. ```cmake set(TESTS e-source-registry-test libedataserver-test ) ``` -------------------------------- ### Configure Systemd User Unit Source: https://github.com/gnome/evolution-data-server/blob/master/src/services/evolution-calendar-factory/CMakeLists.txt Configures and installs a systemd user service file if WITH_SYSTEMD_USER_UNITS is enabled. ```cmake set(SYSTEMD_SERVICE) if(WITH_SYSTEMD_USER_UNITS) set(SYSTEMD_SERVICE "SystemdService=evolution-calendar-factory.service") configure_file(evolution-calendar-factory.service.in evolution-calendar-factory.service @ONLY ) install(FILES ${CMAKE_CURRENT_BINARY_DIR}/evolution-calendar-factory.service DESTINATION ${WITH_SYSTEMDUSERUNITDIR} ) endif(WITH_SYSTEMD_USER_UNITS) ``` -------------------------------- ### Configure D-Bus Service Source: https://github.com/gnome/evolution-data-server/blob/master/src/services/evolution-addressbook-factory/CMakeLists.txt Configures the D-Bus service file for the address book factory. Installs the service file to the D-Bus service directory. ```cmake configure_file(org.gnome.evolution.dataserver.AddressBook.service.in ${ADDRESS_BOOK_DBUS_SERVICE_NAME}.service @ONLY ) install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${ADDRESS_BOOK_DBUS_SERVICE_NAME}.service DESTINATION ${WITH_DBUS_SERVICE_DIR} ) ``` -------------------------------- ### Configure and Install OAuth2 Handler Desktop Entry Source: https://github.com/gnome/evolution-data-server/blob/master/data/CMakeLists.txt Generates and installs the desktop entry for the OAuth2 handler. This is used to register custom URL schemes for OAuth2 authentication. ```cmake set(OAUTH2_SCHEMES "x-scheme-handler/eds-oauth2;") if(NOT WITH_GOOGLE_CLIENT_ID STREQUAL "") set(CMAKE_REQUIRED_DEFINITIONS ${DATA_SERVER_CFLAGS}) set(CMAKE_REQUIRED_INCLUDES ${CMAKE_BINARY_DIR} ${DATA_SERVER_INCLUDE_DIRS}) set(CMAKE_REQUIRED_LIBRARIES ${DATA_SERVER_LDFLAGS}) list(APPEND CMAKE_REQUIRED_DEFINITIONS -DG_LOG_DOMAIN=\"oauth2-value-helper\" -DBUILDING_VALUE_HELPER=1) file(TO_NATIVE_PATH "${CMAKE_BINARY_DIR}/oauth2-google-client-id" _binary_dir_to_file) CHECK_C_SOURCE_RUNS("#define DECODE_KEY \"${WITH_GOOGLE_CLIENT_ID}\"\ #define DECODE_TO_FILE \"${_binary_dir_to_file}\"\ #define DECODE_REVERSED 1\ #include \"${CMAKE_SOURCE_DIR}/src/libedataserver/e-oauth2-service.c\" ) " _decoded) file(READ ${_binary_dir_to_file} _google_oauth2_scheme) unset(_binary_dir_to_file) unset(_decoded) unset(CMAKE_REQUIRED_LIBRARIES) unset(CMAKE_REQUIRED_INCLUDES) unset(CMAKE_REQUIRED_DEFINITIONS) if(NOT _google_oauth2_scheme STREQUAL "") set(OAUTH2_SCHEMES "x-scheme-handler/${_google_oauth2_scheme};${OAUTH2_SCHEMES}") endif(NOT _google_oauth2_scheme STREQUAL "") unset(_google_oauth2_scheme) endif(NOT WITH_GOOGLE_CLIENT_ID STREQUAL "") configure_file(org.gnome.evolution-data-server.OAuth2-handler.desktop.in org.gnome.evolution-data-server.OAuth2-handler.desktop.in @ONLY ) i18n_merge_file(${CMAKE_CURRENT_BINARY_DIR}/org.gnome.evolution-data-server.OAuth2-handler.desktop.in org.gnome.evolution-data-server.OAuth2-handler.desktop ${CMAKE_SOURCE_DIR}/po) install(FILES ${CMAKE_CURRENT_BINARY_DIR}/org.gnome.evolution-data-server.OAuth2-handler.desktop DESTINATION ${desktopdir} ) ``` -------------------------------- ### Systemd User Unit Configuration Source: https://github.com/gnome/evolution-data-server/blob/master/src/services/evolution-alarm-notify/CMakeLists.txt Conditionally configures and installs the systemd user service file if WITH_SYSTEMD_USER_UNITS is enabled. ```cmake if(WITH_SYSTEMD_USER_UNITS) configure_file(evolution-alarm-notify.service.in evolution-alarm-notify.service @ONLY ) install(FILES ${CMAKE_CURRENT_BINARY_DIR}/evolution-alarm-notify.service DESTINATION ${WITH_SYSTEMDUSERUNITDIR} ) endif(WITH_SYSTEMD_USER_UNITS) ``` -------------------------------- ### Configure libebackend Vala Build Source: https://github.com/gnome/evolution-data-server/blob/master/src/vala/CMakeLists.txt Sets up the build for the 'libebackend' Vala library, including its dependencies on 'libedataserver', 'gio-2.0', 'libsoup-3.0', and 'libxml-2.0'. ```cmake set(gir_fullname ${CMAKE_BINARY_DIR}/src/libebackend/EBackend-${API_VERSION}.gir) gir_girfilename_to_target(gir_deps EBackend-${API_VERSION}.gir) set(gir_dirs ${CMAKE_BINARY_DIR}/src/camel ${CMAKE_BINARY_DIR}/src/libedataserver ${CMAKE_BINARY_DIR}/src/libebackend ) set(vala_deps *libedataserver-${API_VERSION} gio-2.0 libsoup-3.0 libxml-2.0 posix ) set(extra_vapigen_files) _build_vala_files(libebackend-${API_VERSION} gir_fullname gir_deps gir_dirs vala_deps extra_vapigen_files ) ``` -------------------------------- ### Configure libedataserverui Vala Build (GTK4) Source: https://github.com/gnome/evolution-data-server/blob/master/src/vala/CMakeLists.txt Sets up the build for the libedataserverui Vala library when GTK4 is enabled, defining dependencies and GIR file paths. ```cmake if(ENABLE_GTK4) set(gir_fullname ${CMAKE_BINARY_DIR}/src/libedataserverui/EDataServerUI4-${LIBEDATASERVERUI4_API_VERSION}.gir) gir_girfilename_to_target(gir_deps EDataServerUI4-${LIBEDATASERVERUI4_API_VERSION}.gir) set(gir_dirs ${CMAKE_BINARY_DIR}/src/camel ${CMAKE_BINARY_DIR}/src/libedataserver ${CMAKE_BINARY_DIR}/src/calendar/libecal ) set(vala_deps *libedataserver-${API_VERSION} *libecal-${CAL_API_VERSION} gio-2.0 gtk4 libsoup-3.0 libxml-2.0 posix ) set(extra_vapigen_files) _build_vala_files(libedataserverui4-${LIBEDATASERVERUI4_API_VERSION} gir_fullname gir_deps gir_dirs vala_deps extra_vapigen_files ) endif(ENABLE_GTK4) ``` -------------------------------- ### Configure libedata-book Vala Build Source: https://github.com/gnome/evolution-data-server/blob/master/src/vala/CMakeLists.txt Sets up the build for the libedata-book Vala library, including GIR file generation and dependency definitions. ```cmake set(gir_fullname ${CMAKE_BINARY_DIR}/src/addressbook/libedata-book/EDataBook-${API_VERSION}.gir) gir_girfilename_to_target(gir_deps EDataBook-${API_VERSION}.gir) set(gir_dirs ${CMAKE_BINARY_DIR}/src/camel ${CMAKE_BINARY_DIR}/src/libebackend ${CMAKE_BINARY_DIR}/src/libedataserver ${CMAKE_BINARY_DIR}/src/addressbook/libebook-contacts ) set(vala_deps *camel-${API_VERSION} *libedataserver-${API_VERSION} *libebackend-${API_VERSION} *libebook-contacts-${API_VERSION} gio-2.0 libsoup-3.0 libxml-2.0 posix ) set(extra_vapigen_files) _build_vala_files(libedata-book-${API_VERSION} gir_fullname gir_deps gir_dirs vala_deps extra_vapigen_files ) ``` -------------------------------- ### Set Install RPATH for camel-gpg-photo-saver Source: https://github.com/gnome/evolution-data-server/blob/master/src/camel/CMakeLists.txt Configures the Install RPATH for the camel-gpg-photo-saver executable to be empty. ```cmake set_target_properties(camel-gpg-photo-saver PROPERTIES INSTALL_RPATH "" ) ``` -------------------------------- ### Configure libebook Vala Build Source: https://github.com/gnome/evolution-data-server/blob/master/src/vala/CMakeLists.txt Sets up the build for the 'libebook' Vala library, including its dependencies on 'camel', 'libedataserver', 'libebook-contacts', 'gio-2.0', 'libsoup-3.0', and 'libxml-2.0'. ```cmake set(gir_fullname ${CMAKE_BINARY_DIR}/src/addressbook/libebook/EBook-${API_VERSION}.gir) gir_girfilename_to_target(gir_deps EBook-${API_VERSION}.gir) set(gir_dirs ${CMAKE_BINARY_DIR}/src/camel ${CMAKE_BINARY_DIR}/src/libedataserver ${CMAKE_BINARY_DIR}/src/addressbook/libebook-contacts ) set(vala_deps *camel-${API_VERSION} *libedataserver-${API_VERSION} *libebook-contacts-${API_VERSION} gio-2.0 libsoup-3.0 libxml-2.0 posix ) set(extra_vapigen_files) _build_vala_files(libebook-${API_VERSION} gir_fullname gir_deps gir_dirs vala_deps extra_vapigen_files ) ``` -------------------------------- ### Creating the Client Test Utilities Static Library Source: https://github.com/gnome/evolution-data-server/blob/master/tests/libebook/client/CMakeLists.txt Defines a static library named 'client-test-utils' using the specified source files. ```cmake add_library(client-test-utils STATIC ${SOURCES} ) ``` -------------------------------- ### Define Vala Files List Source: https://github.com/gnome/evolution-data-server/blob/master/src/vala/CMakeLists.txt Initializes the list of Vala-related files to be generated. ```cmake set(valafiles) add_custom_target(vala ALL) ``` -------------------------------- ### Configure libedataserverui Vala Build (GTK) Source: https://github.com/gnome/evolution-data-server/blob/master/src/vala/CMakeLists.txt Configures the build for the libedataserverui Vala library when GTK is enabled, specifying dependencies and GIR file paths. ```cmake if(ENABLE_GTK) set(gir_fullname ${CMAKE_BINARY_DIR}/src/libedataserverui/EDataServerUI-${API_VERSION}.gir) gir_girfilename_to_target(gir_deps EDataServerUI-${API_VERSION}.gir) set(gir_dirs ${CMAKE_BINARY_DIR}/src/camel ${CMAKE_BINARY_DIR}/src/libedataserver ${CMAKE_BINARY_DIR}/src/calendar/libecal ) set(vala_deps *libedataserver-${API_VERSION} *libecal-${CAL_API_VERSION} gio-2.0 gtk+-3.0 libsoup-3.0 libxml-2.0 posix ) set(extra_vapigen_files) _build_vala_files(libedataserverui-${API_VERSION} gir_fullname gir_deps gir_dirs vala_deps extra_vapigen_files ) endif(ENABLE_GTK) ``` -------------------------------- ### Create HTTP Calendar Backend Library Source: https://github.com/gnome/evolution-data-server/blob/master/src/calendar/backends/http/CMakeLists.txt Builds a loadable module library named 'ecalbackendhttp' using the defined source files. ```cmake add_library(ecalbackendhttp MODULE ${SOURCES} ) ``` -------------------------------- ### Configure libedata-cal Vala Build Source: https://github.com/gnome/evolution-data-server/blob/master/src/vala/CMakeLists.txt Sets up the build for the libedata-cal Vala library, defining GIR file locations and Vala dependencies. ```cmake set(gir_fullname ${CMAKE_BINARY_DIR}/src/calendar/libedata-cal/EDataCal-${CAL_API_VERSION}.gir) gir_girfilename_to_target(gir_deps EDataCal-${CAL_API_VERSION}.gir) set(gir_dirs ${CMAKE_BINARY_DIR}/src/camel ${CMAKE_BINARY_DIR}/src/libebackend ${CMAKE_BINARY_DIR}/src/libedataserver ${CMAKE_BINARY_DIR}/src/calendar/libecal ${CMAKE_BINARY_DIR}/src/calendar/libedata-cal ) set(vala_deps *camel-${API_VERSION} *libedataserver-${API_VERSION} *libebackend-${API_VERSION} *libecal-${CAL_API_VERSION} gio-2.0 libical-glib libsoup-3.0 libxml-2.0 posix ) set(extra_vapigen_files) _build_vala_files(libedata-cal-${CAL_API_VERSION} gir_fullname gir_deps gir_dirs vala_deps extra_vapigen_files ) ``` -------------------------------- ### Check for Data Server Dependencies Source: https://github.com/gnome/evolution-data-server/blob/master/CMakeLists.txt Uses pkg-config to find required libraries for the Data Server: gio-2.0, gmodule-2.0, libsecret-1, libxml-2.0, libsoup-3.0, NSPR, and NSS. ```cmake pkg_check_modules(DATA_SERVER REQUIRED gio-2.0 gmodule-2.0 libsecret-1>=${libsecret_minimum_version} libxml-2.0 libsoup-3.0 ${mozilla_nspr} ${mozilla_nss}) ``` -------------------------------- ### Define Executable Sources and Dependencies Source: https://github.com/gnome/evolution-data-server/blob/master/src/services/evolution-user-prompter/CMakeLists.txt Defines the source files for the evolution-user-prompter executable and lists its build dependencies. This sets up the core components of the service. ```cmake set(DEPENDENCIES ebackend ebook ebook-contacts edata-book edataserver ) set(SOURCES prompt-user.h prompt-user-gtk.c evolution-user-prompter.c ) add_executable(evolution-user-prompter ${SOURCES} ) add_dependencies(evolution-user-prompter ${DEPENDENCIES} ) ``` -------------------------------- ### Add Ebook Test Utilities Static Library Source: https://github.com/gnome/evolution-data-server/blob/master/tests/libebook/CMakeLists.txt Creates a static library named 'ebook-test-utils' using the specified source files. ```cmake add_library(ebook-test-utils STATIC ${SOURCES} ) ``` -------------------------------- ### Define Source Files for Library Source: https://github.com/gnome/evolution-data-server/blob/master/tests/libebook/CMakeLists.txt Lists the source files (.c and .h) that will be compiled into the ebook-test-utils static library. ```cmake set(SOURCES ebook-test-utils.c ebook-test-utils.h ) ``` -------------------------------- ### Add Static Library Source: https://github.com/gnome/evolution-data-server/blob/master/tests/libedata-book/CMakeLists.txt Creates a static library named 'data-book-test-utils' using the specified source files. ```cmake add_library(data-book-test-utils STATIC ${SOURCES} ) ``` -------------------------------- ### Configure camel Vala Build Source: https://github.com/gnome/evolution-data-server/blob/master/src/vala/CMakeLists.txt Sets up the build configuration for the 'camel' Vala library, including GIR paths, Vala dependencies, and custom Vala files. ```cmake set(gir_fullname ${CMAKE_BINARY_DIR}/src/camel/Camel-${API_VERSION}.gir) gir_girfilename_to_target(gir_deps Camel-${API_VERSION}.gir) set(gir_dirs ${CMAKE_BINARY_DIR}/src/camel ) set(vala_deps gio-2.0 libxml-2.0 posix ) set(extra_vapigen_files ${CMAKE_CURRENT_SOURCE_DIR}/camel-${API_VERSION}-custom.vala ) _build_vala_files(camel-${API_VERSION} gir_fullname gir_deps gir_dirs vala_deps extra_vapigen_files ) ``` -------------------------------- ### Control Test Execution and Installation Source: https://github.com/gnome/evolution-data-server/blob/master/src/camel/tests/misc/CMakeLists.txt Configures the behavior of the defined test suites, enabling general tests and check tests, while disabling skipped tests. It also iterates through check tests to add them as actual tests and conditionally install them. ```cmake add_camel_tests(TESTS ON) add_camel_tests(TESTS_CHECK ON) add_camel_tests(TESTS_SKIP OFF) foreach(_test ${TESTS_CHECK}) add_check_test(${_test}) install_test_if_enabled(${_test} "session-exclusive" "TEST_INSTALLED_SERVICES=1") endforeach(_test) ``` -------------------------------- ### Helper Macro for Building Vala Files Source: https://github.com/gnome/evolution-data-server/blob/master/src/vala/CMakeLists.txt A macro to automate the generation of VAPI files and manage dependencies for Vala projects. It configures VAPI directories, Vala package dependencies, and GIR dependencies. ```cmake macro(_build_vala_files _lib_name _gir_fullname_var _gir_deps_var _gir_dirs_var _vala_deps_var _extra_vapigen_files_var) list(APPEND valafiles ${CMAKE_CURRENT_BINARY_DIR}/${_lib_name}.deps ${CMAKE_CURRENT_BINARY_DIR}/${_lib_name}.vapi ) add_dependencies(vala ${${_gir_deps_var}}) set(gir_dirs_param) set(vala_deps_param) set(vala_deps_content "") set(vapi_deps) foreach(_item IN LISTS ${_gir_dirs_var}) list(APPEND gir_dirs_param --girdir=${_item}) endforeach() foreach(_item IN LISTS ${_vala_deps_var}) # those beginning with '*' are built here, thus # skip them from the vapigen arguments string(SUBSTRING "${_item}" 0 1 _item_prefix) if("${_item_prefix}" STREQUAL "*") string(SUBSTRING "${_item}" 1, -1, _item) list(APPEND vapi_deps ${CMAKE_CURRENT_BINARY_DIR}/${_item}.vapi) endif("${_item_prefix}" STREQUAL "*") list(APPEND vala_deps_param --pkg ${_item}) string(CONCAT vala_deps_content "${vala_deps_content}" "${_item}\n") endforeach() file(GENERATE OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${_lib_name}.deps CONTENT "${vala_deps_content}" ) add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${_lib_name}.vapi COMMAND ${VAPIGEN} --vapidir=${CMAKE_CURRENT_SOURCE_DIR} --vapidir=${CMAKE_CURRENT_BINARY_DIR} ${gir_dirs_param} --girdir=${SHARE_INSTALL_PREFIX}/gir-1.0 ${vala_deps_param} --library ${_lib_name} --metadatadir=${CMAKE_CURRENT_SOURCE_DIR} ${${_gir_fullname_var}} ${${_extra_vapigen_files_var}} DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${_lib_name}.deps ${vapi_deps} ${${_extra_vapigen_files_var}} ${${_gir_deps_var}} ${${_gir_fullname_var}} ) endmacro(_build_vala_files) ``` -------------------------------- ### Check libical-glib Version Source: https://github.com/gnome/evolution-data-server/blob/master/CMakeLists.txt Checks if the installed libical-glib version is at least 4.0. Sets LIBICAL_GLIB_API_VERSION accordingly. ```cmake pkg_check_at_least_version(HAVE_LIBICAL_GLIB_4X libical-glib 3.99) if(HAVE_LIBICAL_GLIB_4X) set(LIBICAL_GLIB_API_VERSION "4.0") else(HAVE_LIBICAL_GLIB_4X) set(LIBICAL_GLIB_API_VERSION "3.0") endif(HAVE_LIBICAL_GLIB_4X) ``` -------------------------------- ### Configure D-Bus Service File Source: https://github.com/gnome/evolution-data-server/blob/master/src/services/evolution-source-registry/CMakeLists.txt Configures the D-Bus service file for the Evolution Data Server Sources. ```cmake configure_file(org.gnome.evolution.dataserver.Sources.service.in ${SOURCES_DBUS_SERVICE_NAME}.service @ONLY ) install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${SOURCES_DBUS_SERVICE_NAME}.service DESTINATION ${WITH_DBUS_SERVICE_DIR} ) ``` -------------------------------- ### Set Include Directories Source: https://github.com/gnome/evolution-data-server/blob/master/src/addressbook/backends/file/CMakeLists.txt Configures public include directories for the 'ebookbackendfile' target. ```cmake target_include_directories(ebookbackendfile PUBLIC ${CMAKE_BINARY_DIR} ${CMAKE_BINARY_DIR}/src ${CMAKE_SOURCE_DIR}/src ${CMAKE_BINARY_DIR}/src/addressbook ${CMAKE_SOURCE_DIR}/src/addressbook ${ADDRESSBOOK_INCLUDE_DIRS} ${LIBDB_INCLUDE_DIRS} ) ``` -------------------------------- ### Add Subdirectories for Client and VCard Source: https://github.com/gnome/evolution-data-server/blob/master/tests/libebook/CMakeLists.txt Includes build configurations from the 'client' and 'vcard' subdirectories, allowing for modular build management. ```cmake add_subdirectory(client) add_subdirectory(vcard) ``` -------------------------------- ### Define Extra Compile Definitions Source: https://github.com/gnome/evolution-data-server/blob/master/tests/libebook/CMakeLists.txt Defines extra preprocessor macros for compilation, such as the installation directory for tests. Uses a CMake variable for flexibility. ```cmake set(extra_defines -DINSTALLED_TEST_DIR="${INSTALLED_TESTS_EXEC_DIR}" ) ``` -------------------------------- ### Check for libical-glib Recurrence Get By Functionality Source: https://github.com/gnome/evolution-data-server/blob/master/CMakeLists.txt Checks if the libical-glib library supports the i_cal_recurrence_get_by function. This is used to verify specific API features. ```cmake set(CMAKE_REQUIRED_DEFINITIONS ${CALENDAR_CFLAGS}) set(CMAKE_REQUIRED_INCLUDES ${CALENDAR_INCLUDE_DIRS}) set(CMAKE_REQUIRED_LIBRARIES ${CALENDAR_LDFLAGS}) CHECK_C_SOURCE_COMPILES("#define LIBICAL_GLIB_UNSTABLE_API 1 #include int main(void) { i_cal_recurrence_get_by (NULL, I_CAL_BY_MONTH, 0); return 0; }" HAVE_I_CAL_RECURRENCE_GET_BY) ``` -------------------------------- ### Check for Backend Dependencies Source: https://github.com/gnome/evolution-data-server/blob/master/CMakeLists.txt Uses pkg-config to find required libraries for the Backend module: gio-2.0, gmodule-2.0, libsoup-3.0, and libxml-2.0. ```cmake pkg_check_modules(BACKEND REQUIRED gio-2.0 gmodule-2.0 libsoup-3.0 libxml-2.0) ``` -------------------------------- ### Setting Include Directories for Client Test Utilities Source: https://github.com/gnome/evolution-data-server/blob/master/tests/libebook/client/CMakeLists.txt Configures public include directories for the 'client-test-utils' library, covering build, source, and backend-related paths. ```cmake target_include_directories(client-test-utils PUBLIC ${CMAKE_BINARY_DIR} ${CMAKE_BINARY_DIR}/src ${CMAKE_BINARY_DIR}/src/addressbook ${CMAKE_BINARY_DIR}/src/private ${CMAKE_BINARY_DIR}/tests/test-server-utils ${CMAKE_SOURCE_DIR}/src ${CMAKE_SOURCE_DIR}/src/addressbook ${CMAKE_SOURCE_DIR}/src/private ${CMAKE_SOURCE_DIR}/tests/test-server-utils ${BACKEND_INCLUDE_DIRS} ${DATA_SERVER_INCLUDE_DIRS} ${extra_incdirs} ) ``` -------------------------------- ### Configure libdb Check Source: https://github.com/gnome/evolution-data-server/blob/master/CMakeLists.txt Configures checks for the libdb library. It allows specifying installation paths, CFLAGS, and LIBS, and performs a compile check to ensure libdb is available. ```cmake add_printable_variable(WITH_LIBDB "Prefix where libdb is installed" ON) add_printable_variable(WITH_LIBDB_CFLAGS "Arguments required to compile with libdb" "") add_printable_variable(WITH_LIBDB_LIBS "Arguments required to link with libdb" "") if(WITH_LIBDB STREQUAL "") set(WITH_LIBDB ON) endif(WITH_LIBDB STREQUAL "") if(WITH_LIBDB) if(NOT (WITH_LIBDB OR ("${WITH_LIBDB}" STREQUAL "YES"))) set(LIBDB_CFLAGS "-I${WITH_LIBDB}/include") set(LIBDB_LIBS "-L${WITH_LIBDB}/lib -ldb") else(NOT (WITH_LIBDB OR ("${WITH_LIBDB}" STREQUAL "YES"))) if(("${WITH_LIBDB_CFLAGS}" STREQUAL "") AND ("${WITH_LIBDB_LIBS}" STREQUAL "")) set(LIBDB_CFLAGS "") set(LIBDB_LIBS "-ldb") else(("${WITH_LIBDB_CFLAGS}" STREQUAL "") AND ("${WITH_LIBDB_LIBS}" STREQUAL "")) set(LIBDB_CFLAGS ${WITH_LIBDB_CFLAGS}) set(LIBDB_LIBS ${WITH_LIBDB_LIBS}) endif(("${WITH_LIBDB_CFLAGS}" STREQUAL "") AND ("${WITH_LIBDB_LIBS}" STREQUAL "")) endif(NOT (WITH_LIBDB OR ("${WITH_LIBDB}" STREQUAL "YES"))) set(CMAKE_REQUIRED_DEFINITIONS ${LIBDB_CFLAGS}) set(CMAKE_REQUIRED_LIBRARIES ${LIBDB_LIBS}) CHECK_C_SOURCE_COMPILES("#include int main(void) { db_create(NULL, NULL, 0); return 0; }" HAVE_LIBDB) unset(CMAKE_REQUIRED_DEFINITIONS) unset(CMAKE_REQUIRED_LIBRARIES) if(NOT HAVE_LIBDB) message(FATAL_ERROR "libdb not found. Use -DWITH_LIBDB=PATH to specify the library prefix, or use -DWITH_LIBDB_CFLAGS=-I/path/to/db/include and -DWITH_LIBDB_LIBS=/path/to/db/lib to specify arguments for compiling and linking. If you want to disable libdb, please use -DWITH_LIBDB=OFF") endif(NOT HAVE_LIBDB) endif(WITH_LIBDB) ```