mirror of
https://git.suyu.dev/suyu/dynarmic.git
synced 2026-01-04 13:44:31 +01:00
CMakeLists: Derive the source file listings from targets directly (#118)
This gets rid of the need to store to individual variables before creating the target itself, cleaning up the variables in the surrounding scope a little bit.
This commit is contained in:
parent
12eaf496fd
commit
c6d09adcb7
3 changed files with 22 additions and 22 deletions
|
|
@ -1,12 +1,14 @@
|
|||
# This function should be passed a list of all files in a target. It will automatically generate
|
||||
# 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_directory_groups)
|
||||
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 ".")
|
||||
|
||||
foreach(file_name ${ARGV})
|
||||
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}")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue