diff --git a/cmake/Templates.cmake b/cmake/Templates.cmake index 292da31..eb1d3bb 100644 --- a/cmake/Templates.cmake +++ b/cmake/Templates.cmake @@ -1,12 +1,18 @@ function(add_bluelib_module) set(options) set(one_value_args NAME) - set(multi_value_args DEPENDENCIES) + set(multi_value_args DEPENDENCIES SUBDIRS) cmake_parse_arguments(PARSE_ARGV 0 arg "${options}" "${one_value_args}" "${multi_value_args}") set(module_name ${arg_NAME}) file(GLOB sources *.c *.h) + + foreach (dir ${arg_SUBDIRS}) + file(GLOB dir_sources ${dir}/*.c ${dir}/*.h) + set(sources ${sources} ${dir_sources}) + endforeach (dir) + file(GLOB sys_sources sys/${b_system_name}/*.c sys/${b_system_name}/*.h) set(root_header include/blue/${module_name}.h) file(GLOB headers include/blue/${module_name}/*.h) @@ -36,7 +42,7 @@ function(add_bluelib_module) set_target_properties(blue-${module_name} PROPERTIES FOLDER "Shared/${module_name}") set_target_properties(blue-${module_name}-s PROPERTIES FOLDER "Static/${module_name}") - + TEST_BIG_ENDIAN(IS_BIG_ENDIAN) if(IS_BIG_ENDIAN) target_compile_definitions(blue-${module_name} PRIVATE BIG_ENDIAN)