file(GLOB sources "${PROJECTSOURCEDIR}/include/testy/*.h" "${PROJECTSOURCEDIR}/src/*.c")
- User
file(GLOB sources "{PROJECT_SOURCE_DIR}/src/*.c")
- Assistant
The snippet you've shared uses CMake's
file(GLOB ...)command to create a list of files that match given globbing expressions, and stores the list in a variable (in this case,sources). This command is used within CMake files to automatically include source and header files in the project without listing each file individually. Here's how the command works and what each part means:-
: This is the basic format of the command. It creates a list of files that match the given patterns and stores this list in .
-