Skip to content

Please use standard CMake variable to configure static vs. shared builds #51

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
mwoehlke-kitware opened this issue Oct 6, 2014 · 2 comments

Comments

@mwoehlke-kitware
Copy link

When building jsoncpp as part of a "superbuild" of a larger project, I was surprised that it build a static library. I see this is because shared vs. static is configured by the JSONCPP_LIB_BUILD_SHARED option and not the standard CMake option BUILD_SHARED_LIBS.

Is there a reason you cannot use the latter? Please do so if possible, or at least default JSONCPP_LIB_BUILD_SHARED to ${BUILD_SHARED_LIBS} rather than OFF.

@cdunn2001
Copy link
Contributor

Maybe that was for backward compatibility with scons? But your change to ${BUILD_SHARED_LIBS} seems like a good idea. Could you submit that change?

@cdunn2001
Copy link
Contributor

See #93.

ya1gaurav added a commit to ya1gaurav/jsoncpp that referenced this issue Apr 23, 2015
Currently JSONCPP_LIB_BUILD_SHARED variable is used as option to build static/shared libraries.
The current patch uses standard CMake variables for this.
Such a workaround is done in open-source-parsers#51
Current patch will make it generic.
ya1gaurav added a commit to ya1gaurav/jsoncpp that referenced this issue Apr 23, 2015
Replace JSONCPP_LIB_BUILD_SHARED => BUILD_SHARED_LIBS
Replace JSONCPP_LIB_BUILD_STATIC => BUILD_STATIC_LIBS
Removed workaround  open-source-parsers#51
Removed OPTION for shared/static in this file.
cdunn2001 pushed a commit to cdunn2001/jsoncpp that referenced this issue Apr 23, 2015
Replace JSONCPP_LIB_BUILD_SHARED => BUILD_SHARED_LIBS
Replace JSONCPP_LIB_BUILD_STATIC => BUILD_STATIC_LIBS
Removed workaround  open-source-parsers#51
Removed OPTION for shared/static in this file.
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