xref: /llvm-project/libunwind/include/CMakeLists.txt (revision 172c4a4a147833f1c08df1555f3170aa9ccb6cbe)
1set(files
2    __libunwind_config.h
3    libunwind.h
4    libunwind.modulemap
5    mach-o/compact_unwind_encoding.h
6    unwind_arm_ehabi.h
7    unwind_itanium.h
8    unwind.h
9    )
10
11add_library(unwind-headers INTERFACE)
12target_include_directories(unwind-headers INTERFACE ${CMAKE_CURRENT_SOURCE_DIR})
13
14if(LIBUNWIND_INSTALL_HEADERS)
15  foreach(file ${files})
16    get_filename_component(dir ${file} DIRECTORY)
17    install(FILES ${file}
18      DESTINATION "${LIBUNWIND_INSTALL_INCLUDE_DIR}/${dir}"
19      COMPONENT unwind-headers
20      PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ
21    )
22  endforeach()
23
24  if(NOT CMAKE_CONFIGURATION_TYPES)
25    add_custom_target(install-unwind-headers
26      DEPENDS unwind-headers
27      COMMAND "${CMAKE_COMMAND}"
28              -DCMAKE_INSTALL_COMPONENT=unwind-headers
29              -P "${LIBUNWIND_BINARY_DIR}/cmake_install.cmake")
30    add_custom_target(install-unwind-headers-stripped DEPENDS install-unwind-headers)
31  endif()
32endif()
33