diff options
author | James Rowe <jroweboy@gmail.com> | 2020-05-08 23:09:29 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-05-08 23:09:29 +0200 |
commit | bc30a591ba7252e0c16d9c1b3c75a7073735bcae (patch) | |
tree | 2e88ab16d60c7df3e665bcf7c75c24683cb07189 /externals/find-modules/Findnlohmann_json.cmake | |
parent | Merge pull request #3885 from ReinUsesLisp/viewport-swizzles (diff) | |
download | yuzu-bc30a591ba7252e0c16d9c1b3c75a7073735bcae.tar yuzu-bc30a591ba7252e0c16d9c1b3c75a7073735bcae.tar.gz yuzu-bc30a591ba7252e0c16d9c1b3c75a7073735bcae.tar.bz2 yuzu-bc30a591ba7252e0c16d9c1b3c75a7073735bcae.tar.lz yuzu-bc30a591ba7252e0c16d9c1b3c75a7073735bcae.tar.xz yuzu-bc30a591ba7252e0c16d9c1b3c75a7073735bcae.tar.zst yuzu-bc30a591ba7252e0c16d9c1b3c75a7073735bcae.zip |
Diffstat (limited to 'externals/find-modules/Findnlohmann_json.cmake')
-rw-r--r-- | externals/find-modules/Findnlohmann_json.cmake | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/externals/find-modules/Findnlohmann_json.cmake b/externals/find-modules/Findnlohmann_json.cmake new file mode 100644 index 000000000..a3bf1d774 --- /dev/null +++ b/externals/find-modules/Findnlohmann_json.cmake @@ -0,0 +1,35 @@ + +find_package(PkgConfig QUIET) +pkg_check_modules(PC_nlohmann_json QUIET nlohmann_json) + +find_path(nlohmann_json_INCLUDE_DIR + NAMES json.hpp + PATHS ${PC_nlohmann_json_INCLUDE_DIRS} + PATH_SUFFIXES nlohmann +) + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(nlohmann_json + FOUND_VAR nlohmann_json_FOUND + REQUIRED_VARS + nlohmann_json_INCLUDE_DIR + VERSION_VAR nlohmann_json_VERSION +) + +if(nlohmann_json_FOUND) + set(nlohmann_json_INCLUDE_DIRS ${nlohmann_json_INCLUDE_DIR}) + set(nlohmann_json_DEFINITIONS ${PC_nlohmann_json_CFLAGS_OTHER}) +endif() + +if(nlohmann_json_FOUND AND NOT TARGET nlohmann_json::nlohmann_json) + add_library(nlohmann_json::nlohmann_json UNKNOWN IMPORTED) + set_target_properties(nlohmann_json::nlohmann_json PROPERTIES + IMPORTED_LOCATION "${nlohmann_json_LIBRARY}" + INTERFACE_COMPILE_OPTIONS "${PC_nlohmann_json_CFLAGS_OTHER}" + INTERFACE_INCLUDE_DIRECTORIES "${nlohmann_json_INCLUDE_DIR}" + ) +endif() + +mark_as_advanced( + nlohmann_json_INCLUDE_DIR +) |