# file(GET\_RUNTIME\_DEPENDENCIES) gives error "Resolved path is not absolute" on OS X

**URL:** https://discourse.cmake.org/t/file-get-runtime-dependencies-gives-error-resolved-path-is-not-absolute-on-os-x/13242
**Category:** Usage
**Tags:** os:macos
**Created:** [December 20, 2024, 7:11am UTC](https://discourse.cmake.org/t/file-get-runtime-dependencies-gives-error-resolved-path-is-not-absolute-on-os-x/13242 "2024-12-20T07:11:49Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![KKhanhH](https://discourse.cmake.org/user_avatar/discourse.cmake.org/kkhanhh/32/5214_2.png) [@KKhanhH](https://discourse.cmake.org/u/KKhanhH)
#### Post date: [December 20, 2024, 7:11am UTC](https://discourse.cmake.org/t/file-get-runtime-dependencies-gives-error-resolved-path-is-not-absolute-on-os-x/13242/1 "2024-12-20T07:11:49Z")

</div>

I’m using CMake on OS X and I’m trying to build an executable with linked shared libraries. I’d like to have the install step copy the shared libraries next to the executable file, so I’m using the RUNTIME\_DEPENDENCIES option of install(TARGET).

I’m running into the following error though, which tells me very little, and I haven’t seen any documentation or others encounter this issue.

Error: file Resolved path is not absolute

Looking at CMake’s source code, this error only occurs when resolving dependencies on the Mac version of CMake. Is there any way to get more details about what files or paths might be causing this error?

I’m using VCPKG for obtaining and building the shared libraries. This is the command I’m using for install. The install command works on Linux as well with no issues.

```auto
    install(TARGETS project
        RUNTIME_DEPENDENCIES
        POST_INCLUDE_FILES ${EXTRA_LIBRARY}
        RUNTIME DESTINATION .
        LIBRARY DESTINATION ./lib
        FRAMEWORK DESTINATION ./lib
    )

```

Thank you

---

<div class="post-metadata">

### Author: ![craig.scott](https://discourse.cmake.org/user_avatar/discourse.cmake.org/craig.scott/32/20_2.png) [@craig.scott](https://discourse.cmake.org/u/craig.scott)
#### Post date: [December 20, 2024, 11:37pm UTC](https://discourse.cmake.org/t/file-get-runtime-dependencies-gives-error-resolved-path-is-not-absolute-on-os-x/13242/2 "2024-12-20T23:37:24Z")

</div>

Can you reproduce the problem with a minimal project that does not use vcpkg?

---

<div class="post-metadata">

### Author: ![KKhanhH](https://discourse.cmake.org/user_avatar/discourse.cmake.org/kkhanhh/32/5214_2.png) [@KKhanhH](https://discourse.cmake.org/u/KKhanhH)
#### Post date: [December 21, 2024, 2:37am UTC](https://discourse.cmake.org/t/file-get-runtime-dependencies-gives-error-resolved-path-is-not-absolute-on-os-x/13242/3 "2024-12-21T02:37:37Z")

</div>

Hi Craig,

Here is the minimal reproduction with the error I encountered. The latest GitHub actions run shows the error I encountered. I also print the generated install script there as well.

> **[GitHub - KKhanhH/cmake-osx: test cmake repo](https://github.com/KKhanhH/cmake-osx)**
>
> test cmake repo

---

<div class="post-metadata">

### Author: ![craig.scott](https://discourse.cmake.org/user_avatar/discourse.cmake.org/craig.scott/32/20_2.png) [@craig.scott](https://discourse.cmake.org/u/craig.scott)
#### Post date: [December 21, 2024, 9:18pm UTC](https://discourse.cmake.org/t/file-get-runtime-dependencies-gives-error-resolved-path-is-not-absolute-on-os-x/13242/4 "2024-12-21T21:18:35Z")

</div>

That still uses vcpkg. Can you reproduce the problem without vcpkg being involved in any way?

---

<div class="post-metadata">

### Author: ![KKhanhH](https://discourse.cmake.org/user_avatar/discourse.cmake.org/kkhanhh/32/5214_2.png) [@KKhanhH](https://discourse.cmake.org/u/KKhanhH)
#### Post date: [December 22, 2024, 1:02am UTC](https://discourse.cmake.org/t/file-get-runtime-dependencies-gives-error-resolved-path-is-not-absolute-on-os-x/13242/5 "2024-12-22T01:02:05Z")

</div>

The readme is misleading, but I removed all instances of vcpkg use from the repo (the preset has no vcpkg toolchainfile at all and there’s no vcpkg.json manifest file for it to get any dependencies from).

Latest workflow run with no vcpkg that indicates my problem

> <https://github.com/KKhanhH/cmake-osx/actions/runs/12449923994/job/34756163137>

---

<div class="post-metadata">

### Author: ![craig.scott](https://discourse.cmake.org/user_avatar/discourse.cmake.org/craig.scott/32/20_2.png) [@craig.scott](https://discourse.cmake.org/u/craig.scott)
#### Post date: [December 22, 2024, 5:27am UTC](https://discourse.cmake.org/t/file-get-runtime-dependencies-gives-error-resolved-path-is-not-absolute-on-os-x/13242/6 "2024-12-22T05:27:00Z")

</div>

When built on macOS, your minimal project doesn’t have any `install()` commands. Somehow, something is causing an install rule to be created for the `test` target, but nothing in your project seems to actually define that.

I suspect your problem relates to naming your executable `test`. You should consider that to be a reserved target name, since CMake will create such a target if `enable_testing()` is called. I suspect there’s some internal logic that gets triggered for `test` which doesn’t expect the project to try to define a target with that name. Call your target something else and see if your problem goes away.

---

<div class="post-metadata">

### Author: ![KKhanhH](https://discourse.cmake.org/user_avatar/discourse.cmake.org/kkhanhh/32/5214_2.png) [@KKhanhH](https://discourse.cmake.org/u/KKhanhH)
#### Post date: [December 22, 2024, 6:11am UTC](https://discourse.cmake.org/t/file-get-runtime-dependencies-gives-error-resolved-path-is-not-absolute-on-os-x/13242/7 "2024-12-22T06:11:28Z")

</div>

I changed the target and cleaned up the cmakelists file a bit. There was an indented else that was difficult to see, but it was running the install command on line 17. The same error still shows up.

---

<div class="post-metadata">

### Author: ![KKhanhH](https://discourse.cmake.org/user_avatar/discourse.cmake.org/kkhanhh/32/5214_2.png) [@KKhanhH](https://discourse.cmake.org/u/KKhanhH)
#### Post date: [December 27, 2024, 10:28am UTC](https://discourse.cmake.org/t/file-get-runtime-dependencies-gives-error-resolved-path-is-not-absolute-on-os-x/13242/8 "2024-12-27T10:28:21Z")

</div>

@craig.scott Any updates on this? I was able to work around it by creating a CMakeLists to build the external dependency my project needed rather than invoking its provided Makefile, but that doesn’t explain why the issue was occurring in the first place. The Makefile for that dependency is [here](https://github.com/Thealexbarney/LibAtrac9/blob/master/C/Makefile). CMake seems to build and link the dependency fine which is why it’s strange that it errors only on the install runtime\_dependency step.
