diff options
Diffstat (limited to 'cmake/Modules/GlibCompileSchemas.cmake')
| -rw-r--r-- | cmake/Modules/GlibCompileSchemas.cmake | 49 |
1 files changed, 0 insertions, 49 deletions
diff --git a/cmake/Modules/GlibCompileSchemas.cmake b/cmake/Modules/GlibCompileSchemas.cmake deleted file mode 100644 index 90f6a10..0000000 --- a/cmake/Modules/GlibCompileSchemas.cmake +++ /dev/null @@ -1,49 +0,0 @@ -# SPDX-FileCopyrightText: 2025 Felix Morgner <felix.morgner@gmail.com> -# SPDX-License-Identifier: LGPL-2.1-only - -find_program(GLIB_COMPILE_SCHEMAS_BIN - NAMES "glib-compile-schemas" - REQUIRED -) - -function(target_add_glib_schemas TARGET) - set(SINGLE_VALUE_ARGS "SCHEMA_DIR") - cmake_parse_arguments( - PARSE_ARGV 1 - "" - "${OPTIONS}" - "${SINGLE_VALUE_ARGS}" - "${MULTI_VALUE_ARGS}" - ) - - if(NOT TARGET "${TARGET}") - message(FATAL_ERROR "Target '${TARGET}' does not exist") - endif() - - if(NOT IS_ABSOLUTE "${_SCHEMA_DIR}") - get_filename_component(_SCHEMA_DIR "${_SCHEMA_DIR}" REALPATH) - endif() - - if(NOT IS_DIRECTORY "${_SCHEMA_DIR}") - message(FATAL_ERROR "Directory '${_SCHEMA_DIR}' does not exists") - endif() - - file(GLOB SCHAMA_FILES CONFIGURE_DEPENDS "${_SCHEMA_DIR}/*.gschema.xml") - - add_custom_command(OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/glib-2.0/schemas/gschemas.compiled" - WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}" - COMMAND "${GLIB_COMPILE_SCHEMAS_BIN}" - ARGS - "--targetdir=${CMAKE_CURRENT_BINARY_DIR}/glib-2.0/schemas" - "--strict" - "${_SCHEMA_DIR}" - VERBATIM - COMMENT "Compiling gsettings schemas" - DEPENDS - ${SCHEMA_FILES} - ) - - add_custom_target("${TARGET}_schemas" DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/glib-2.0/schemas/gschemas.compiled") - - add_dependencies("${TARGET}" "${TARGET}_schemas") -endfunction() |
