title: How to know in CMake that we are generating a package?
body: <p>I want a part of the <code>CMakeLists.txt</code> file to be ignored when a user calls </p>
  
  <pre><code>make package
  </code></pre>
  
  <p>I am therefore looking for a variable such as CMAKE_COMMAND or CMAKE_PACKAGING so that I could do </p>
  
  <pre><code>if (CMAKE_COMMAND EQUAL 'package') ...
  </code></pre>
  
  <p>or</p>
  
  <pre><code>if (CMAKE_PACKAGING) ...
  </code></pre>
  
  <p>Does this exist? Can it be achieved?</p>