summaryrefslogtreecommitdiffstats
path: root/functions.cmake
diff options
context:
space:
mode:
authorArnstein Ressem <aressem@yahoo-inc.com>2016-07-25 09:48:10 +0200
committerArnstein Ressem <aressem@yahoo-inc.com>2016-07-25 09:48:10 +0200
commit61df1abdb29d501c3a499cbb11b4e9349e14cc1a (patch)
tree5e21875e44e48a61ee8830db643fc694dce41236 /functions.cmake
parent3b92d5e92bfab465ffb7271eef9fba633b25e555 (diff)
Install header files as part of make install.
Diffstat (limited to 'functions.cmake')
-rw-r--r--functions.cmake13
1 files changed, 13 insertions, 0 deletions
diff --git a/functions.cmake b/functions.cmake
index 8bd0e3a97d1..9c9898bb6f4 100644
--- a/functions.cmake
+++ b/functions.cmake
@@ -182,6 +182,7 @@ function(vespa_add_library TARGET)
if(ARG_INSTALL)
install(TARGETS ${TARGET} DESTINATION ${ARG_INSTALL})
+ __install_header_files(${TARGET})
endif()
if(ARG_OUTPUT_NAME)
@@ -192,6 +193,18 @@ function(vespa_add_library TARGET)
__export_include_directories(${TARGET})
endfunction()
+function(__install_header_files TARGET)
+ # Only install header files for main libraries (that does not contain underscore).
+ # Currently all header files are installed as they are not explicitly listed for each library.
+ if (NOT ${TARGET} MATCHES "_")
+ file(GLOB_RECURSE HEADERS RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "*.h")
+ foreach(HEADER ${HEADERS})
+ get_filename_component(RELDIR ${HEADER} DIRECTORY)
+ install(FILES ${HEADER} DESTINATION include/vespa/${TARGET}/${RELDIR})
+ endforeach()
+ endif()
+endfunction()
+
function(vespa_add_executable TARGET)
cmake_parse_arguments(ARG
"TEST"