EventBus/lib/cmake/InstallHelp.cmake
2019-09-14 15:11:21 +02:00

15 lines
453 B
CMake

#
# Installs files with preserving paths.
#
# Example usage:
# install_public_headers_with_directory(MyHeadersList "src/")
#
macro(install_public_headers_with_directory HEADER_LIST IGNORE_PREFIX)
foreach(HEADER ${${HEADER_LIST}})
get_filename_component(DIR ${HEADER} DIRECTORY)
string(REPLACE ${IGNORE_PREFIX} "" DIR ${DIR})
install(FILES ${HEADER} DESTINATION include/${DIR})
endforeach(HEADER)
endmacro(install_public_headers_with_directory)