GreatAttractor / imppg

ImPPG (Image Post-Processor)
GNU General Public License v3.0
86 stars 10 forks source link

Installation prefix is hardcoded #3

Closed Hellseher closed 3 years ago

Hellseher commented 3 years ago

Hi,

I may be wrong but while checking produced installation file cmake_install.cmake, CMAKE_INSTALL_PREFIX is only checked in the begging and never used in the rest of the file where installation is hard-coded to /usr/local/

_cmakeinstall.cmake

...
# Set the install prefix
if(NOT DEFINED CMAKE_INSTALL_PREFIX)
  set(CMAKE_INSTALL_PREFIX "/usr/local")
endif()
string(REGEX REPLACE "/$" "" CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}")
...
if("x${CMAKE_INSTALL_COMPONENT}x" STREQUAL "xUnspecifiedx" OR NOT CMAKE_INSTALL_COMPONENT)
  list(APPEND CMAKE_ABSOLUTE_DESTINATION_FILES
   "/usr/local/share/imppg/images/anim.bin;/usr/local/share/imppg/images/crop.png;/usr/local/share/imppg/images/fit_wnd.png;/usr/local/share/imppg/images/imppg-app.ico;/usr/local/share/imppg/images/imppg-app.png;/usr/local/share/imppg/images/load_settings.png;/usr/local/sha
re/imppg/images/mru_settings.png;/usr/local/share/imppg/images/open_file.png;/usr/local/share/imppg/images/pad.png;/usr/local/share/imppg/images/save_file.png;/usr/local/share/imppg/images/save_settings.png;/usr/local/share/imppg/images/select_all.png;/usr/local/share/imppg
/images/toggle_proc.png;/usr/local/share/imppg/images/toggle_tcrv.png;/usr/local/share/imppg/images/zoom_custom.png;/usr/local/share/imppg/images/zoom_in.png;/usr/local/share/imppg/images/zoom_none.png;/usr/local/share/imppg/images/zoom_out.png")
  if(CMAKE_WARN_ON_ABSOLUTE_INSTALL_DESTINATION)
    message(WARNING "ABSOLUTE path INSTALL DESTINATION : ${CMAKE_ABSOLUTE_DESTINATION_FILES}")
  endif()
  if(CMAKE_ERROR_ON_ABSOLUTE_INSTALL_DESTINATION)
    message(FATAL_ERROR "ABSOLUTE path INSTALL DESTINATION forbidden (by caller): ${CMAKE_ABSOLUTE_DESTINATION_FILES}")
  endif()
  ...

How may I use a custom prefix installation path?

GreatAttractor commented 3 years ago

Since this file is generated by CMake, you need to set this variable in the initial CMake invocation, e.g.:

$ cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/opt ..

and then proceed with installation steps as described in README.md.

GreatAttractor commented 3 years ago

Closing. Feel free to reopen if it still doesn't work.

VictorH028 commented 11 months ago

cmake --install . --prefix=$PREFIX