title: How to make CLion insert generated code.... in .cpp files
body: <p>Generating code in CLion always result in having the methods implemented in the header files, I've always been taught that they should go in .cpp files, how can I change that behavior and is it even possible ?</p>
  
  <p>Example :</p>
  
  <p>In a project containing a main.cpp and a test class (test.hpp, and test.cpp).</p>
  
  <p>The CMake file is as follow:</p>
  
  <pre><code>cmake_minimum_required(VERSION 3.3)
  project(testClion)
  
  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
  
  set(SOURCE_FILES main.cpp
                  test.cpp
                  test.hpp)
  add_executable(testClion ${SOURCE_FILES})
  </code></pre>
  
  <p>(note that this is the default file provided by clion, I haven't changed anything)</p>
  
  <p><strong>test.hpp</strong> </p>
  
  <pre><code>#ifndef TESTCLION_TEST_HPP
  #define TESTCLION_TEST_HPP
  
  class test
  {
   protected:
    int test;
  };
  
  
  #endif //TESTCLION_TEST_HPP
  </code></pre>
  
  <p><strong>test.cpp</strong></p>
  
  <pre><code>#include "test.hpp"
  </code></pre>
  
  <p>Pressing ALT + INSERT and generating getters/setters while being in test.hpp OR test.cpp only changes the test.hpp:</p>
  
  <p><strong>test.hpp</strong></p>
  
  <pre><code>#ifndef TESTCLION_TEST_HPP
  #define TESTCLION_TEST_HPP
  
  class test
  {
  
   public:
    int getTest() const
    {
      return test;
    }
    void setTest(int test)
    {
      test::test = test;
    }
   protected:
    int test;
  };
  
  
  #endif //TESTCLION_TEST_HPP
  </code></pre>