Skip to content

Use a consistent target name for jsoncpp in CMake scripts #333

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

Closed

Conversation

cdunn2001
Copy link
Contributor

(Rebased from #325.)

The target name for the jsoncpp library would change based on whether
we were building a static or shared library. This inconsistency made
it difficult and unintuitive to pull in jsoncpp as a submodule in
another repository and link to it directly via other CMake scripts.

Having a consistent target name will allow libraries with their own
CMake scripts to reliably refer to jsoncpp as a dependency.

Other Changes:

  • BUILD_SHARED_LIBS and BUILD_STATIC_LIBS removed in favor of
    JSONCPP_LIBRARY_TYPE, which allows you to pick either SHARED
    or STATIC library variations. This change was made to prevent
    both shared and static libraries being built at the same time.
    This isn't allowed anymore since we only generate 1 target for the
    jsoncpp library now.
  • travis.sh build script updated to perform CMake generation in an
    out-of-source binary directory. This will prevent the temporary
    generated output files from intermixing into the source tree and
    allow for multiple generations with different configurations using
    the same source tree.

(I missed a couple. ~cd)
The target name for the jsoncpp library would change based on whether
we were building a static or shared library. This inconsistency made
it difficult and unintuitive to pull in jsoncpp as a submodule in
another repository and link to it directly via other CMake scripts.

Having a consistent target name will allow libraries with their own
CMake scripts to reliably refer to jsoncpp as a dependency.

Other Changes:

* `BUILD_SHARED_LIBS` and `BUILD_STATIC_LIBS` removed in favor of
  `JSONCPP_LIBRARY_TYPE`, which allows you to pick either `SHARED`
  or `STATIC` library variations. This change was made to prevent
  both shared and static libraries being built at the same time.
  This isn't allowed anymore since we only generate 1 target for the
  jsoncpp library now.
* `travis.sh` build script updated to perform CMake generation in an
  out-of-source binary directory. This will prevent the temporary
  generated output files from intermixing into the source tree and
  allow for multiple generations with different configurations using
  the same source tree.
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