Skip to content

Commit 4c0ee3a

Browse files
pfultz2pantor
authored andcommitted
Improve support for installing with cget (#88)
* Improve support for installing with cget * add specific version, clean cmake * fix version to "v2.1.0"
1 parent 89652ca commit 4c0ee3a

File tree

4 files changed

+18
-9
lines changed

4 files changed

+18
-9
lines changed

Diff for: CMakeLists.txt

+11-5
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ project(inja LANGUAGES CXX VERSION 2.0.0)
77
option(INJA_USE_EMBEDDED_JSON "Use the shipped json header if not available on the system" ON)
88
option(INJA_INSTALL "Generate install targets for inja" ON)
99
option(INJA_EXPORT "Export the current build tree to the package registry" ON)
10-
option(BUILD_TESTS "Build the inja unit tests" ON)
11-
option(BUILD_BENCHMARK "Build the inja benchmark" ON)
10+
option(BUILD_TESTING "Build unit tests" ON)
11+
option(BUILD_BENCHMARK "Build benchmark" ON)
1212
option(COVERALLS "Generate coveralls data" OFF)
1313

1414
set(INJA_INSTALL_INCLUDE_DIR "include")
@@ -82,7 +82,7 @@ if (COVERALLS)
8282
endif()
8383

8484

85-
if(BUILD_TESTS)
85+
if(BUILD_TESTING)
8686
enable_testing()
8787

8888
add_executable(inja_test
@@ -114,6 +114,7 @@ if(BUILD_BENCHMARK)
114114
target_link_libraries(inja_benchmark PRIVATE inja)
115115
endif()
116116

117+
117118
include(CMakePackageConfigHelpers)
118119

119120
write_basic_package_version_file(
@@ -122,28 +123,32 @@ write_basic_package_version_file(
122123
COMPATIBILITY SameMajorVersion
123124
)
124125

126+
125127
# build tree package config
126128
configure_file(
127129
cmake/config/injaBuildConfig.cmake.in
128130
injaConfig.cmake
129131
@ONLY
130132
)
131133

134+
132135
install(TARGETS inja EXPORT injaTargets)
133136

137+
134138
export(
135139
EXPORT injaTargets
136140
NAMESPACE pantor::
137141
FILE "${CMAKE_CURRENT_BINARY_DIR}/injaTargets.cmake"
138142
)
139-
143+
140144
# build tree package config
141145
configure_file(
142146
cmake/config/injaBuildConfig.cmake.in
143147
injaConfig.cmake
144148
@ONLY
145149
)
146150

151+
147152
if (INJA_INSTALL)
148153
set(INJA_CONFIG_PATH "lib/cmake/inja")
149154

@@ -163,7 +168,7 @@ if (INJA_INSTALL)
163168
)
164169

165170
install(
166-
FILES
171+
FILES
167172
"${CMAKE_CURRENT_BINARY_DIR}/${INJA_CONFIG_PATH}/injaConfig.cmake"
168173
"${CMAKE_CURRENT_BINARY_DIR}/injaConfigVersion.cmake"
169174
DESTINATION ${INJA_CONFIG_PATH}
@@ -176,6 +181,7 @@ if (INJA_INSTALL)
176181
)
177182
endif()
178183

184+
179185
if (INJA_EXPORT)
180186
export(PACKAGE inja)
181187
endif()

Diff for: README.md

+2
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ You can also integrate inja in your project using [Hunter](https://github.com/ru
3939

4040
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.
4141

42+
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/[email protected]`.
43+
4244

4345
## Tutorial
4446

Diff for: meson.build

+4-4
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,14 @@ inja_dep = declare_dependency(
1414
amalg_script = files('scripts/update_single_include.sh')
1515

1616
amalg_files = files(
17-
'include/inja/inja.hpp',
17+
'include/inja/inja.hpp',
1818
'include/inja/renderer.hpp',
1919
'include/inja/environment.hpp',
20-
)
20+
)
2121

22-
amalg_tgt = run_target( 'amalg',
22+
amalg_tgt = run_target( 'amalg',
2323
command: amalg_script
24-
)
24+
)
2525

2626

2727
inja_test = executable(

Diff for: requirements.txt

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+

0 commit comments

Comments
 (0)