I use CMake not so long ago and I stumbled upon such a problem, I can’t say, but rather an example that I don’t understand;
... set (NETWORK_PATH Network) set (NETWORK ${NETWORK_PATH}/IServer.h ${NETWORK_PATH}/Server.h ${NETWORK_PATH}/Server.cpp ${NETWORK_PATH}/Client.h ${NETWORK_PATH}/Client.cpp) ... set (SOURCES main.cpp ${DATA_OBJECTS} ${EXCEPTIONS} ${NETWORK} ${UTILS} ${SYSTEM_CHECKING}) ... add_executable(${PROJECT_NAME} ${SOURCES}) ... As you can see from this example, I split everything into directories in Cmake and then collect everything in the SOURCES variable and then give it to the link to the executable file. The question is this ... Is it possible to somehow automatically include files, for example, there is a scan of packages like in Java using Maven? Because this approach that I am using now is a bit tiring ... you have to delete each file and add it manually ...