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
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -61,19 +61,19 @@ if(CCACHE_EXECUTABLE)
set(CMAKE_C_COMPILER_LAUNCHER "${CCACHE_EXECUTABLE}" CACHE PATH "ccache" FORCE)
endif()

project(jsoncpp
project(JSONCPP
# Note: version must be updated in three places when doing a release. This
# annoying process ensures that amalgamate, CMake, and meson all report the
# correct version.
# 1. ./meson.build
# 2. ./include/json/version.h
# 3. ./CMakeLists.txt
# IMPORTANT: also update the PROJECT_SOVERSION!!
# IMPORTANT: also bump the JSONCPP_SOVERSION by 1!!!
VERSION 1.9.4 # <major>[.<minor>[.<patch>[.<tweak>]]]
LANGUAGES CXX)

message(STATUS "JsonCpp Version: ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}")
set(PROJECT_SOVERSION 24)
message(STATUS "JsonCpp Version: ${JSONCPP_VERSION_MAJOR}.${JSONCPP_VERSION_MINOR}.${JSONCPP_VERSION_PATCH}")
set(JSONCPP_SOVERSION 24)

include(${CMAKE_CURRENT_SOURCE_DIR}/include/PreventInSourceBuilds.cmake)
include(${CMAKE_CURRENT_SOURCE_DIR}/include/PreventInBuildInstalls.cmake)
Expand Down Expand Up @@ -172,7 +172,7 @@ if(JSONCPP_WITH_CMAKE_PACKAGE)
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/jsoncpp
FILE jsoncppConfig.cmake)
write_basic_package_version_file("${CMAKE_CURRENT_BINARY_DIR}/jsoncppConfigVersion.cmake"
VERSION ${PROJECT_VERSION}
VERSION ${JSONCPP_VERSION}
COMPATIBILITY SameMajorVersion)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/jsoncppConfigVersion.cmake
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/jsoncpp)
Expand Down
4 changes: 2 additions & 2 deletions doxybuild.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def do_subst_in_file(targetfile, sourcefile, dict):
with open(sourcefile, 'r') as f:
contents = f.read()
for (k,v) in list(dict.items()):
v = v.replace('\\','\\\\')
v = v.replace('\\','\\\\')
contents = re.sub(k, v, contents)
with open(targetfile, 'w') as f:
f.write(contents)
Expand Down Expand Up @@ -158,7 +158,7 @@ def main():
Generates doxygen documentation in build/doxygen.
Optionally makes a tarball of the documentation to dist/.

Must be started in the project top directory.
Must be started in the project top directory.
"""
from optparse import OptionParser
parser = OptionParser(usage=usage)
Expand Down
3 changes: 2 additions & 1 deletion include/json/version.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
// 1. /meson.build
// 2. /include/json/version.h
// 3. /CMakeLists.txt
// IMPORTANT: also update the SOVERSION!!
// IMPORTANT: update both the JSONCPP_VERSION_STRING as well as the
// major, minor, and patch fields as appropriate here.

#define JSONCPP_VERSION_STRING "1.9.4"
#define JSONCPP_VERSION_MAJOR 1
Expand Down
4 changes: 2 additions & 2 deletions src/jsontestrunner/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ if(BUILD_SHARED_LIBS)
else()
add_definitions(-DJSON_DLL)
endif()
target_link_libraries(jsontestrunner_exe jsoncpp_lib)
target_link_libraries(jsontestrunner_exe JSONCPP_lib)
else()
target_link_libraries(jsontestrunner_exe jsoncpp_static)
target_link_libraries(jsontestrunner_exe JSONCPP_static)
endif()

set_target_properties(jsontestrunner_exe PROPERTIES OUTPUT_NAME jsontestrunner_exe)
Expand Down
10 changes: 5 additions & 5 deletions src/lib_json/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,8 @@ if(BUILD_SHARED_LIBS)
add_library(${SHARED_LIB} SHARED ${PUBLIC_HEADERS} ${JSONCPP_SOURCES})
set_target_properties(${SHARED_LIB} PROPERTIES
OUTPUT_NAME jsoncpp
VERSION ${PROJECT_VERSION}
SOVERSION ${PROJECT_SOVERSION}
VERSION ${JSONCPP_VERSION}
SOVERSION ${JSONCPP_SOVERSION}
POSITION_INDEPENDENT_CODE ON
)

Expand Down Expand Up @@ -161,7 +161,7 @@ if(BUILD_STATIC_LIBS)

set_target_properties(${STATIC_LIB} PROPERTIES
OUTPUT_NAME jsoncpp${STATIC_SUFFIX}
VERSION ${PROJECT_VERSION}
VERSION ${JSONCPP_VERSION}
)

# Set library's runtime search path on OSX
Expand All @@ -188,8 +188,8 @@ if(BUILD_OBJECT_LIBS)

set_target_properties(${OBJECT_LIB} PROPERTIES
OUTPUT_NAME jsoncpp
VERSION ${PROJECT_VERSION}
SOVERSION ${PROJECT_SOVERSION}
VERSION ${JSONCPP_VERSION}
SOVERSION ${JSONCPP_SOVERSION}
POSITION_INDEPENDENT_CODE ON
)

Expand Down
4 changes: 2 additions & 2 deletions src/test_lib_json/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ if(BUILD_SHARED_LIBS)
else()
add_definitions( -DJSON_DLL )
endif()
target_link_libraries(jsoncpp_test jsoncpp_lib)
target_link_libraries(jsoncpp_test JSONCPP_lib)
else()
target_link_libraries(jsoncpp_test jsoncpp_static)
target_link_libraries(jsoncpp_test JSONCPP_static)
endif()

# another way to solve issue #90
Expand Down