summaryrefslogtreecommitdiff
path: root/externals/find-modules/Findnlohmann_json.cmake
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--externals/find-modules/Findnlohmann_json.cmake51
1 files changed, 0 insertions, 51 deletions
diff --git a/externals/find-modules/Findnlohmann_json.cmake b/externals/find-modules/Findnlohmann_json.cmake
deleted file mode 100644
index 8a3958cf1..000000000
--- a/externals/find-modules/Findnlohmann_json.cmake
+++ /dev/null
@@ -1,51 +0,0 @@
1# SPDX-FileCopyrightText: 2020 yuzu Emulator Project
2# SPDX-License-Identifier: GPL-2.0-or-later
3
4find_package(PkgConfig QUIET)
5pkg_check_modules(PC_nlohmann_json QUIET nlohmann_json)
6
7find_path(nlohmann_json_INCLUDE_DIR
8 NAMES json.hpp
9 PATHS ${PC_nlohmann_json_INCLUDE_DIRS}
10 PATH_SUFFIXES nlohmann
11)
12
13if(nlohmann_json_INCLUDE_DIR)
14 file(STRINGS "${nlohmann_json_INCLUDE_DIR}/json.hpp" _nlohmann_json_version_lines
15 REGEX "#define[ \t]+NLOHMANN_JSON_VERSION_(MAJOR|MINOR|PATCH)")
16 string(REGEX REPLACE ".*NLOHMANN_JSON_VERSION_MAJOR +\([0-9]+\).*" "\\1" _nlohmann_json_version_major "${_nlohmann_json_version_lines}")
17 string(REGEX REPLACE ".*NLOHMANN_JSON_VERSION_MINOR +\([0-9]+\).*" "\\1" _nlohmann_json_version_minor "${_nlohmann_json_version_lines}")
18 string(REGEX REPLACE ".*NLOHMANN_JSON_VERSION_PATCH +\([0-9]+\).*" "\\1" _nlohmann_json_version_patch "${_nlohmann_json_version_lines}")
19 set(nlohmann_json_VERSION "${_nlohmann_json_version_major}.${_nlohmann_json_version_minor}.${_nlohmann_json_version_patch}")
20 unset(_nlohmann_json_version_major)
21 unset(_nlohmann_json_version_minor)
22 unset(_nlohmann_json_version_patch)
23 unset(_nlohmann_json_version_lines)
24endif()
25
26include(FindPackageHandleStandardArgs)
27find_package_handle_standard_args(nlohmann_json
28 FOUND_VAR nlohmann_json_FOUND
29 REQUIRED_VARS
30 nlohmann_json_INCLUDE_DIR
31 nlohmann_json_VERSION
32 VERSION_VAR nlohmann_json_VERSION
33)
34
35if(nlohmann_json_FOUND)
36 set(nlohmann_json_INCLUDE_DIRS ${nlohmann_json_INCLUDE_DIR})
37 set(nlohmann_json_DEFINITIONS ${PC_nlohmann_json_CFLAGS_OTHER})
38endif()
39
40if(nlohmann_json_FOUND AND NOT TARGET nlohmann_json::nlohmann_json)
41 add_library(nlohmann_json::nlohmann_json UNKNOWN IMPORTED)
42 set_target_properties(nlohmann_json::nlohmann_json PROPERTIES
43 IMPORTED_LOCATION "${nlohmann_json_LIBRARY}"
44 INTERFACE_COMPILE_OPTIONS "${PC_nlohmann_json_CFLAGS_OTHER}"
45 INTERFACE_INCLUDE_DIRECTORIES "${nlohmann_json_INCLUDE_DIR}"
46 )
47endif()
48
49mark_as_advanced(
50 nlohmann_json_INCLUDE_DIR
51)