← All tasks
cppwjakob/nanogui #85Not a task: not reproduced

(unix) strip command fails when CMAKE_LIBRARY_OUTPUT_DIRECTORY is set

envgap__wjakob__nanogui-85

01 / FAILURE SIGNATURE

As reported upstream

No identifying execution failure has been captured.
Not a benchmark task.
  • In a clean container the reported failure did not reproduce, or the known fix did not make the project run.

02 / ENVIRONMENT RECIPE

Base commit
742ff650437044d77945f463eacfa9dc24d98334
Manifest
CMakeLists.txt
Reproduce
Awaiting issue-specific recipe
Run under trace
Awaiting a meaningful runtime command

03 / ORIGINAL ISSUE TEXT

wjakob/nanogui #85 · read the original issue
I don't understand what this is doing / why

```
if (NANOGUI_BUILD_SHARED AND NOT ${U_CMAKE_BUILD_TYPE} MATCHES DEBUG)
  if (APPLE)
    # Strip .dylib library on OSX
    add_custom_command(TARGET nanogui POST_BUILD COMMAND strip -u -r ${CMAKE_CURRENT_BINARY_DIR}/libnanogui.dylib)
  elseif(UNIX)
    # Strip .so library on Linux
    add_custom_command(TARGET nanogui POST_BUILD COMMAND strip ${CMAKE_CURRENT_BINARY_DIR}/libnanogui.so)
  endif()
endif()
```

I would prefer to continue using a shared library Release build, but the circumstances that be require I set the `CMAKE_LIBRARY_OUTPUT_DIRECTORY`.  So since `libnanogui.*` will get put there rather than `CMAKE_CURRENT_BINARY_DIR`, `strip` will fail.

Does removing the library suffix have a specific purpose?  Would something like the following inside the `NANOGUI_BUILD_SHARED AND NOT ...` section work?

```
get_property(NANOGUI_ALTERNATE_LIBRARY_LOCATION GLOBAL PROPERTY LIBRARY_OUTPUT_DIRECTORY)
if(NANOGUI_ALTERNATE_LIBRARY_LOCATION)
  set(NANOGUI_LIBRARY_DIRECTORY "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}"
else()
  set(NANOGUI_LIBRARY_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}")
endif()
```

and then use `${NANOGUI_LIBRARY_DIRECTORY}/libnanogui...` in each respective branch?
Continue on GitHub ↗

04 / LABELS

Labels from the report text only; not yet run

No supported category has been assigned.

Label rules and the text that matched
[]