Fix error failed to compile regex

This error occurred when the path to the project contained regular expression characters.
This commit is contained in:
Heckad 2018-11-14 03:27:55 +10:00 committed by Sergey Vojtovich
parent 39f195052c
commit 17cbae6501

View file

@ -15,11 +15,12 @@
file(GLOB
PLUGIN_CMAKE_LISTS_LIST
RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}"
"${CMAKE_CURRENT_SOURCE_DIR}/*/CMakeLists.txt")
if(PLUGIN_CMAKE_LISTS_LIST)
foreach(PLUGIN_CMAKE_LISTS "${PLUGIN_CMAKE_LISTS_LIST}")
string(REGEX REPLACE
"(^${CMAKE_CURRENT_SOURCE_DIR}/+|/+CMakeLists\\.txt$)" ""
"(/+CMakeLists\\.txt$)" ""
PLUGIN_DIR
"${PLUGIN_CMAKE_LISTS}")
add_subdirectory("${PLUGIN_DIR}")