aboutsummaryrefslogtreecommitdiffstats
path: root/cmake/Utils.cmake
diff options
context:
space:
mode:
Diffstat (limited to 'cmake/Utils.cmake')
-rw-r--r--cmake/Utils.cmake13
1 files changed, 13 insertions, 0 deletions
diff --git a/cmake/Utils.cmake b/cmake/Utils.cmake
new file mode 100644
index 00000000..0abf5155
--- /dev/null
+++ b/cmake/Utils.cmake
@@ -0,0 +1,13 @@
+
+# Installing headers and preserving the directory structure
+# Found here: http://www.semipol.de/archives/251
+MACRO(INSTALL_HEADERS_WITH_DIRECTORY HEADER_LIST COMPONENT_NAME)
+
+ FOREACH(HEADER ${${HEADER_LIST}})
+ STRING(REGEX MATCH "(.*)[/\\]" DIR ${HEADER})
+ STRING(REPLACE "${CMAKE_SOURCE_DIR}/" "" DIR ${DIR})
+ INSTALL(FILES ${HEADER} DESTINATION include/${DIR} COMPONENT ${COMPONENT_NAME})
+ ENDFOREACH(HEADER)
+
+ENDMACRO(INSTALL_HEADERS_WITH_DIRECTORY)
+