I'm just getting started with cmake, I've read some tutorials and got the basic stuff working.
However currently my CMakesList.txt generates a Makefile that has every .cpp explicitly named. That means, whenever I add a new .cpp to my project, I need to rerun cmake, before I can make. While this is not a huge deal, it's still a bit annoying.
Since Makefiles can do something like SOURCES=*.cpp
, I thought there's probably a way to tell cmake to generate the Makefile with such a rule!?
I know I can do
cmake_minimum_required(VERSION 2.8)
file(GLOB SRC
"*.h"
"*.cpp"
)
add_executable(main ${SRC})
but with that I still have to rerun cmake.