aboutsummaryrefslogtreecommitdiff
path: root/src/teakra/CMakeModules
diff options
context:
space:
mode:
authorpurringChaos <kitteh@kitteh.pw>2021-06-06 17:27:26 +0100
committerGitHub <noreply@github.com>2021-06-06 18:27:26 +0200
commite3b4350f44a51d0012457a556dc04dfd0ba267d4 (patch)
tree3ac02cfbe00ab13c787e77dbf7aa491a0e33ed1b /src/teakra/CMakeModules
parent2494058a7190a4a673fc0d6c2e59740c896a74c6 (diff)
Add PoroCYon's DSP code. (#1123)
* Add PoroCYon's DSP code. * Remove some teakra iles that we dont need. * make some requested changes. * move DataMemoryOffset into namespace. * use deault param. * ad the switch change * <Generic> forget about the default parameter
Diffstat (limited to 'src/teakra/CMakeModules')
-rw-r--r--src/teakra/CMakeModules/CreateDirectoryGroups.cmake17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/teakra/CMakeModules/CreateDirectoryGroups.cmake b/src/teakra/CMakeModules/CreateDirectoryGroups.cmake
new file mode 100644
index 0000000..175899e
--- /dev/null
+++ b/src/teakra/CMakeModules/CreateDirectoryGroups.cmake
@@ -0,0 +1,17 @@
+# This function should be passed a name of an existing target. It will automatically generate
+# file groups following the directory hierarchy, so that the layout of the files in IDEs matches the
+# one in the filesystem.
+function(create_target_directory_groups target_name)
+ # Place any files that aren't in the source list in a separate group so that they don't get in
+ # the way.
+ source_group("Other Files" REGULAR_EXPRESSION ".")
+
+ get_target_property(target_sources "${target_name}" SOURCES)
+
+ foreach(file_name IN LISTS target_sources)
+ get_filename_component(dir_name "${file_name}" PATH)
+ # Group names use '\' as a separator even though the entire rest of CMake uses '/'...
+ string(REPLACE "/" "\\" group_name "${dir_name}")
+ source_group("${group_name}" FILES "${file_name}")
+ endforeach()
+endfunction()