title: Cannot open output file : Is a directory collect2: ld returned 1 exit status
body: <p>I am using CLion code editor.
  I have such structure of project:</p>
  
  <p><a href="https://i.stack.imgur.com/JT6PD.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/JT6PD.png" alt="enter image description here"></a></p>
  
  <p>This is the content of CMakeLists.txt:</p>
  
  <pre><code>cmake_minimum_required(VERSION 3.4)
  project(FirstAgent)
  
  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
  set(SOURCE_FILES main.c)
  add_executable(FirstAgent ${SOURCE_FILES})
  target_link_libraries(FirstAgent simgrid)
  </code></pre>
  
  <p>But when I run my program in the code editor the error occur:</p>
  
  <pre><code>/usr/bin/ld: cannot open output file FirstAgent: Is a directory
  collect2: error: ld returned 1 exit status
  make[3]: *** [FirstAgent] Error 1
  make[2]: *** [CMakeFiles/FirstAgent.dir/all] Error 2
  make[1]: *** [CMakeFiles/FirstAgent.dir/rule] Error 2
  make: *** [FirstAgent] Error 2
  </code></pre>
  
  <p>How can I avoid it?</p>