GenQrc.cmake 599 B

123456789101112131415161718192021222324252627
  1. # GenQrcScript.cmake - Copyright (c) 2015 Lukas W <lukaswhl/at/gmail.com>
  2. INCLUDE(CMakeParseArguments)
  3. FILE(REMOVE ${OUT_FILE})
  4. MACRO(OUT STRING)
  5. FILE(APPEND ${OUT_FILE} "${STRING}\n")
  6. ENDMACRO()
  7. IF(NOT DEFINED RC_PREFIX)
  8. SET(RC_PREFIX "/")
  9. ENDIF()
  10. # Write qrc file
  11. OUT("<RCC>")
  12. OUT(" <qresource prefix=\"${RC_PREFIX}\">")
  13. FOREACH(VAR ${FILES})
  14. GET_FILENAME_COMPONENT(FILENAME ${VAR} NAME)
  15. IF(IS_ABSOLUTE ${VAR})
  16. OUT(" <file alias=\"${FILENAME}\">${VAR}</file>")
  17. ELSE()
  18. OUT(" <file alias=\"${FILENAME}\">${DIR}/${VAR}</file>")
  19. ENDIF()
  20. ENDFOREACH()
  21. OUT(" </qresource>")
  22. OUT("</RCC>")