Add simple CLI skeleton
Signed-off-by: Cristian Le <cristian.le@mpsd.mpg.de>
This commit is contained in:
parent
0d60d48a58
commit
8a0b32f1cd
@ -88,7 +88,12 @@ if (CMAKE_VERSION VERSION_GREATER_EQUAL 3.24)
|
|||||||
GIT_TAG ${JSON_FETCH_VERSION}
|
GIT_TAG ${JSON_FETCH_VERSION}
|
||||||
FIND_PACKAGE_ARGS
|
FIND_PACKAGE_ARGS
|
||||||
)
|
)
|
||||||
list(APPEND fetch_packages nlohmann_json)
|
FetchContent_Declare(CLI11
|
||||||
|
GIT_REPOSITORY https://github.com/CLIUtils/CLI11
|
||||||
|
GIT_TAG v2.3.2
|
||||||
|
FIND_PACKAGE_ARGS
|
||||||
|
)
|
||||||
|
list(APPEND fetch_packages nlohmann_json CLI11)
|
||||||
else ()
|
else ()
|
||||||
# Try to get system installed version
|
# Try to get system installed version
|
||||||
find_package(nlohmann_json QUIET)
|
find_package(nlohmann_json QUIET)
|
||||||
@ -100,6 +105,15 @@ else ()
|
|||||||
)
|
)
|
||||||
list(APPEND fetch_packages nlohmann_json)
|
list(APPEND fetch_packages nlohmann_json)
|
||||||
endif ()
|
endif ()
|
||||||
|
find_package(CLI11 QUIET)
|
||||||
|
if (NOT CLI11_FOUND)
|
||||||
|
# If failed fetch the desired version
|
||||||
|
FetchContent_Declare(CLI11
|
||||||
|
GIT_REPOSITORY https://github.com/CLIUtils/CLI11
|
||||||
|
GIT_TAG v2.3.2
|
||||||
|
)
|
||||||
|
list(APPEND fetch_packages nlohmann_json CLI11)
|
||||||
|
endif ()
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
# Handle configure flags
|
# Handle configure flags
|
||||||
@ -140,6 +154,12 @@ set_target_properties(nlohmann_json_schema_validator PROPERTIES
|
|||||||
OUTPUT_NAME nlohmann_json_validator
|
OUTPUT_NAME nlohmann_json_validator
|
||||||
)
|
)
|
||||||
|
|
||||||
|
add_executable(nlohmann_json_schema_validator_cli)
|
||||||
|
set_target_properties(nlohmann_json_schema_validator_cli PROPERTIES
|
||||||
|
EXPORT_NAME cli
|
||||||
|
OUTPUT_NAME json-validator
|
||||||
|
)
|
||||||
|
|
||||||
# Main definitions in here
|
# Main definitions in here
|
||||||
add_subdirectory(src)
|
add_subdirectory(src)
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user