Skip to content

CMake: Unique lib target name #827

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

Merged
merged 4 commits into from
Dec 3, 2018
Merged

Conversation

jschueller
Copy link
Contributor

@jschueller jschueller commented Oct 3, 2018

An issue when using the imported target from the cmake config file is that the target name differs whether the lib is compiled statically of dynamically so the client code cannot know easily whether to use the dynamic name (jsoncpp_lib) or the static name (jsoncpp_lib_static).

This PR sets a unique name for the lib so the client code can always use:

find_package (jsoncpp NO_MODULE REQUIRED)
target_link_libraries (client_target jsoncpp_lib)

Also BUILD_STATIC_LIBS is unused and not standard.

And also use CMAKE_CROSSCOMPILING_EMULATOR to run tests when cross-compiling.

@jschueller jschueller changed the title Unique lib target name CMake: Unique lib target name Oct 4, 2018
@jschueller
Copy link
Contributor Author

ping @cdunn2001

@cdunn2001
Copy link
Contributor

We strongly prefer meson to cmake, but if you are confident in this change, go ahead and merge. You might help other cmake users.

@jschueller
Copy link
Contributor Author

@cdunn2001 I dont have rights to merge

@cdunn2001 cdunn2001 merged commit d501fbe into open-source-parsers:master Dec 3, 2018
@jschueller jschueller deleted the libs branch December 3, 2018 08:03
@dota17 dota17 mentioned this pull request Jul 3, 2020
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

Successfully merging this pull request may close these issues.

2 participants