@@ -142,7 +142,8 @@ tasks:
142
142
# @param {string} CMAKE_PACKAGE_NAME CMake package name.
143
143
# @param {string} TAR_SHA256 Content hash to verify the downloaded tar file against.
144
144
# @param {string} TAR_URL URL of the tar file to download.
145
- # @param {string} WORK_DIR Directory in which to store the build, install, and source directories.
145
+ # @param {string} WORK_DIR Directory in which to store the build, install, and extraction
146
+ # directories.
146
147
#
147
148
# CMake parameters
148
149
# @param {string[]} [CMAKE_BUILD_ARGS] Any additional arguments to pass to the CMake build
@@ -155,6 +156,8 @@ tasks:
155
156
# omitted, the native build tool's default number is used. See `man cmake`.
156
157
# @param {string} [CMAKE_SETTINGS_DIR] The directory where the project's CMake settings file
157
158
# should be stored.
159
+ # @param {string} [CMAKE_SOURCE_DIR=.] The path, within the extraction directory, containing the
160
+ # project's top level CMakeLists.txt.
158
161
# @param {string[]} [CMAKE_TARGETS] A list of specific targets to build instead of the default
159
162
# target.
160
163
install-remote-tar :
@@ -172,29 +175,31 @@ tasks:
172
175
{{default "" .CMAKE_JOBS}}
173
176
CMAKE_SETTINGS_DIR : >-
174
177
{{default "" .CMAKE_SETTINGS_DIR}}
178
+ CMAKE_SOURCE_DIR : >-
179
+ {{default "." .CMAKE_SOURCE_DIR}}
175
180
CMAKE_TARGETS :
176
181
ref : " default (list) .CMAKE_TARGETS"
177
182
178
183
# Directory parameters
179
184
BUILD_DIR : " {{.WORK_DIR}}/{{.CMAKE_PACKAGE_NAME}}-build"
185
+ EXTRACTION_DIR : " {{.WORK_DIR}}/{{.CMAKE_PACKAGE_NAME}}-extracted"
180
186
INSTALL_PREFIX : " {{.WORK_DIR}}/{{.CMAKE_PACKAGE_NAME}}-install"
181
- SOURCE_DIR : " {{.WORK_DIR}}/{{.CMAKE_PACKAGE_NAME}}-src"
182
187
183
188
requires :
184
189
vars : ["CMAKE_PACKAGE_NAME", "TAR_SHA256", "TAR_URL", "WORK_DIR"]
185
190
deps :
186
191
- task : " remote:download-and-extract-tar"
187
192
vars :
188
193
FILE_SHA256 : " {{.TAR_SHA256}}"
189
- OUTPUT_DIR : " {{.SOURCE_DIR }}"
194
+ OUTPUT_DIR : " {{.EXTRACTION_DIR }}"
190
195
URL : " {{.TAR_URL}}"
191
196
cmds :
192
197
- task : " generate"
193
198
vars :
194
199
BUILD_DIR : " {{.BUILD_DIR}}"
195
200
EXTRA_ARGS :
196
201
ref : " .CMAKE_GEN_ARGS"
197
- SOURCE_DIR : " {{.SOURCE_DIR }}"
202
+ SOURCE_DIR : " {{.EXTRACTION_DIR}}/{{.CMAKE_SOURCE_DIR }}"
198
203
- task : " build"
199
204
vars :
200
205
BUILD_DIR : " {{.BUILD_DIR}}"
0 commit comments