pboettch / json-schema-validator

JSON schema validator for JSON for Modern C++
Other
466 stars 134 forks source link

cmake: add option to disable installing targets #216

Closed res0nance closed 1 year ago

res0nance commented 1 year ago

Due to the install step we are unable to use fetch content without installing nlohmann/json.

With this fix we can simply turn off the install prior to declaring json schema and cmake will not error out

See example

cmake_minimum_required(VERSION 3.13)

project(example)

include(FetchContent)

### Json
FetchContent_Declare(nlohmann_json URL https://github.com/nlohmann/json/releases/download/v3.11.2/json.tar.xz)
FetchContent_MakeAvailable(nlohmann_json)

### Json Schema
FetchContent_Declare(
    json_schema 
    GIT_REPOSITORY https://github.com/pboettch/json-schema-validator.git 
    GIT_TAG main)
FetchContent_MakeAvailable(json_schema)

add_subdirectory(src)
res0nance commented 1 year ago

@pboettch could you review this as well?