REFACTOR: rewrite CMakeLists.txt for better inlcude and reuse

The rewrite uses more cmake build-in automatisms and build-in generates
variables to allow better generic reuse.
* cmake  files are installed to
``` <install_prefix>/lib/cmake/nlohmann_json/ ``` for best support on
most systems
* include path is set to ``` include ```  for usage as ``` #include
<nlohmann/json.hpp> ```
This commit is contained in:
dan-42 2017-07-29 11:59:09 +02:00
parent c136b6f200
commit f434942371
2 changed files with 68 additions and 50 deletions

View file

@ -1,7 +1,3 @@
@PACKAGE_INIT@
set_and_check(JSON_INCLUDE_DIR "@PACKAGE_JSON_INCLUDE_DESTINATION@")
cmake_policy(PUSH)
cmake_policy(SET CMP0024 OLD)
include(${CMAKE_CURRENT_LIST_DIR}/@JSON_TARGETS_FILENAME@)
cmake_policy(POP)
include("${CMAKE_CURRENT_LIST_DIR}/@NLOHMANN_JSON_TARGETS_EXPORT_NAME@.cmake")
check_required_components("@PROJECT_NAME@")