title: How to create your own compilation key in C++
body: <p>You have your own cmake c++ project, you need to create a compilation key and get information about it in the code.</p>
  
  <p>I need something like this.</p>
  
  <p>in CmakeLists.txt:</p>
  
  <pre><code>set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -myTest")
  </code></pre>
  
  <p>in *.cpp</p>
  
  <pre><code>if(KEY == "myTest"){
      // testing code.
  }
  </code></pre>