Fix T65852: Cmake fails with paths containing special characters.

MATHES performs a regular expression which in this case is unnecessary.
This commit is contained in:
Germano Cavalcante 2019-06-17 23:55:01 -03:00
parent 741641f4c3
commit 5e768200c2
Notes: blender-bot 2023-02-14 02:10:55 +01:00
Referenced by issue #65852, make fails if a "+" character is in the path (compiling issue)
1 changed files with 2 additions and 1 deletions

View File

@ -179,7 +179,8 @@ function(blender_source_group
# remove ../'s
get_filename_component(_SRC_DIR ${_SRC} REALPATH)
get_filename_component(_SRC_DIR ${_SRC_DIR} DIRECTORY)
if(${_SRC_DIR} MATCHES "${CMAKE_CURRENT_SOURCE_DIR}/")
string(FIND ${_SRC_DIR} "${CMAKE_CURRENT_SOURCE_DIR}/" _POS)
if(NOT _POS EQUAL -1)
string(REPLACE "${CMAKE_CURRENT_SOURCE_DIR}/" "" GROUP_ID ${_SRC_DIR})
string(REPLACE "/" "\\" GROUP_ID ${GROUP_ID})
source_group("${GROUP_ID}" FILES ${_SRC})