Skip to content

Fix empty version string in pkgconfig/jsoncpp.pc #1236

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
wants to merge 7 commits into from

Conversation

dota17
Copy link
Member

@dota17 dota17 commented Nov 4, 2020

Hi @AmarOk1412 Please check if this patch fix your problem.

Fix #1235

@AmarOk1412
Copy link

File: pkg-config/jsoncpp.pc
────────────────────────────────────────────────────────
prefix=/usr/local
exec_prefix=/usr/local
libdir=${exec_prefix}/lib64
includedir=${prefix}/include

Name: jsoncpp
Description: A C++ library for interacting with JSON
Version: 1.9.4
URL: https://github.com/open-source-parsers/jsoncpp
Libs: -L${libdir} -ljsoncpp
Cflags: -I${includedir}

Looks good :)

@baylesj
Copy link
Contributor

baylesj commented Nov 6, 2020

I was curious how this happened, it looks like its a result of this patch, which removed cmake JSONCPP_ prepended fields in favor of PROJECT_ field, in this case JSONCPP_VERSION got changed toPROJECT_VERSION.

I think we can actually go further with this patch and remove all references to JSONCPP_VERSION.

@baylesj
Copy link
Contributor

baylesj commented Nov 6, 2020

@cdunn2001 or @BillyDonahue, do you think any projects are going to be checking the JSONCPP_VERSION* fields? If so, I'm wondering if the right answer is to actually batch replace PROJECT_VERSION* with JSONCPP_VERSION* (essentially partially reverting #1197).

@dota17
Copy link
Member Author

dota17 commented Nov 9, 2020

@baylesj Sorry, my bad, you are right. I shouldn't change the project setting in CMakelists.txt.
I didn't know that <PROJECT-NAME>_VERSION and PROJECT_VERSION are the same[1,2], so there is no need to change the project name from JSONCPP to jsoncpp.
So, based on this, I agree with you to partially reverting #1197, use JSONCPP_VERSION and JSONCPP_VERSION_MAJOR again.

@cdunn2001
Copy link
Contributor

I honestly have no opinion on any cmake changes. I'd aim for minimal maintenance, but I wouldn't object to any cmake changes.

GerritRingMirror pushed a commit to savoirfairelinux/jami-daemon that referenced this pull request Nov 18, 2020
jsoncpp-devel is broken since some versions
Will be fixed by: open-source-parsers/jsoncpp#1236

Change-Id: I3ab8eaffcb6abcd28f06aaeeba8f57131fb97af8
@AmarOk1412
Copy link

Note here: with the PR I still have an undetected JSONCPP version
It's for building https://github.com/savoirfairelinux/opendht

@dota17
Copy link
Member Author

dota17 commented Dec 1, 2020

@AmarOk1412
Could you please tell more detail?

@coveralls
Copy link

Coverage Status

Coverage remained the same at 93.803% when pulling ba68da9 on jsoncpp_version into 8954092 on master.

@LocutusOfBorg
Copy link

For Debian, I went for a minimal approach:

--- libjsoncpp-1.9.4.orig/CMakeLists.txt
+++ libjsoncpp-1.9.4/CMakeLists.txt
@@ -73,6 +73,7 @@ project(jsoncpp
         LANGUAGES CXX)

 message(STATUS "JsonCpp Version: ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}")
+set(JSONCPP_VERSION ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH})
 set(PROJECT_SOVERSION 24)

 option(JSONCPP_WITH_TESTS "Compile and (for jsoncpp_check) run JsonCpp test executables" ON)

@cdunn2001
Copy link
Contributor

I guess #1235 fixed this? Please re-open if not.

@cdunn2001 cdunn2001 closed this Jan 10, 2021
@baylesj baylesj deleted the jsoncpp_version branch September 12, 2024 00:03
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.

Wrong version in jsoncpp.pc for Fedora 33
6 participants