title: CMake Warning: You have called ADD_LIBRARY for library my_src without any source files
body: <p>I'm trying to call add_library for all files with certain endings.</p>
  
  <p>The dir structure is:</p>
  
  <pre><code>src 
   | - CMakeLists.txt (1)
   | - main.cpp
   | - gui
        | - CMakeLists.txt (2)
        | - some source and header files
  </code></pre>
  
  <p>So currently all cc files are in the gui directory.</p>
  
  <p>(1) CMakeLists.txt:</p>
  
  <pre><code>file( GLOB_RECURSE my_sources *.cc ) 
  message(STATUS "my_sources = ${my_sources}")
  add_subdirectory( gui )
  add_library( my_src ${my_SOURCES} )
  
  target_link_libraries( my_src
    my_gui
  )
  qt5_use_modules( my_src Core Gui Widgets)
  </code></pre>
  
  <p>(2) CMakeLists.txt:</p>
  
  <pre><code>file( GLOB my_gui_sources *.cc)
  
  add_library( my_gui ${my_gui_sources} )
  qt5_use_modules( my_gui Core Gui Widgets)
  </code></pre>
  
  <p>But I keep getting this output:</p>
  
  <pre><code>You have called ADD_LIBRARY for library my_src without any source files. This typically indicates a problem with your CMakeLists.txt file
  -- my_sources = /home/bla/bla/src/gui/BorderLayout.cc;...;/home/bla/bla/my/src/gui/MainWindow.cc
  -- my_gui_sources = /home/bla/bla/my/src/gui/BorderLayout.cc;...;/home/bla/bla/my/src/gui/MainWindow.cc
  -- Configuring done
  -- Generating done
  -- Build files have been written to: /home/bla/bla/my/build
  </code></pre>
  
  <p>I know that I currently don't need the add_library in the first CMakeLists.txt, but later I will. I changed the first GLOB to GLOB_RECURSE, so that it finds at least anything.</p>