86
86
87
87
# Runs the CMake install step for the given build directory. The caller must have previously
88
88
# called `build` on `BUILD_DIR` for this task to succeed. If `CMAKE_SETTINGS_DIR` is set, a
89
- # settings file will be created in that directory, containing a `{{.NAME }}_ROOT` CMake variable
90
- # that points to `INSTALL_PREFIX`.
89
+ # settings file will be created in that directory, containing a `{{.CMAKE_PACKAGE_NAME }}_ROOT`
90
+ # CMake variable that points to `INSTALL_PREFIX`.
91
91
#
92
92
# NOTE: We purposely omit `sources` and `generates` as we defer to `cmake` to decide whether it
93
93
# should perform any actions.
97
97
# @param {string} [CMAKE_SETTINGS_DIR] If set, the directory where the project's CMake settings
98
98
# file should be stored.
99
99
# @param {string[]} [EXTRA_ARGS] Any additional arguments to pass to the install command.
100
- # @param {string} [NAME ] CMake project name (used in directory names and the CMake settings file).
101
- # Required if `CMAKE_SETTINGS_DIR` is set.
100
+ # @param {string} [CMAKE_PACKAGE_NAME ] CMake project name (used in directory names and the CMake
101
+ # settings file). Required if `CMAKE_SETTINGS_DIR` is set.
102
102
install :
103
103
internal : true
104
104
label : " {{.TASK}}:{{.BUILD_DIR}}-{{.INSTALL_PREFIX}}-{{.EXTRA_ARGS}}"
@@ -112,10 +112,10 @@ tasks:
112
112
preconditions :
113
113
- sh : >-
114
114
{{if .CMAKE_SETTINGS_DIR}}
115
- {{not (empty .NAME )}}
115
+ {{not (empty .CMAKE_PACKAGE_NAME )}}
116
116
{{end}}
117
117
msg: |-
118
- NAME must be set if CMAKE_SETTINGS_DIR is set.
118
+ CMAKE_PACKAGE_NAME must be set if CMAKE_SETTINGS_DIR is set.
119
119
CMAKE_SETTINGS_DIR: {{.CMAKE_SETTINGS_DIR}}
120
120
cmds :
121
121
- >-
@@ -127,19 +127,19 @@ tasks:
127
127
{{- end}}
128
128
- >-
129
129
{{- if .CMAKE_SETTINGS_DIR}}
130
- echo "set({{.NAME }}_ROOT
130
+ echo "set({{.CMAKE_PACKAGE_NAME }}_ROOT
131
131
\"{{.INSTALL_PREFIX}}\"
132
132
CACHE PATH
133
- \"Package root for {{.NAME }}.\"
134
- )" >> "{{.CMAKE_SETTINGS_DIR}}/{{.NAME }}.cmake"
133
+ \"Package root for {{.CMAKE_PACKAGE_NAME }}.\"
134
+ )" >> "{{.CMAKE_SETTINGS_DIR}}/{{.CMAKE_PACKAGE_NAME }}.cmake"
135
135
{{- end}}
136
136
137
137
# Downloads a CMake project tar file from `TAR_URL` and then generates, builds, and installs the
138
138
# project. We purposely omit `sources` and `generates` as we defer to `cmake` to decide whether it
139
139
# should perform any actions. However, the download and extraction will be skipped if unnecessary.
140
140
#
141
141
# Required parameters
142
- # @param {string} NAME CMake package name.
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
145
# @param {string} WORK_DIR Directory in which to store the build, install, and source directories.
@@ -159,7 +159,7 @@ tasks:
159
159
# target.
160
160
install-remote-tar :
161
161
internal : true
162
- label : " {{.TASK}}:{{.NAME }}-{{.TAR_URL}}-{{.INSTALL_PREFIX}}"
162
+ label : " {{.TASK}}:{{.CMAKE_PACKAGE_NAME }}-{{.TAR_URL}}-{{.INSTALL_PREFIX}}"
163
163
vars :
164
164
# CMake parameters
165
165
CMAKE_BUILD_ARGS :
@@ -176,12 +176,12 @@ tasks:
176
176
ref : " default (list) .CMAKE_TARGETS"
177
177
178
178
# Directory parameters
179
- BUILD_DIR : " {{.WORK_DIR}}/{{.NAME }}-build"
180
- INSTALL_PREFIX : " {{.WORK_DIR}}/{{.NAME }}-install"
181
- SOURCE_DIR : " {{.WORK_DIR}}/{{.NAME }}-src"
179
+ BUILD_DIR : " {{.WORK_DIR}}/{{.CMAKE_PACKAGE_NAME }}-build"
180
+ INSTALL_PREFIX : " {{.WORK_DIR}}/{{.CMAKE_PACKAGE_NAME }}-install"
181
+ SOURCE_DIR : " {{.WORK_DIR}}/{{.CMAKE_PACKAGE_NAME }}-src"
182
182
183
183
requires :
184
- vars : ["NAME ", "TAR_SHA256", "TAR_URL", "WORK_DIR"]
184
+ vars : ["CMAKE_PACKAGE_NAME ", "TAR_SHA256", "TAR_URL", "WORK_DIR"]
185
185
deps :
186
186
- task : " remote:download-and-extract-tar"
187
187
vars :
@@ -210,7 +210,7 @@ tasks:
210
210
EXTRA_ARGS :
211
211
ref : " .CMAKE_INSTALL_ARGS"
212
212
INSTALL_PREFIX : " {{.INSTALL_PREFIX}}"
213
- NAME : " {{.NAME }}"
213
+ CMAKE_PACKAGE_NAME : " {{.CMAKE_PACKAGE_NAME }}"
214
214
215
215
# Sets up all CMake dependencies for a project by:
216
216
#
0 commit comments