Skip to content
This repository has been archived by the owner on Jan 26, 2024. It is now read-only.

cmake: Use LIB_INSTALL_DIR instead of hardcoding lib destination #78

Merged
merged 1 commit into from
May 2, 2018

Conversation

vadorovsky
Copy link
Contributor

The comon practice in cmake to allow to specify the libdir is
using the LIB_INSTALL_DIR variable. The main use case of that
variable is setting /usr/lib64 as the destination dir for
libraries which is a common pattern in many Linux distributions.

The comon practice in cmake to allow to specify the libdir is
using the LIB_INSTALL_DIR variable. The main use case of that
variable is setting /usr/lib64 as the destination dir for
libraries which is a common pattern in many Linux distributions.
@rnburn
Copy link
Contributor

rnburn commented May 2, 2018

👍

@rnburn rnburn merged commit d2e12fe into opentracing:master May 2, 2018
@vadorovsky vadorovsky deleted the cmake-lib-install-dir branch May 2, 2018 19:17
@mdouaihy
Copy link
Contributor

Hello,

this change breaks the build of OpenTracing dependency with Hunter.

CMake Error at /Users/mehrezdouaihy/.hunter/_Base/d93ace4/dee24f9/0d4bf3d/Install/lib/cmake/OpenTracing/OpenTracingTargets.cmake:80 (message):
  The imported target "OpenTracing::opentracing-static" references the file

     "/Users/mehrezdouaihy/.hunter/_Base/d93ace4/dee24f9/0d4bf3d/Build/opentracing-cpp/Install/lib/libopentracingd.a"

  but this file does not exist.  Possible reasons include:

In fact, Hunter expects the generated targets CMake files to handle moving them (from Build to its Install directory). This is done by CMake if the destination is not an absolute path.

With this change, the destination is absolute, CMake generates files that are incompatible with Hunter conventions.

You can check the following Hunter packaging

@rnburn
Copy link
Contributor

rnburn commented May 20, 2018

Would changing

if (NOT DEFINED LIB_INSTALL_DIR)
    set(LIB_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/lib)
endif()

to

if (NOT DEFINED LIB_INSTALL_DIR)
    set(LIB_INSTALL_DIR lib)
endif()

fix things?

@mdouaihy
Copy link
Contributor

Yes. I did the change and issued a PR.

rnburn pushed a commit that referenced this pull request May 21, 2018
* Fixes #80 Remove useless dlfcn.h and add cctype header.

* Rework the fix for (#78). Use LIB_INSTALL_DIR instead of hardcoding lib destination. Using CMake Install dir is incompatible with hunter conventions.
@vadorovsky
Copy link
Contributor Author

@mdouaihy Thanks and sorry for breaking Hunter.

@mdouaihy
Copy link
Contributor

@mrostecki no worries.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants