- exported targets go to separate generated file and package config file generated from template to use automatic package resolving and resolution logic
CMake provides helpers to generate config file. Generated config file has usefull macro check_required_components() to set necessary variables like PackageName_FOUND if requirements has been satisfied. An absence of dedicated config file confuses user project as necessary variables are not set.
diff --git a/jsoncppConfig.cmake.in b/jsoncppConfig.cmake.in
new file mode 100644
index 0000000..e3fa4b9
--- /dev/null
+++ b/jsoncppConfig.cmake.in
@@ -0,0 +1,10 @@
+cmake_policy(PUSH)
+cmake_policy(VERSION 3.0)
+
+@PACKAGE_INIT@
+
+include ( "${CMAKE_CURRENT_LIST_DIR}/jsoncpp-targets.cmake" )
+
+check_required_components(JsonCpp)
+
+cmake_policy(POP)
\ No newline at end of file