0

I am trying to use Qt for my large project with different subprojects. I need to find all *.cpp *.h *.ui files to create *.ts files and apply them for qt5_create_translation. Could you help me how to do it?

I tried to use

file(GLOB ${ALL_USE_FILES} ${CMAKE_CURRENT_SOURCE_DIR}/*.*)

but it won't work.

Tsyvarev
  • 60,011
  • 17
  • 110
  • 153
Marat
  • 1
  • 1
  • The second argument to `find(GLOB)` is a **variable name** (`ALL_USE_FILES`). You should NOT *dereference* it here (`${ALL_USE_FILES}`). See e.g. this answer: https://stackoverflow.com/a/3201211/3440745 – Tsyvarev Oct 02 '18 at 08:10
  • Thanks, but I need to find recursive all files in subdirectories. – Marat Oct 02 '18 at 08:44
  • Then use `file(GLOB_RECURSE)` as described in this question: https://stackoverflow.com/a/35433745/3440745. (It is strange that you haven't found it while googling). – Tsyvarev Oct 02 '18 at 09:02
  • Thanks for the help!!! – Marat Oct 03 '18 at 09:10
  • Possible duplicate of [Add all files under a folder to a CMake glob?](https://stackoverflow.com/questions/35411489/add-all-files-under-a-folder-to-a-cmake-glob) – Tsyvarev Oct 03 '18 at 10:54

0 Answers0