diff --git a/CMakeLists.txt b/CMakeLists.txt index d19b92fa..115c898b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -7,8 +7,8 @@ project(inja LANGUAGES CXX VERSION 2.0.0) option(INJA_USE_EMBEDDED_JSON "Use the shipped json header if not available on the system" ON) option(INJA_INSTALL "Generate install targets for inja" ON) option(INJA_EXPORT "Export the current build tree to the package registry" ON) -option(BUILD_TESTS "Build the inja unit tests" ON) -option(BUILD_BENCHMARK "Build the inja benchmark" ON) +option(BUILD_TESTING "Build unit tests" ON) +option(BUILD_BENCHMARK "Build benchmark" ON) option(COVERALLS "Generate coveralls data" OFF) set(INJA_INSTALL_INCLUDE_DIR "include") @@ -82,7 +82,7 @@ if (COVERALLS) endif() -if(BUILD_TESTS) +if(BUILD_TESTING) enable_testing() add_executable(inja_test @@ -114,6 +114,7 @@ if(BUILD_BENCHMARK) target_link_libraries(inja_benchmark PRIVATE inja) endif() + include(CMakePackageConfigHelpers) write_basic_package_version_file( @@ -122,6 +123,7 @@ write_basic_package_version_file( COMPATIBILITY SameMajorVersion ) + # build tree package config configure_file( cmake/config/injaBuildConfig.cmake.in @@ -129,14 +131,16 @@ configure_file( @ONLY ) + install(TARGETS inja EXPORT injaTargets) + export( EXPORT injaTargets NAMESPACE pantor:: FILE "${CMAKE_CURRENT_BINARY_DIR}/injaTargets.cmake" ) - + # build tree package config configure_file( cmake/config/injaBuildConfig.cmake.in @@ -144,6 +148,7 @@ configure_file( @ONLY ) + if (INJA_INSTALL) set(INJA_CONFIG_PATH "lib/cmake/inja") @@ -163,7 +168,7 @@ if (INJA_INSTALL) ) install( - FILES + FILES "${CMAKE_CURRENT_BINARY_DIR}/${INJA_CONFIG_PATH}/injaConfig.cmake" "${CMAKE_CURRENT_BINARY_DIR}/injaConfigVersion.cmake" DESTINATION ${INJA_CONFIG_PATH} @@ -176,6 +181,7 @@ if (INJA_INSTALL) ) endif() + if (INJA_EXPORT) export(PACKAGE inja) endif() diff --git a/README.md b/README.md index a6913aee..f82d4c55 100644 --- a/README.md +++ b/README.md @@ -39,6 +39,8 @@ You can also integrate inja in your project using [Hunter](https://github.com/ru If you are using [vcpkg](https://github.com/Microsoft/vcpkg) on your project for external dependencies, then you can use the [inja package](https://github.com/Microsoft/vcpkg/tree/master/ports/inja). Please see the vcpkg project for any issues regarding the packaging. +If you are using [cget](https://cget.readthedocs.io/en/latest/), you can install the latest development version with `cget install pantor/inja`. A specific version can be installed with `cget install pantor/inja@v2.1.0`. + ## Tutorial diff --git a/meson.build b/meson.build index 810da170..b2c52253 100644 --- a/meson.build +++ b/meson.build @@ -14,14 +14,14 @@ inja_dep = declare_dependency( amalg_script = files('scripts/update_single_include.sh') amalg_files = files( - 'include/inja/inja.hpp', + 'include/inja/inja.hpp', 'include/inja/renderer.hpp', 'include/inja/environment.hpp', - ) +) -amalg_tgt = run_target( 'amalg', +amalg_tgt = run_target( 'amalg', command: amalg_script - ) +) inja_test = executable( diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 00000000..e42faaa0 --- /dev/null +++ b/requirements.txt @@ -0,0 +1 @@ +nlohmann/json@v3.5.0