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:
@@ -1,36 +1,19 @@
|
||||
set(header_files)
|
||||
|
||||
set(name bit-serializer)
|
||||
set(source_files ${name}.cc)
|
||||
set(libraries_to_link ${libcore} ${libnetwork})
|
||||
build_lib_example(
|
||||
"${name}" "${source_files}" "${header_files}" "${libraries_to_link}"
|
||||
set(base_examples
|
||||
bit-serializer
|
||||
main-packet-header
|
||||
main-packet-tag
|
||||
packet-socket-apps
|
||||
lollipop-comparisions
|
||||
)
|
||||
|
||||
set(name main-packet-header)
|
||||
set(source_files ${name}.cc)
|
||||
set(libraries_to_link ${libnetwork})
|
||||
build_lib_example(
|
||||
"${name}" "${source_files}" "${header_files}" "${libraries_to_link}"
|
||||
)
|
||||
|
||||
set(name main-packet-tag)
|
||||
set(source_files ${name}.cc)
|
||||
set(libraries_to_link ${libnetwork})
|
||||
build_lib_example(
|
||||
"${name}" "${source_files}" "${header_files}" "${libraries_to_link}"
|
||||
)
|
||||
|
||||
set(name packet-socket-apps)
|
||||
set(source_files ${name}.cc)
|
||||
set(libraries_to_link ${libnetwork} ${libcore})
|
||||
build_lib_example(
|
||||
"${name}" "${source_files}" "${header_files}" "${libraries_to_link}"
|
||||
)
|
||||
|
||||
set(name lollipop-comparisions)
|
||||
set(source_files ${name}.cc)
|
||||
set(libraries_to_link ${libnetwork} ${libcore})
|
||||
build_lib_example(
|
||||
"${name}" "${source_files}" "${header_files}" "${libraries_to_link}"
|
||||
foreach(
|
||||
example
|
||||
${base_examples}
|
||||
)
|
||||
build_lib_example(
|
||||
NAME ${example}
|
||||
SOURCE_FILES ${example}.cc
|
||||
LIBRARIES_TO_LINK ${libnetwork}
|
||||
${libcore}
|
||||
)
|
||||
endforeach()
|
||||
|
||||
Reference in New Issue
Block a user