38 lines
1.2 KiB
Text
38 lines
1.2 KiB
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()
|
|
|
|
macro(add_tests)
|
|
get_property(tmp GLOBAL PROPERTY Test_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 Test_SRCS ${tmp})
|
|
endmacro() |