← All tasks
cppSlackadays/Clipboard #30Not a task: already works

Feature Request: Customize installation prefix

envgap__Slackadays__Clipboard-30

01 / FAILURE SIGNATURE

As reported upstream

No identifying execution failure has been captured.
Not a benchmark task.
  • The project already builds and runs before the fix, so there is nothing to repair.

02 / ENVIRONMENT RECIPE

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

03 / ORIGINAL ISSUE TEXT

Slackadays/Clipboard #30 · read the original issue
**Is your feature request related to a problem? Please describe.**

Currently the user cannot choose the installation location of the Clipboard binary. For packaging purposes it would be difficult as well.



**Describe the solution you'd like**

Changing the `CMakeLists.txt` like this:

```diff

diff --git a/CMakeLists.txt b/CMakeLists.txt

index 8051532..616c471 100755

--- a/CMakeLists.txt

+++ b/CMakeLists.txt

@@ -94,9 +94,13 @@ endif()

 if(WIN32)

   install(TARGETS clipboard DESTINATION bin)

 elseif(APPLE)

-  install(TARGETS clipboard DESTINATION /usr/local/bin)

-  install(CODE "execute_process(COMMAND ln -sf /usr/local/bin/clipboard /usr/local/bin/cb)")

+  set(CMAKE_INSTALL_PREFIX "/usr/local" CACHE PATH "Installation Prefix")

+  install(TARGETS clipboard

+    RUNTIME DESTINATION "${CMAKE_INSTALL_PREFIX}/bin/")

+  install(CODE "execute_process(COMMAND ln -sf ${CMAKE_INSTALL_PREFIX}/bin/clipboard ${CMAKE_INSTALL_PREFIX}/bin/cb)")

 else()

-  install(TARGETS clipboard DESTINATION /usr/bin/)

-  install(CODE "execute_process(COMMAND ln -sf /usr/bin/clipboard /usr/bin/cb)")

-endif()

\ No newline at end of file

+  set(CMAKE_INSTALL_PREFIX "/usr" CACHE PATH "Installation Prefix")

+  install(TARGETS clipboard

+    RUNTIME DESTINATION "${CMAKE_INSTALL_PREFIX}/bin/")

+  install(CODE "execute_process(COMMAND ln -sf ${CMAKE_INSTALL_PREFIX}/bin/clipboard ${CMAKE_INSTALL_PREFIX}/bin/cb)")

+endif()

```



**Describe alternatives you've considered**

Providing `DESTDIR`variable during `make install`



**Additional context**

Add any other context or screenshots about the feature request here.

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
[]