1 include(${CORE_SOURCE_DIR}/cmake/scripts/common/Macros.cmake)
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}")
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)
35 generate_versioned_file(xbmc/CompileInfo.cpp.in ${CORE_BUILD_DIR}/xbmc/CompileInfo.cpp)