From a27815fa7d59029f624ff7472c840c13a2b5098e Mon Sep 17 00:00:00 2001 From: Koncord Date: Sat, 22 Apr 2017 13:54:41 +0800 Subject: [PATCH] [General] Allow backslashes in add_component_dir to specify subgroups --- cmake/OpenMWMacros.cmake | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/cmake/OpenMWMacros.cmake b/cmake/OpenMWMacros.cmake index 37c61aebc..aacd12c7e 100644 --- a/cmake/OpenMWMacros.cmake +++ b/cmake/OpenMWMacros.cmake @@ -50,8 +50,9 @@ macro (add_component_dir dir) set (files) set (cppfiles) + string(REGEX REPLACE "\\\\" "/" newDir ${dir}) foreach (u ${ARGN}) - file (GLOB ALL "${dir}/${u}.[ch]pp") + file (GLOB ALL "${newDir}/${u}.[ch]pp") foreach (f ${ALL}) list (APPEND files "${f}") @@ -59,7 +60,7 @@ macro (add_component_dir dir) endforeach (f) # Add cpp to unity build - file (GLOB ALL "${dir}/${u}.cpp") + file (GLOB ALL "${newDir}/${u}.cpp") foreach (f ${ALL}) list (APPEND cppfiles "${f}") endforeach (f) @@ -67,8 +68,8 @@ macro (add_component_dir dir) endforeach (u) if (OPENMW_UNITY_BUILD) - enable_unity_build(${dir} "${cppfiles}") - list (APPEND COMPONENT_FILES ${CMAKE_CURRENT_BINARY_DIR}/ub_${dir}.cpp) + enable_unity_build(${newDir} "${cppfiles}") + list (APPEND COMPONENT_FILES ${CMAKE_CURRENT_BINARY_DIR}/ub_${newDir}.cpp) endif() source_group ("components\\${dir}" FILES ${files})