[General] Allow backslashes in add_component_dir to specify subgroups

pull/176/merge
Koncord 8 years ago
parent a5484d237b
commit a27815fa7d

@ -50,8 +50,9 @@ macro (add_component_dir dir)
set (files) set (files)
set (cppfiles) set (cppfiles)
string(REGEX REPLACE "\\\\" "/" newDir ${dir})
foreach (u ${ARGN}) foreach (u ${ARGN})
file (GLOB ALL "${dir}/${u}.[ch]pp") file (GLOB ALL "${newDir}/${u}.[ch]pp")
foreach (f ${ALL}) foreach (f ${ALL})
list (APPEND files "${f}") list (APPEND files "${f}")
@ -59,7 +60,7 @@ macro (add_component_dir dir)
endforeach (f) endforeach (f)
# Add cpp to unity build # Add cpp to unity build
file (GLOB ALL "${dir}/${u}.cpp") file (GLOB ALL "${newDir}/${u}.cpp")
foreach (f ${ALL}) foreach (f ${ALL})
list (APPEND cppfiles "${f}") list (APPEND cppfiles "${f}")
endforeach (f) endforeach (f)
@ -67,8 +68,8 @@ macro (add_component_dir dir)
endforeach (u) endforeach (u)
if (OPENMW_UNITY_BUILD) if (OPENMW_UNITY_BUILD)
enable_unity_build(${dir} "${cppfiles}") enable_unity_build(${newDir} "${cppfiles}")
list (APPEND COMPONENT_FILES ${CMAKE_CURRENT_BINARY_DIR}/ub_${dir}.cpp) list (APPEND COMPONENT_FILES ${CMAKE_CURRENT_BINARY_DIR}/ub_${newDir}.cpp)
endif() endif()
source_group ("components\\${dir}" FILES ${files}) source_group ("components\\${dir}" FILES ${files})

Loading…
Cancel
Save