In the src directory, you should have another CMakeLists.txt file, this time probably defining a target or two. Let's add an executable for a customer microservice for the Dominican Fair system we mentioned earlier in the book:
add_executable(customer main.cpp)
Source files can be specified as in the preceding code line or added later using target_sources.
A common CMake antipattern is the use of globs to specify source files. A big drawback of using them is that CMake will not know if a file was added until it reruns generation. A common consequence of that is that if you pull changes from a repository and simply build, you can miss compiling and running new unit tests or other code. Even if you used globs with CONFIGURE_DEPENDS, the build time will get longer because globs must be checked as part of each build. Besides, the flag may not work reliably with all generators. Even the CMake authors discourage using it in favor of just explicitly stating...