diff --git a/cmake/Templates.cmake b/cmake/Templates.cmake index 199457b..e1cf859 100644 --- a/cmake/Templates.cmake +++ b/cmake/Templates.cmake @@ -71,16 +71,9 @@ function(add_fx_assembly) install(FILES ${headers} DESTINATION include/${assembly_path}) endfunction(add_fx_assembly) -macro(export_fx_namespace_details) - set(options) - set(one_value_args NAME) - set(multi_value_args) - cmake_parse_arguments(PARSE_ARGV 0 arg - "${options}" - "${one_value_args}" - "${multi_value_args}") +macro(export_fx_namespace_details ns_name) + set(namespace_name ${ns_name}) - set(namespace_name ${arg_NAME}) string(REPLACE "." "/" namespace_path ${namespace_name}) set(namespace_target_name ${namespace_name}) @@ -89,7 +82,15 @@ macro(export_fx_namespace_details) file(GLOB namespace_sources *.c *.h ${CMAKE_CURRENT_SOURCE_DIR}/include/${namespace_path}/*.h) - file(GLOB sys_sources sys/${fx_system_name}/*.c sys/${fx_system_name}/*.h) + + foreach (dir ${source_dirs}) + file(GLOB dir_sources ${dir}/*.c ${dir}/*.h) + set(namespace_sources ${namespace_sources} ${dir_sources}) + endforeach (dir) + + file(GLOB sys_sources + ${CMAKE_CURRENT_SOURCE_DIR}/sys/${fx_system_name}/*.c + ${CMAKE_CURRENT_SOURCE_DIR}/sys/${fx_system_name}/*.h) file(GLOB headers include/${namespace_path}/*.h) set(namespace_sources ${namespace_sources} diff --git a/fx.collections/CMakeLists.txt b/fx.collections/CMakeLists.txt index e7d34d5..5643783 100644 --- a/fx.collections/CMakeLists.txt +++ b/fx.collections/CMakeLists.txt @@ -1,2 +1 @@ -export_fx_namespace_details( - NAME fx.collections) +export_fx_namespace_details(fx.collections) diff --git a/fx.reflection/CMakeLists.txt b/fx.reflection/CMakeLists.txt index 361da43..f7a9c90 100644 --- a/fx.reflection/CMakeLists.txt +++ b/fx.reflection/CMakeLists.txt @@ -1,6 +1 @@ -set(namespace_include_paths ${CMAKE_CURRENT_SOURCE_DIR}/include PARENT_SCOPE) - -file(GLOB namespace_sources - *.c *.h - ${CMAKE_CURRENT_SOURCE_DIR}/include/fx/reflection/*.h) -set(namespace_sources ${namespace_sources} PARENT_SCOPE) +export_fx_namespace_details(fx.reflection) diff --git a/fx/CMakeLists.txt b/fx/CMakeLists.txt index f6bb034..7bfdaef 100644 --- a/fx/CMakeLists.txt +++ b/fx/CMakeLists.txt @@ -1,7 +1,2 @@ -set(namespace_include_paths ${CMAKE_CURRENT_SOURCE_DIR}/include PARENT_SCOPE) - -file(GLOB namespace_sources - *.c *.h - hash/*.c hash/*.h - ${CMAKE_CURRENT_SOURCE_DIR}/include/fx/*.h) -set(namespace_sources ${namespace_sources} PARENT_SCOPE) +set(source_dirs hash) +export_fx_namespace_details(fx)