Skip to content

Commit c27b2e1

Browse files
committed
Rename NAME to CMAKE_PACKAGE_NAME.
1 parent 1b7b97b commit c27b2e1

File tree

1 file changed

+16
-16
lines changed

1 file changed

+16
-16
lines changed

exports/taskfiles/utils/cmake.yaml

+16-16
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,8 @@ tasks:
8686
8787
# Runs the CMake install step for the given build directory. The caller must have previously
8888
# 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`.
9191
#
9292
# NOTE: We purposely omit `sources` and `generates` as we defer to `cmake` to decide whether it
9393
# should perform any actions.
@@ -97,8 +97,8 @@ tasks:
9797
# @param {string} [CMAKE_SETTINGS_DIR] If set, the directory where the project's CMake settings
9898
# file should be stored.
9999
# @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.
102102
install:
103103
internal: true
104104
label: "{{.TASK}}:{{.BUILD_DIR}}-{{.INSTALL_PREFIX}}-{{.EXTRA_ARGS}}"
@@ -112,10 +112,10 @@ tasks:
112112
preconditions:
113113
- sh: >-
114114
{{if .CMAKE_SETTINGS_DIR}}
115-
{{not (empty .NAME)}}
115+
{{not (empty .CMAKE_PACKAGE_NAME)}}
116116
{{end}}
117117
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.
119119
CMAKE_SETTINGS_DIR: {{.CMAKE_SETTINGS_DIR}}
120120
cmds:
121121
- >-
@@ -127,19 +127,19 @@ tasks:
127127
{{- end}}
128128
- >-
129129
{{- if .CMAKE_SETTINGS_DIR}}
130-
echo "set({{.NAME}}_ROOT
130+
echo "set({{.CMAKE_PACKAGE_NAME}}_ROOT
131131
\"{{.INSTALL_PREFIX}}\"
132132
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"
135135
{{- end}}
136136
137137
# Downloads a CMake project tar file from `TAR_URL` and then generates, builds, and installs the
138138
# project. We purposely omit `sources` and `generates` as we defer to `cmake` to decide whether it
139139
# should perform any actions. However, the download and extraction will be skipped if unnecessary.
140140
#
141141
# Required parameters
142-
# @param {string} NAME CMake package name.
142+
# @param {string} CMAKE_PACKAGE_NAME CMake package name.
143143
# @param {string} TAR_SHA256 Content hash to verify the downloaded tar file against.
144144
# @param {string} TAR_URL URL of the tar file to download.
145145
# @param {string} WORK_DIR Directory in which to store the build, install, and source directories.
@@ -159,7 +159,7 @@ tasks:
159159
# target.
160160
install-remote-tar:
161161
internal: true
162-
label: "{{.TASK}}:{{.NAME}}-{{.TAR_URL}}-{{.INSTALL_PREFIX}}"
162+
label: "{{.TASK}}:{{.CMAKE_PACKAGE_NAME}}-{{.TAR_URL}}-{{.INSTALL_PREFIX}}"
163163
vars:
164164
# CMake parameters
165165
CMAKE_BUILD_ARGS:
@@ -176,12 +176,12 @@ tasks:
176176
ref: "default (list) .CMAKE_TARGETS"
177177

178178
# 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"
182182

183183
requires:
184-
vars: ["NAME", "TAR_SHA256", "TAR_URL", "WORK_DIR"]
184+
vars: ["CMAKE_PACKAGE_NAME", "TAR_SHA256", "TAR_URL", "WORK_DIR"]
185185
deps:
186186
- task: "remote:download-and-extract-tar"
187187
vars:
@@ -210,7 +210,7 @@ tasks:
210210
EXTRA_ARGS:
211211
ref: ".CMAKE_INSTALL_ARGS"
212212
INSTALL_PREFIX: "{{.INSTALL_PREFIX}}"
213-
NAME: "{{.NAME}}"
213+
CMAKE_PACKAGE_NAME: "{{.CMAKE_PACKAGE_NAME}}"
214214

215215
# Sets up all CMake dependencies for a project by:
216216
#

0 commit comments

Comments
 (0)