Uploaded image for project: 'MariaDB Connector/C'
  1. MariaDB Connector/C
  2. CONC-291

cannot specify absolute INSTALL_INCLUDEDIR

Details

    • Bug
    • Status: Open (View Workflow)
    • Major
    • Resolution: Unresolved
    • None
    • None
    • None
    • None

    Description

      mariadb_config has

      #define INCLUDE "-I@CMAKE_INSTALL_PREFIX@/@INSTALL_INCLUDEDIR@ I@CMAKE_INSTALL_PREFIX@/@INSTALL_INCLUDEDIR@/mysql"
      #define LIBS    "-L@CMAKE_INSTALL_PREFIX@/@INSTALL_LIBDIR@/ -lmariadb "\
      

      which assumes that INSTALL_INCLUDEDIR and INSTALL_LIBDIR are always
      relative to CMAKE_INSTALL_PREFIX. This is not always the case. The correct
      behavior could be, for example,

      if (INSTALL_INCLUDEDIR MATCHES "/*")
        # absolute path
        set(INSTALL_INCLUDEDIR_FOR_MARIADB_CONFIG "${INSTALL_INCLUDEDIR}")
      else()
        # relative path
        set(INSTALL_INCLUDEDIR_FOR_MARIADB_CONFIG "${CMAKE_INSTALL_PREFIX}/${INSTALL_INCLUDEDIR}")
      fi()
      

      or even

      if (NOT INSTALL_INCLUDEDIR MATCHES "/*")
        # relative path
        set(INSTALL_INCLUDEDIR "${CMAKE_INSTALL_PREFIX}/${INSTALL_INCLUDEDIR}")
      fi()
      

      Attachments

        Activity

          mschorm Michal Schorm added a comment -

          As MDEV-13836 has been closed, this one remains.

          Helpful information about, how it currently is in Fedora is in this comment.

          I still see this issue as critical. Without is or a downstream path, other packages won't build at all.

          My frist idea was to create another set of CMAKE variables, that would hold the absolute path. That would solve the issue, but it's deffinitelly the best way.

          I agree, that check if "INCLUDEDIR" path starts with root dir could do part of the trick.

          mschorm Michal Schorm added a comment - As MDEV-13836 has been closed, this one remains. Helpful information about, how it currently is in Fedora is in this comment . I still see this issue as critical. Without is or a downstream path, other packages won't build at all. – My frist idea was to create another set of CMAKE variables, that would hold the absolute path. That would solve the issue, but it's deffinitelly the best way. I agree, that check if "INCLUDEDIR" path starts with root dir could do part of the trick.
          mschorm Michal Schorm added a comment -

          I'd prefer to be able to set empty prefix and full paths, but the cmake isn't well prepared for it.

          However I managed to get it fixed on my side, by digging up appropriate RPM macros.

          Can be closed.

          mschorm Michal Schorm added a comment - I'd prefer to be able to set empty prefix and full paths, but the cmake isn't well prepared for it. However I managed to get it fixed on my side, by digging up appropriate RPM macros. Can be closed.

          People

            georg Georg Richter
            serg Sergei Golubchik
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:

              Git Integration

                Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.