1file(GLOB_RECURSE modern_rc_deps ${CMAKE_CURRENT_BINARY_DIR}/bitmaps/* ${CMAKE_CURRENT_BINARY_DIR}/lang/* ${CMAKE_CURRENT_BINARY_DIR}/textfiles/*)
2add_rc_deps(modern.rc ${modern_rc_deps})
3
4list(APPEND TEXTFILES
5    textfiles/Light/ExtraLargeLight.INI
6    textfiles/Light/LargeFontsLight.INI
7    textfiles/Light/RegularLight.INI
8    textfiles/Dark/ExtraLargeDark.INI
9    textfiles/Dark/LargeFontsDark.INI
10    textfiles/Dark/RegularDark.INI)
11
12file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/textfiles)
13foreach(_file ${TEXTFILES})
14    get_filename_component(_file_name ${_file} NAME_WE)
15    get_filename_component(_subdir ${_file} DIRECTORY)
16    file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${_subdir})
17    set(_converted_file ${CMAKE_CURRENT_BINARY_DIR}/${_subdir}/${_file_name}_utf16.INI)
18    add_custom_command(OUTPUT ${_converted_file}
19                       COMMAND native-utf16le ${CMAKE_CURRENT_SOURCE_DIR}/${_file} ${_converted_file}
20                       DEPENDS native-utf16le ${CMAKE_CURRENT_SOURCE_DIR}/${_file})
21    list(APPEND _converted_files ${_converted_file})
22endforeach()
23
24set_source_files_properties(modern.rc PROPERTIES OBJECT_DEPENDS "${_converted_files}")
25add_library(modern.msstyles MODULE modern.rc)
26set_module_type(modern.msstyles module)
27set_target_properties(modern.msstyles PROPERTIES SUFFIX "")
28add_cd_file(TARGET modern.msstyles DESTINATION reactos/Resources/Themes/Modern FOR all)
29