Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Linking static app with kinetic-cpp-client #26

Open
ilitzroth opened this issue Sep 3, 2014 · 2 comments
Open

Linking static app with kinetic-cpp-client #26

ilitzroth opened this issue Sep 3, 2014 · 2 comments

Comments

@ilitzroth
Copy link

We would like to test cpp client in a product that already includes sandboxed static lib builds of curl, ssll, protobuf and gflags. I could not find the flags to compile the lib against our versions of these libs, so it's not clear to me what the solution is. Do you expect a user to use the order of libs on the link line to get the correct library in and to link in 2 versions of a lib? Are there some flags I'm overlooking?
Immanuel

@plensing
Copy link
Contributor

I assume that the issue is no longer of interest given the posting date.

On the off chance that it still is (or that someone else has the same problem), here a solution for the current build system.

  1. Disable setting library paths automatically for the library you want to link using the CMAKE_DISABLE_FIND_PACKAGE_ mechanism
  2. Ensure that automatic compilation for the library you wish to link is disabled (you might have to set the corresponding FOUND variable to keep cmake from re-enabling automatic compilation).
  3. Provide the paths to your library and include directory by setting the appropriate LIBRARIES and INCLUDE_DIR cmake variables.

Using gflags as an example:
cmake -DCMAKE_DISABLE_FIND_PACKAGE_Gflags=true -DGFLAGS_FOUND=true -DGFLAGS_LIBRARIES=/my/gflags/libgflags.a -DGFLAGS_INCLUDE_DIR=/my/gflags/include .

@plensing
Copy link
Contributor

Alternatively you can provide your own FindLIBNAME.cmake in the kinetic-cpp-client/cmake directory and make it find the library you wish to link. That way you do not have to mess with cmake command line arguments at all.

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

No branches or pull requests

2 participants