I have the following dir [sub]structure:
├── src
│ ├── Mistery
│ │ ├── IntegrationTests
│ │ └── mistery.txt
│ ├── SomeFolder
│ │ └── AnotherFolder
│ └── UnitTests
And I try to find all directories which end with “Tests”. Here is a small cmake code for that:
file(GLOB_RECURSE TEST_FOLDERS LIST_DIRECTORIES true RELATIVE "${CMAKE_SOURCE_DIR}" src/*Tests)
message("Folders: ${TEST_FOLDERS}")
And here is the output:
Folders: src/Mistery;src/Mistery/IntegrationTests;src/SomeFolder;src/SomeFolder/AnotherFolder;src/UnitTests
As you can see instead of returning all the directories which end with “Tests” it just returned all the directories it found, the only thing it filtered out is the mistery.txt
file. What am I doing wrong?