[ https://issues.apache.org/jira/browse/THRIFT-4412?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16284079#comment-16284079 ]
Mario Emmenlauer commented on THRIFT-4412: ------------------------------------------ cmake will by default prefer to use the full path to libraries. I understand that the reason is to avoid exactly the kind of problem I am facing. See for example https://cmake.org/cmake/help/v3.3/command/target_link_libraries.html#command:target_link_libraries and https://cmake.org/cmake/help/v3.3/policy/CMP0060.html. There are certain exceptions from this rule, but only in rare cases (i.e. for system libraries on some platforms). This generally works well and I've never had trouble with it, except for thrift on certain older Linux distrivutions. Its beyond my understanding why for thrift, cmake behaves differently. But I think its specific to thrift that the behavior is different (that libraries are not linked with full path), and I've not seen this elsewhere. In any case its not a huge problem so we can close it as "too much effort to solve, and only affects rare cases". > thrift cmake does not use absolute library path, linking system libraries > ------------------------------------------------------------------------- > > Key: THRIFT-4412 > URL: https://issues.apache.org/jira/browse/THRIFT-4412 > Project: Thrift > Issue Type: Question > Components: Build Process > Affects Versions: 0.10.0, 0.11.0 > Reporter: Mario Emmenlauer > Assignee: James E. King, III > Priority: Minor > > I build thrift using cmake on Linux. It works generally very good on many > platforms (I've tested Linux, Windows and MacOSX extensively). But one issue > is plaguing me. I have my own custom boost libraries, libevent and others. I > set {{CMAKE_PREFIX_PATH}} to their install directory. This generally also > works well, and cmake finds the libraries. However in the final Makefile, the > linker command uses {{-lxxx}} for library {{xxx}} instead of the usual cmake > absolute path {{/a/b/c/libxxx.so}}. This is a problem because {{ld}} suddenly > prefers the system libraries over my custom builds. This in turn breaks the > build for me. > I do not have this problem with any other cmake builds. And I tried various > workarounds to force cmake to use the absolute path, but failed. Did somebody > maybe add this on purpose? -- This message was sent by Atlassian JIRA (v6.4.14#64029)