title: Project compiling with raylib static library
body: <p>I am trying to create a game with the Raylib library. I just was until now just trying around inside the <code>main.cpp</code> and always compiled my code with this line inside the terminal. </p>
  
  <pre><code>clang -std=c++11 -framework CoreVideo -framework IOKit -framework Cocoa -framework GLUT -framework OpenGL  libraylib.a main.cpp -o my_app
  </code></pre>
  
  <p>Now I want to recreate the Snake game just for fun. I thought I would be wise the spilt the main.cpp into multiple src files but I actually don't know how I should compile all of this. I tried to create a CMakeList.txt like this: </p>
  
  <pre><code>cmake_minimum_required (VERSION 3.0)
  
  set(CMAKE_BUILD_TYPE Debug)
  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -framework CoreVideo")
  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -framework IOKit")
  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -framework Cocoa")
  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -framework GLUT")
  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -framework OpenGL")
  
  project(Snake)
  
  add_executable(
      Snake
      main.cpp
      Snake.cpp
  )
  target_link_libraries(main ${CMAKE_SOURCE_DIR}/librarylib.a)
  </code></pre>
  
  <p>but this doesn't work. This is the Error message. </p>
  
  <pre><code>  CMake Error at CMakeLists.txt:18 (target_link_libraries):
    Cannot specify link libraries for target "main" which is not built by this
    project.
  
  
  -- Configuring incomplete, errors occurred!
  </code></pre>
  
  <p>Are there better ways to compile this project and can anyone explain to me what the <code>-framework</code> flag actually does?  I still want to use VSCode because I want to learn how to use the terminal a bit better.  </p>
  
  <p>Edit: Information form <code>brew ls --verbose raylib</code>:</p>
  
  <pre><code>/usr/local/Cellar/raylib/2.5.0/LICENSE.md
  /usr/local/Cellar/raylib/2.5.0/INSTALL_RECEIPT.json
  /usr/local/Cellar/raylib/2.5.0/.brew/raylib.rb
  /usr/local/Cellar/raylib/2.5.0/CHANGELOG
  /usr/local/Cellar/raylib/2.5.0/include/raylib.h
  /usr/local/Cellar/raylib/2.5.0/HISTORY.md
  /usr/local/Cellar/raylib/2.5.0/README.md
  /usr/local/Cellar/raylib/2.5.0/lib/pkgconfig/raylib.pc
  /usr/local/Cellar/raylib/2.5.0/lib/cmake/raylib/raylib-config-version.cmake
  /usr/local/Cellar/raylib/2.5.0/lib/cmake/raylib/raylib-config.cmake
  /usr/local/Cellar/raylib/2.5.0/lib/libraylib.2.5.0.dylib
  /usr/local/Cellar/raylib/2.5.0/lib/libraylib.2.dylib
  /usr/local/Cellar/raylib/2.5.0/lib/libraylib.a
  /usr/local/Cellar/raylib/2.5.0/lib/libraylib.dylib
  </code></pre>