25 lines
798 B
Text
25 lines
798 B
Text
|
macro(add_sources)
|
||
|
get_property(tmp GLOBAL PROPERTY SRCS)
|
||
|
file(RELATIVE_PATH _relPath "${PROJECT_SOURCE_DIR}" "${CMAKE_CURRENT_SOURCE_DIR}")
|
||
|
foreach (_src ${ARGN})
|
||
|
if (_relPath)
|
||
|
list(APPEND tmp "${_relPath}/${_src}")
|
||
|
else ()
|
||
|
list(APPEND tmp "${_src}")
|
||
|
endif ()
|
||
|
endforeach ()
|
||
|
set_property(GLOBAL PROPERTY SRCS ${tmp})
|
||
|
endmacro()
|
||
|
|
||
|
macro(add_headers)
|
||
|
get_property(tmp GLOBAL PROPERTY Headers)
|
||
|
file(RELATIVE_PATH _relPath "${PROJECT_SOURCE_DIR}" "${CMAKE_CURRENT_SOURCE_DIR}")
|
||
|
foreach (_src ${ARGN})
|
||
|
if (_relPath)
|
||
|
list(APPEND tmp "${_relPath}/${_src}")
|
||
|
else ()
|
||
|
list(APPEND tmp "${_src}")
|
||
|
endif ()
|
||
|
endforeach ()
|
||
|
set_property(GLOBAL PROPERTY Headers ${tmp})
|
||
|
endmacro()
|