using system json lib if available

(works on Arch Linux)
This commit is contained in:
Martin Brodbeck 2019-10-11 09:09:18 +02:00
parent b016452a06
commit f37cd75502

View file

@ -10,8 +10,14 @@ cmake = import('cmake')
#csv = cmake.subproject('csv-parser')
#csv_lib = csv.dependency('csv')
nlohmann = cmake.subproject('nlohmann_json', cmake_options : ['-DJSON_BuildTests=OFF', '-DCMAKE_BUILD_TYPE=Release'])
nlohmann_lib = nlohmann.dependency('nlohmann_json')
nlohmann_lib = dependency('nlohmann_json', version : '>=3.5.0', required : false)
if not nlohmann_lib.found()
nlohmann = cmake.subproject('nlohmann_json',
cmake_options : ['-DJSON_BuildTests=OFF', '-DCMAKE_BUILD_TYPE=Release'])
nlohmann_lib = nlohmann.dependency('nlohmann_json')
endif
singleapp_proj = subproject('singleapplication')
singleapp_lib = singleapp_proj.get_variable('singleapp_lib')