I've got a bunch of cpp files, each contains a main function. I just wish to compile all of them in the patter like:
add_executable(algorithm1 algorithm1.cpp)
add_executable(algorithm2 algorithm2.cpp)
...
add_executable(findFile findFile.cpp)
I hope there's simplier way to avoid very similar lines. I need sth like
add_executable(EXTRACT_FROM_FILENAME xxx.cpp)
one line for all.
My question: can we achieve to compile/link and get the executable which name is from the source file? I know Makefile has similar funtionality, what about CMake? So next time I add a new cpp file, I don't have to modify this CMakeLists.txt file, and it will automatically compile the new file to target executable, with corresponding filename.
Thanks a lot.