FindJson: use PATH_SUFFIXES jsoncpp to find incdir
authorIgor Gnatenko <i.gnatenko.brain@gmail.com>
Mon, 24 Aug 2015 16:05:41 +0000 (19:05 +0300)
committerest31 <MTest31@outlook.com>
Sat, 26 Sep 2015 19:43:01 +0000 (21:43 +0200)
For example, on Fedora systems jsoncpp headers is installed in `/usr/include/jsoncpp`.

cmake/Modules/FindJson.cmake

index 8e355b93fd46bbf4f0cc78e000b2e4e4f129f249..1558b0fcfab63c894ca61546b51188172a46f201 100644 (file)
@@ -8,7 +8,7 @@ option(ENABLE_SYSTEM_JSONCPP "Enable using a system-wide JSONCPP.  May cause seg
 
 if(ENABLE_SYSTEM_JSONCPP)
        find_library(JSON_LIBRARY NAMES jsoncpp)
-       find_path(JSON_INCLUDE_DIR json/features.h)
+       find_path(JSON_INCLUDE_DIR json/features.h PATH_SUFFIXES jsoncpp)
 
        include(FindPackageHandleStandardArgs)
        find_package_handle_standard_args(JSONCPP DEFAULT_MSG JSON_LIBRARY JSON_INCLUDE_DIR)