Opened 13 years ago

Closed 11 years ago

#29548 closed defect (fixed)

hugin-app: hardcodes prefix and applications_dir

Reported by: ryandesign (Ryan Carsten Schmidt) Owned by: macports-tickets@…
Priority: Normal Milestone:
Component: ports Version: 1.9.2
Keywords: Cc: p.schmiedeskamp@…
Port: hugin-app

Description

hugin-app's CMakeLists.txt file has hardcoded strings /opt/local and /Applications/MacPorts; this will do the wrong thing if the user is not using the default values of ${prefix} or ${applications_dir}. The port should fix CMakeLists.txt to handle these situations correctly.

In fact there are several other source files that hardcode /opt/local and /sw which might need to be fixed as well.

Change History (3)

comment:1 Changed 13 years ago by hvdwolf@…

I do not exactly understand what you mean. The relevant part in the CMakeLists.txt file is:

    IF (CMAKE_INSTALL_PREFIX STREQUAL "/opt/local")
      # MacPorts
      SET(INSTALL_OSX_BUNDLE_DIR /Applications/MacPorts CACHE DOCSTRING "Install directory Hugin and HuginStitchProject application bundles")
    ELSE(CMAKE_INSTALL_PREFIX STREQUAL "/opt/local")
      # fink or other custom system.
      SET(INSTALL_OSX_BUNDLE_DIR ${CMAKE_INSTALL_PREFIX}/Applications CACHE DOCSTRING "Install directory Hugin and HuginStitchProject application bundles")
    ENDIF(CMAKE_INSTALL_PREFIX STREQUAL "/opt/local")

This means that it looks to /opt/local by default on Apple, but if another CMAKE_INSTALL_PREFIX is specified it will take that one. I use it myself as well to define other locations for test builds (especially at /usr/local). I thought that macports set it's own CMAKE_INSTALL_PREFIX as part of the "PortGroup cmake 1.0" option. No matter whether macports is really in /opt or in some other location, the macports CMAKE_INSTALL_PREFIX will be picked up by the CMake file. Or doesn't macports set this cmake variable?

Other files that possibly seem to hardcode /opt and /sw are the cmake macros FIND<whatever>. In these files also /usr, /usr/local, etcetera are hardcoded to make cmake find libraries/frameworks at places other than the system paths. If this hardcoded paths are also in other parts, please let me know.

Last edited 11 years ago by ryandesign (Ryan Carsten Schmidt) (previous) (diff)

comment:2 Changed 11 years ago by ryandesign (Ryan Carsten Schmidt)

Owner: changed from hvdwolf@… to macports-tickets@…

comment:3 in reply to:  1 Changed 11 years ago by ryandesign (Ryan Carsten Schmidt)

Resolution: fixed
Status: newclosed

Replying to hvdwolf@…:

I do not exactly understand what you mean. The relevant part in the CMakeLists.txt file is:

    IF (CMAKE_INSTALL_PREFIX STREQUAL "/opt/local")
      # MacPorts
      SET(INSTALL_OSX_BUNDLE_DIR /Applications/MacPorts CACHE DOCSTRING "Install directory Hugin and HuginStitchProject application bundles")
    ELSE(CMAKE_INSTALL_PREFIX STREQUAL "/opt/local")
      # fink or other custom system.
      SET(INSTALL_OSX_BUNDLE_DIR ${CMAKE_INSTALL_PREFIX}/Applications CACHE DOCSTRING "Install directory Hugin and HuginStitchProject application bundles")
    ENDIF(CMAKE_INSTALL_PREFIX STREQUAL "/opt/local")

This says: if ${prefix} is /opt/local, then install the application to /Applications/MacPorts, otherwise install it to ${prefix}/Applications. That's not what we want. We always want to install the application to ${applications_dir}. The default for ${applications_dir} happens to be /Applications/MacPorts, but the user might have changed it. Fixed in r114003.

Other files that possibly seem to hardcode /opt and /sw are the cmake macros FIND<whatever>. In these files also /usr, /usr/local, etcetera are hardcoded to make cmake find libraries/frameworks at places other than the system paths. If this hardcoded paths are also in other parts, please let me know.

That would be a problem, but they seem to only check those hardcoded paths if pkgconfig is not found, but hugin-app does depend on pkgconfig so this should be fine.

Note: See TracTickets for help on using tickets.