Skip to content
Snippets Groups Projects
Select Git revision
  • 18e53b9ec83bf41f4b08431fe7e99a8bfaf6cd1f
  • master default
  • cmake_fixes
  • pulls/1772757862/750
  • copilot/fix-770
  • windows_ci_static
  • c_link
  • cpack
  • windows_ci
  • cert_pk_id
  • proxy_push_result
  • cnode_put_id
  • update-windows-build
  • proxy
  • resubscribe_on_token_change
  • actions
  • client_mode
  • llhttp
  • search_node_add
  • crypto_aes_gcm_argon2
  • ios_notifications
  • v3.4.0
  • v3.3.1
  • v3.3.1rc1
  • v3.3.1rc2
  • v3.3.0
  • v3.2.0
  • v3.1.11
  • v3.1.10
  • v3.1.9
  • v3.1.8.2
  • v3.1.8.1
  • v3.1.8
  • v3.1.7
  • v3.1.6
  • v3.1.5
  • v3.1.4
  • v3.1.3
  • v3.1.2
  • v3.1
  • v3.0.1
41 results

log.cpp

Blame
  • Code owners
    Assign users and groups as approvers for specific file changes. Learn more.
    GResources.cmake 2.53 KiB
    # The code below was taken from the Venom project which is released under the
    # GNU General Public License, version 3
    #
    # Copyright (C) 2013 Venom authors and contributors
    #
    # See https://github.com/naxuroqa/Venom for a list of contributors.
    #
    # This program is free software; you can redistribute it and/or modify
    # it under the terms of the GNU General Public License as published by
    # the Free Software Foundation; either version 3 of the License, or
    # (at your option) any later version.
    #
    # This program is distributed in the hope that it will be useful,
    # but WITHOUT ANY WARRANTY; without even the implied warranty of
    # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    # GNU General Public License for more details.
    #
    # You should have received a copy of the GNU General Public License
    # along with this program; if not, write to the Free Software
    # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301 USA.
    #
    
    FIND_PROGRAM(GLIB_COMPILE_RESOURCES_EXECUTABLE NAMES glib-compile-resources)
    MARK_AS_ADVANCED(GLIB_COMPILE_RESOURCES_EXECUTABLE)
    
    INCLUDE(CMakeParseArguments)
    
    FUNCTION(GLIB_COMPILE_RESOURCES output)
      CMAKE_PARSE_ARGUMENTS(ARGS "" "SOURCE" ${ARGN})
      SET(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
      SET(out_files "")
    
      FOREACH(src ${ARGS_SOURCE} ${ARGS_UNPARSED_ARGUMENTS})
        SET(in_file "${CMAKE_CURRENT_SOURCE_DIR}/${src}")
        GET_FILENAME_COMPONENT(WORKING_DIR ${in_file} PATH)
        STRING(REPLACE ".xml" ".c" src ${src})
        SET(out_file "${DIRECTORY}/${src}")
        GET_FILENAME_COMPONENT(OUPUT_DIR ${out_file} PATH)
        FILE(MAKE_DIRECTORY ${OUPUT_DIR})
        LIST(APPEND out_files "${DIRECTORY}/${src}")
    
        #FIXME implicit depends currently not working
        EXECUTE_PROCESS(
          COMMAND
            ${GLIB_COMPILE_RESOURCES_EXECUTABLE}
              "--generate-dependencies"
              ${in_file}
          WORKING_DIRECTORY ${WORKING_DIR}
          OUTPUT_VARIABLE in_file_dep
        )
        STRING(REGEX REPLACE "(\r?\n)" ";" in_file_dep "${in_file_dep}")
        SET(in_file_dep_path "")
        FOREACH(dep ${in_file_dep})
          LIST(APPEND in_file_dep_path "${WORKING_DIR}/${dep}")
        ENDFOREACH(dep ${in_file_dep})
        ADD_CUSTOM_COMMAND(
          OUTPUT ${out_file}
          WORKING_DIRECTORY ${WORKING_DIR}
          COMMAND
            ${GLIB_COMPILE_RESOURCES_EXECUTABLE}
          ARGS
            "--generate-source"
            "--target=${out_file}"
            ${in_file}
          DEPENDS
            ${in_file};${in_file_dep_path}
        )
      ENDFOREACH(src ${ARGS_SOURCES} ${ARGS_UNPARSED_ARGUMENTS})
      SET(${output} ${out_files} PARENT_SCOPE)
    ENDFUNCTION(GLIB_COMPILE_RESOURCES)