summaryrefslogtreecommitdiff
path: root/cmake/MacroAddSources.cmake
diff options
context:
space:
mode:
Diffstat (limited to 'cmake/MacroAddSources.cmake')
-rw-r--r--cmake/MacroAddSources.cmake9
1 files changed, 9 insertions, 0 deletions
diff --git a/cmake/MacroAddSources.cmake b/cmake/MacroAddSources.cmake
new file mode 100644
index 0000000..62c1381
--- /dev/null
+++ b/cmake/MacroAddSources.cmake
@@ -0,0 +1,9 @@
+# This macro is for generating the sources list from in-folder files.
+MACRO(MacroAddSources)
+ FILE ( GLOB src ${fn}/*.c )
+ FOREACH ( fle ${src} )
+ GET_FILENAME_COMPONENT ( fnp ${fle} NAME_WE )
+ GET_FILENAME_COMPONENT ( pth ${fle} PATH )
+ SET ( SRC_${fn} ${SRC_${fn}} ${pth}/${fnp} )
+ ENDFOREACH ( fle )
+ENDMACRO(MacroAddSources)