mirror of
https://github.com/gelldur/EventBus.git
synced 2024-12-28 04:50:52 +08:00
d0d236dab0
We should be able to remove installed stuff but we want to forbid changes in installed files. Thanks to that we do not modify files by mistake directly from e.g. Clion (when we go to header/source)
20 lines
569 B
CMake
20 lines
569 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}
|
|
# We don't want someone by accident modify his installed files
|
|
PERMISSIONS OWNER_EXECUTE OWNER_READ
|
|
)
|
|
endforeach(HEADER)
|
|
|
|
endmacro(install_public_headers_with_directory)
|