From 61df1abdb29d501c3a499cbb11b4e9349e14cc1a Mon Sep 17 00:00:00 2001 From: Arnstein Ressem Date: Mon, 25 Jul 2016 09:48:10 +0200 Subject: Install header files as part of make install. --- functions.cmake | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'functions.cmake') 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" -- cgit v1.2.3