[CMake] source_group for all subdirectories

tonka3100 at gmail.com tonka3100 at gmail.com
Wed Sep 19 15:31:47 EDT 2018


Hey,

I want to use cmakes source_group with regex. As long as the command is in the same file as my target everything works fine, but I want to set the source_group in my main CMakeLists.txt file, because I have many sub_directories. Is it possible to set a cmake config to pass it down to my subdirectories?

example

source_group("Source Files" REGULAR_EXPRESSION ".*\\.cpp")
source_group("Header Files" REGULAR_EXPRESSION ".*\\.h")
source_group("Ui Files" REGULAR_EXPRESSION ".*\\.ui")
source_group("Resource Files" REGULAR_EXPRESSION ".*\\.qrc")
add_subdirectory(src)

Greetings
Tonka

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://cmake.org/pipermail/cmake/attachments/20180919/1b24698a/attachment.html>


More information about the CMake mailing list