Escaping end of line anker in regex

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

Escaping end of line anker in regex

Torsten Robitzki
I’ve stumbled over following issue:

if (NOT ^ MATCHES ^\^ )
    message(FATAL_ERROR "Anker not found!")

  if (NOT $<foo MATCHES ^\$<)
    message(FATAL_ERROR "Start of generator expression not found!")

If run (with version 3.13), this yields:

  $ cmake -P test.cmake
  CMake Error at test.cmake:7 (message):
    Start of generator expression not found!

If I double escape the regex in the second if (^\\$<), then this works as expected. Any idea, why I have to double escape the $-anker? Is this a bug?

Kind regards,



Powered by

Please keep messages on-topic and check the CMake FAQ at:

Kitware offers various services to support the CMake community. For more information on each offering, please visit:

CMake Support:
CMake Consulting:
CMake Training Courses:

Visit other Kitware open-source projects at

Follow this link to subscribe/unsubscribe:

signature.asc (849 bytes) Download Attachment