Skip to content

Commit 56c41fb

Browse files
authored
Merge pull request open-source-parsers#934 from oleurodecision/cmake_config_version
added cmake config version file for proper cmake delivery
2 parents 4babd12 + 0155f38 commit 56c41fb

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

CMakeLists.txt

+6
Original file line numberDiff line numberDiff line change
@@ -168,9 +168,15 @@ if(JSONCPP_WITH_PKGCONFIG_SUPPORT)
168168
endif()
169169

170170
if(JSONCPP_WITH_CMAKE_PACKAGE)
171+
include (CMakePackageConfigHelpers)
171172
install(EXPORT jsoncpp
172173
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/jsoncpp
173174
FILE jsoncppConfig.cmake)
175+
write_basic_package_version_file ("${CMAKE_CURRENT_BINARY_DIR}/jsoncppConfigVersion.cmake"
176+
VERSION ${PROJECT_VERSION}
177+
COMPATIBILITY SameMajorVersion)
178+
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/jsoncppConfigVersion.cmake
179+
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/jsoncpp)
174180
endif()
175181

176182
if(JSONCPP_WITH_TESTS)

0 commit comments

Comments
 (0)