build: CMake refactoring

Includes:
- refactor build_lib and build_lib_example macros
    - unify src and contrib macros
    - replace macro with function not to leak definitions
    - parse list of arguments
- different cmake-format file for modules to list one item per line
This commit is contained in:
Gabriel Ferreira
2022-01-27 11:40:41 -03:00
parent d470fb77d4
commit 41aacec626
108 changed files with 2716 additions and 2704 deletions

View File

@@ -1,15 +1,10 @@
set(name csma-layout)
set(source_files model/csma-star-helper.cc)
set(header_files model/csma-star-helper.h)
set(libraries_to_link ${libnetwork} ${libinternet} ${libcsma}
${libpoint-to-point}
)
set(test_sources)
build_lib("${name}" "${source_files}" "${header_files}" "${libraries_to_link}"
"${test_sources}"
build_lib(
LIBNAME csma-layout
SOURCE_FILES model/csma-star-helper.cc
HEADER_FILES model/csma-star-helper.h
LIBRARIES_TO_LINK
${libnetwork}
${libinternet}
${libcsma}
${libpoint-to-point}
)

View File

@@ -1,9 +1,9 @@
set(name csma-star)
set(source_files ${name}.cc)
set(header_files)
set(libraries_to_link ${libcsma} ${libcsma-layout} ${libinternet}
${libapplications}
)
build_lib_example(
"${name}" "${source_files}" "${header_files}" "${libraries_to_link}"
NAME csma-star
SOURCE_FILES csma-star.cc
LIBRARIES_TO_LINK
${libcsma}
${libcsma-layout}
${libinternet}
${libapplications}
)