[Subtitles] Partial fix for text/border color gap
[xbmc.git] / cmake / scripts / common / GenerateVersionedFiles.cmake
blobd54b5242197fa9e0aa8be5399c39bb67525319d9
1 include(${CORE_SOURCE_DIR}/cmake/scripts/common/Macros.cmake)
3 core_find_versions()
5 # configure_file without dependency tracking
6 # configure_file would register additional file dependencies that interfere
7 # with the ones from add_custom_command (and the generation would happen twice)
8 function(generate_versioned_file _SRC _DEST)
9   file(READ ${CORE_SOURCE_DIR}/${_SRC} file_content)
10   string(CONFIGURE "${file_content}" file_content @ONLY)
11   file(WRITE ${CMAKE_BINARY_DIR}/${_DEST} "${file_content}")
12 endfunction()
14 # add-on xml's
15 file(GLOB ADDON_XML_IN_FILE ${CORE_SOURCE_DIR}/addons/*/addon.xml.in)
17 # remove 'xbmc.json', will be created from 'xbmc/interfaces/json-rpc/schema/CMakeLists.txt'
18 list(REMOVE_ITEM ADDON_XML_IN_FILE ${CORE_SOURCE_DIR}/addons/xbmc.json/addon.xml.in)
20 foreach(loop_var ${ADDON_XML_IN_FILE})
21   list(GET loop_var 0 xml_name)
23   string(REPLACE "/addon.xml.in" "" source_dir ${xml_name})
24   string(REPLACE ${CORE_SOURCE_DIR} ${CMAKE_BINARY_DIR} dest_dir ${source_dir})
25   file(MAKE_DIRECTORY ${dest_dir})
27   configure_file(${source_dir}/addon.xml.in ${dest_dir}/addon.xml @ONLY)
29   unset(source_dir)
30   unset(dest_dir)
31   unset(xml_name)
32 endforeach()
35 generate_versioned_file(xbmc/CompileInfo.cpp.in ${CORE_BUILD_DIR}/xbmc/CompileInfo.cpp)