title: check if a string ends with a name in CMake
body: <p>I want to check if the <code>CMAKE_SOURCE_DIR</code> variable ends with a specific name. I need to use <code>MATCHES</code> for it, but it does not seems to work.</p>
  
  <p>I've written:</p>
  
  <pre><code>IF(CMAKE_SOURCE_DIR MATCHES "*MyFolderName")
  # code
  ENDIF(CMAKE_SOURCE_DIR MATCHES "*MyFolderName")
  </code></pre>
  
  <p>But it does not work. I obtain the following error:</p>
  
  <pre><code>RegularExpression::compile(): ?+* follows nothing.
  RegularExpression::compile(): Error in compile
  </code></pre>
  
  <p>Want can I do in order to fix the match?</p>