In my project CMake, I'm using file(Globe ...):
file(GLOB SOURCES
srcDir/srcA.cpp
srcDir/srcB.cpp
srcDir/srcC.cpp
srcDir/srcD.cpp
)
I read that file(GLOB ...) can be evil: cmake-file-glob-evil, glob pros / cons.
I can understand why using file(GLOB ...) with wildcard is not recommended:
file(GLOB SOURCES
srcDir/*
)
But I dont understand the difference between file(GLOB ...) to set(...) if I'm using it with specific files:
file(GLOB SOURCES
srcDir/srcA.cpp
srcDir/srcB.cpp
srcDir/srcC.cpp
srcDir/srcD.cpp
)
VS
set(SOURCES
srcDir/srcA.cpp
srcDir/srcB.cpp
srcDir/srcC.cpp
srcDir/srcD.cpp
)
############# Edit ##################
Side question: What's the "price" of using file(GLOB) instead of set()? Does it effect compilation time?