Commit a5768442 authored by Brad King's avatar Brad King

FindJsonCpp: Drop new module due to upstream jsoncpp providing package

Since jsoncpp 0.7.0 (2014-11-20) the upstream may provide a CMake
package configuration file such that find_package(jsoncpp) will find a
jsoncppConfig.cmake file.  In order to avoid conflicting with this
(especially on case-insensitive filesystems), and since we always prefer
projects to provide package config files (that they maintain), it is
better to not provide FindJsonCpp publicly.

Move FindJsonCpp into a private source directory that is not installed
so that we can still use it for building CMake itself.
Reported-by: Ryan Pavlik's avatarRyan Pavlik <ryan.pavlik@gmail.com>
parent da92cdab
......@@ -382,10 +382,8 @@ macro (CMAKE_BUILD_UTILITIES)
#---------------------------------------------------------------------
# Build jsoncpp library.
if(CMAKE_USE_SYSTEM_JSONCPP)
if(EXISTS ${CMAKE_ROOT}/Modules/FindJsonCpp.cmake)
find_package(JsonCpp)
elseif(NOT CMAKE_VERSION VERSION_LESS 3.0)
include(${CMake_SOURCE_DIR}/Modules/FindJsonCpp.cmake)
if(NOT CMAKE_VERSION VERSION_LESS 3.0)
include(${CMake_SOURCE_DIR}/Source/Modules/FindJsonCpp.cmake)
else()
message(FATAL_ERROR "CMAKE_USE_SYSTEM_JSONCPP requires CMake >= 3.0")
endif()
......
......@@ -126,7 +126,6 @@ All Modules
/module/FindJava
/module/FindJNI
/module/FindJPEG
/module/FindJsonCpp
/module/FindKDE3
/module/FindKDE4
/module/FindLAPACK
......
.. cmake-module:: ../../Modules/FindJsonCpp.cmake
......@@ -124,9 +124,6 @@ Modules
* A :module:`FindIntl` module was introduced to find the
Gettext ``libintl`` library.
* A :module:`FindJsonCpp` module was introduced to find the
JsonCpp package.
* The :module:`FindLATEX` module learned to support components.
* The :module:`FindMPI` module learned to find MS-MPI on Windows.
......
......@@ -93,7 +93,7 @@ unset(_JsonCpp_H_REGEX)
unset(_JsonCpp_H)
#-----------------------------------------------------------------------------
include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
include(${CMAKE_CURRENT_LIST_DIR}/../../Modules/FindPackageHandleStandardArgs.cmake)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(JsonCpp
FOUND_VAR JsonCpp_FOUND
REQUIRED_VARS JsonCpp_LIBRARY JsonCpp_INCLUDE_DIR
......
......@@ -2,6 +2,9 @@ cmake_minimum_required(VERSION 3.1)
project(TestFindJsonCpp CXX)
include(CTest)
# CMake does not actually provide FindJsonCpp publicly.
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/../../../Source/Modules)
find_package(JsonCpp REQUIRED)
add_executable(test_jsoncpp_tgt main.cxx)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment