title: Naming convention for components and namespaces in cmake
body: <p><strong>In Short:</strong>  </p>
  
  <p>Is there any preferred naming convention for cmake library targets - in particular when using namespaces?</p>
  
  <p><strong>Note:</strong></p>
  
  <p>Unless there is really an objective reason for it, I'm not asking about personal preferences, but whether there is either an "official" (e.g. recommended by kitware) or established (which might deviate) convention.</p>
  
  <p><strong>Details:</strong></p>
  
  <p>Lets say I have a library/framework <code>foo</code> which has the individual components <code>bar</code> and <code>baz</code>. So far, my naming convention looks like this: </p>
  
  <pre><code>add_library(foo-bar src1.cpp, scr2.cpp)
  add_library(foo-baz src3.cpp, src4.cpp)
  </code></pre>
  
  <p>Now I want to add alias targets using the namespace (<code>::</code>) convention. E.g.</p>
  
  <pre><code>add_library(Foo::Bar ALIAS foo-bar)
  add_library(Foo::Baz ALIAS foo-baz)
  </code></pre>
  
  <p>(Of course the question also extends to export sets, but I didn't want to complicate the question)<br>
  What I couldn't really find out however, is if there is a preferred or even official naming convention for those targets. </p>
  
  <p>Things I've seen:</p>
  
  <ul>
  <li><strong>Namespace part:</strong> 
  
  <ul>
  <li>some projects seem to capitalize the first letter, some not (the former seems to be more common)</li>
  </ul></li>
  <li><strong>Component part:</strong> 
  
  <ul>
  <li>in some projects, the component name is the same as the binary name </li>
  <li>with or without the "lib" prefix (libfoo-bar vs foo-bar)</li>
  <li>with or without the namespace (foo-bar vs bar)</li>
  <li>some projects capitalize the first letter</li>
  <li>some projects use CamelCase some snake_case, even if the binaries or  project names don't follow those conventions.</li>
  </ul></li>
  </ul>
  
  <p>I guess the main problem is that there is no naming convention for libraries in general so that makes it hard to come up with a naming convention in CMake, but at least the capitilization for the first letter of the namespace and the component seem to be pretty common, so I was wondering if there is some guideline I should follow for future projects.</p>