User Tools

Site Tools


cmake_tips

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

cmake_tips [2018/08/06 21:31]
90.196.61.50 created
cmake_tips [2018/08/06 21:35] (current)
90.196.61.50
Line 1: Line 1:
 ====== Regular expression ====== ====== Regular expression ======
  
-Example of MATCH +Example of MATCH. CMake is a bit weird. The following example would match the file name without extension.
  
 +<code cmake>
 +string(REGEX MATCH "​(.+).c"​ match ${current_file})
 +if (NOT ${match} EQUALS ""​)
 +  set (current_target ${CMAKE_MATCH_1})
 +endif()
 +</​code>​
cmake_tips.txt · Last modified: 2018/08/06 21:35 by 90.196.61.50