for a VisualStudio project, i'd like cMake to put all files from a specific folder into a specific filter.
I tried:
SOURCE_GROUP(Math FILES
${CMAKE_CURRENT_SOURCE_DIR}/src/Math/*.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/Math/*.h
)
however, this will place only the first found cpp and the first found h file into that filter. the rest of the files in the folder will be placed in the default Filters
How to do it properly?
You need to pass full names, not globbing expressions:
FILE(GLOB source_files
${CMAKE_CURRENT_SOURCE_DIR}/src/Math/*.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/Math/*.h
)
SOURCE_GROUP(Math FILES ${source_files})
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With