File: publish_headers.cmake

package info (click to toggle)
rdma-core 33.2-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 13,844 kB
  • sloc: ansic: 145,804; python: 5,688; sh: 2,761; perl: 1,465; makefile: 73
file content (30 lines) | stat: -rw-r--r-- 1,041 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# 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}")
  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()