# Making a Cmake package for LLDB

**URL:** <https://discourse.cmake.org/t/making-a-cmake-package-for-lldb/11246>\
**Category:** Code\
**Tags:** os:linux, gen:ninja\
**Created:** [July 14, 2024, 9:08am UTC](https://discourse.cmake.org/t/making-a-cmake-package-for-lldb/11246 "2024-07-14T09:08:09Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Narayan](https://discourse.cmake.org/user_avatar/discourse.cmake.org/narayan/32/4764_2.png) [@Narayan](https://discourse.cmake.org/u/Narayan)\
**Post date:** [July 14, 2024, 9:08am UTC](https://discourse.cmake.org/t/making-a-cmake-package-for-lldb/11246/1 "2024-07-14T09:08:09Z")

</div>

I want to generate a CMake config file to help link to other projects more easily.

```auto
install(TARGETS liblldb EXPORT LLDBTargets
    LIBRARY DESTINATION lib
    ARCHIVE DESTINATION lib
    RUNTIME DESTINATION bin
    INCLUDES DESTINATION include
)

include(CMakePackageConfigHelpers)

configure_package_config_file(
  "${CMAKE_CURRENT_SOURCE_DIR}/LLDBConfig.cmake.in"
  "${CMAKE_CURRENT_BINARY_DIR}/LLDBConfig.cmake"
  INSTALL_DESTINATION lib/cmake/clang
)

install(
    EXPORT LLDBTargets
    FILE LLDBTargets.cmake
    DESTINATION lib/cmake/clang
)

```

But I get the following failures:

```auto
CMake Error: install(EXPORT "LLDBTargets" ...) includes target "liblldb" which requires target "lldbPluginUnwindAssemblyInstEmulation" that is not in any export set.
CMake Error: install(EXPORT "LLDBTargets" ...) includes target "liblldb" which requires target "lldbPluginUnwindAssemblyX86" that is not in any export set.

```

now one way I thought of was to manually `add_library` each of these and export them. But is there really no easier way?

---

<div class="post-metadata">

**Author:** ![leha-bot](https://discourse.cmake.org/user_avatar/discourse.cmake.org/leha-bot/32/921_2.png) [@leha-bot](https://discourse.cmake.org/u/leha-bot)\
**Post date:** [July 14, 2024, 3:55pm UTC](https://discourse.cmake.org/t/making-a-cmake-package-for-lldb/11246/2 "2024-07-14T15:55:23Z")

</div>

> [@Narayan](#):
>
> `install(TARGETS liblldb EXPORT LLDBTargets`

Hello, try to add these targets to the `EXPORT` set like this:

```cmake
install(TARGETS lldbPluginUnwindAssemblyInstEmulation lldbPluginUnwindAssemblyX86
    EXPORT LLDBTargets)

```
