2021-10-10 01:09:17 +00:00
|
|
|
macro(add_glob cur_list)
|
2022-05-17 20:47:33 +00:00
|
|
|
file(GLOB __tmp CONFIGURE_DEPENDS RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${ARGN})
|
2021-10-10 01:09:17 +00:00
|
|
|
list(APPEND ${cur_list} ${__tmp})
|
|
|
|
endmacro()
|
2016-12-07 14:58:31 +00:00
|
|
|
|
|
|
|
macro(add_headers_and_sources prefix common_path)
|
2023-08-21 03:43:03 +00:00
|
|
|
add_glob(${prefix}_headers ${common_path}/*.h)
|
|
|
|
add_glob(${prefix}_sources ${common_path}/*.cpp ${common_path}/*.c)
|
2016-12-07 14:58:31 +00:00
|
|
|
endmacro()
|
|
|
|
|
|
|
|
macro(add_headers_only prefix common_path)
|
2023-08-21 03:43:03 +00:00
|
|
|
add_glob(${prefix}_headers ${common_path}/*.h)
|
|
|
|
endmacro()
|
|
|
|
|
2024-09-25 22:15:52 +00:00
|
|
|
# Assumes the path is under src and that src/ needs to be removed (valid for any subdirectory under src/)
|
2023-08-21 03:43:03 +00:00
|
|
|
macro(extract_into_parent_list src_list dest_list)
|
|
|
|
list(REMOVE_ITEM ${src_list} ${ARGN})
|
2024-09-25 22:15:52 +00:00
|
|
|
file(RELATIVE_PATH relative ${CMAKE_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR})
|
|
|
|
string(REPLACE "src/" "" relative ${relative})
|
2023-08-21 03:43:03 +00:00
|
|
|
foreach(file IN ITEMS ${ARGN})
|
2024-09-25 22:15:52 +00:00
|
|
|
list(APPEND ${dest_list} ${relative}/${file})
|
2023-08-21 03:43:03 +00:00
|
|
|
endforeach()
|
|
|
|
set(${dest_list} "${${dest_list}}" PARENT_SCOPE)
|
2017-03-15 18:54:31 +00:00
|
|
|
endmacro()
|