A very strange make problem existed in Cmake add_library functions

Hi friends,

Is there anyone who met the strange problem when making project on the linux or win system?
demotest.zip (1.2 KB)

Cmake on the linux platform:

Cmake on the windows platform:

However, after I change the add_library(demolib DEMO.f90 fun.f90) in the original CMakeLists.txt to add_library(demolib DEMO.f90). “make” run OK after removing “fun.f90”. Why “fun.f90” cannot be included in the Cmake add_library?

Besides, when I replace add_library(demolib DEMO.f90 fun.f90) to

set(LIB_SOURCES DEMO.f90 fun.f90)
add_library(demolib ${LIB_SOURCES})

same error will occur. Can someone explain the reason behind this?