[CONC-291] cannot specify absolute INSTALL_INCLUDEDIR Created: 2017-10-29  Updated: 2019-01-02

Status: Open
Project: MariaDB Connector/C
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Major
Reporter: Sergei Golubchik Assignee: Georg Richter
Resolution: Unresolved Votes: 0
Labels: 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()



 Comments   
Comment by Michal Schorm [ 2017-10-29 ]

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.

Comment by Michal Schorm [ 2019-01-02 ]

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.

Generated at Thu Feb 08 03:04:15 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.