1
0
Fork 0
mirror of https://github.com/hermitcore/libhermit.git synced 2025-03-30 00:00:15 +01:00
libhermit/usr/rdma-core/buildlib/publish_headers.cmake
2017-10-08 16:01:22 +02:00

31 lines
1.1 KiB
CMake

# COPYRIGHT (c) 2016 Obsidian Research Corporation.
# Licensed under BSD (MIT variant) or GPLv2. See COPYING.
# Same as publish_headers but does not install them during the install phase
function(publish_internal_headers DEST)
if(NOT ARGN)
message(SEND_ERROR "Error: publish_internal_headers called without any files")
return()
endif()
set(DDIR "${BUILD_INCLUDE}/${DEST}")
#message(STATUS "BUILD_INCLUDE: ${BUILD_INCLUDE}")
file(MAKE_DIRECTORY "${DDIR}")
foreach(SFIL ${ARGN})
get_filename_component(FIL ${SFIL} NAME)
rdma_create_symlink("${CMAKE_CURRENT_SOURCE_DIR}/${SFIL}" "${DDIR}/${FIL}")
endforeach()
endfunction()
# Copy headers from the source directory to the proper place in the
# build/include directory. This also installs them into /usr/include/xx during
# the install phase
function(publish_headers DEST)
publish_internal_headers("${DEST}" ${ARGN})
foreach(SFIL ${ARGN})
get_filename_component(FIL ${SFIL} NAME)
install(FILES "${SFIL}" DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/${DEST}/" RENAME "${FIL}")
endforeach()
endfunction()