User Tools

Site Tools


cmake_tips

Regular expression

Example of MATCH. CMake is a bit weird. The following example would match the file name without extension.

string(REGEX MATCH "(.+).c" match ${current_file})
if (NOT ${match} EQUALS "")
  set (current_target ${CMAKE_MATCH_1})
endif()
cmake_tips.txt · Last modified: 2018/08/06 21:35 by 90.196.61.50