Improve support for installing with cget (#88)
* Improve support for installing with cget
* add specific version, clean cmake
* fix version to "v2.1.0"
diff --git a/CMakeLists.txt b/CMakeLists.txt
index d19b92f..115c898 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -7,8 +7,8 @@
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 @@
endif()
-if(BUILD_TESTS)
+if(BUILD_TESTING)
enable_testing()
add_executable(inja_test
@@ -114,6 +114,7 @@
target_link_libraries(inja_benchmark PRIVATE inja)
endif()
+
include(CMakePackageConfigHelpers)
write_basic_package_version_file(
@@ -122,6 +123,7 @@
COMPATIBILITY SameMajorVersion
)
+
# build tree package config
configure_file(
cmake/config/injaBuildConfig.cmake.in
@@ -129,14 +131,16 @@
@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 @@
@ONLY
)
+
if (INJA_INSTALL)
set(INJA_CONFIG_PATH "lib/cmake/inja")
@@ -163,7 +168,7 @@
)
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 @@
)
endif()
+
if (INJA_EXPORT)
export(PACKAGE inja)
endif()
diff --git a/README.md b/README.md
index a6913ae..f82d4c5 100644
--- a/README.md
+++ b/README.md
@@ -39,6 +39,8 @@
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 810da17..b2c5225 100644
--- a/meson.build
+++ b/meson.build
@@ -14,14 +14,14 @@
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 0000000..e42faaa
--- /dev/null
+++ b/requirements.txt
@@ -0,0 +1 @@
+nlohmann/json@v3.5.0