This commit is contained in:
d1str4ught
2025-08-18 19:46:48 +02:00
parent 65582e25ec
commit 4be475f111
1334 changed files with 456590 additions and 0 deletions

25
buildtool/Utils.cmake Normal file
View File

@@ -0,0 +1,25 @@
function(GroupSourcesByFolder target)
set(SOURCE_GROUP_DELIMITER "/")
set(last_dir "")
set(files "")
get_target_property(sources ${target} SOURCES)
foreach(file ${sources})
# Get the relative path of the file from the current CMake source directory
file(RELATIVE_PATH relative_file "${CMAKE_CURRENT_SOURCE_DIR}" ${file})
get_filename_component(dir "${relative_file}" PATH)
if(NOT "${dir}" STREQUAL "${last_dir}")
if(files)
source_group("${last_dir}" FILES ${files})
endif()
set(files "")
endif()
set(files ${files} ${file})
set(last_dir "${dir}")
endforeach()
if(files)
source_group("${last_dir}" FILES ${files})
endif()
endfunction()