Skip to content

Add case sensitive NPM config integration #151

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 20, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -223,20 +223,20 @@ For current user:
npm config set cmake_<key> <value>
```

CMake.js will set a variable named uppercase `"<key>"` to `<value>` (by using `-D<key>="<value>"` option). User's settings will **overwrite** globals.
CMake.js will set a variable named `"<key>"` to `<value>` (by using `-D<key>="<value>"` option). User's settings will **overwrite** globals.

#### Example:

Enter at command prompt:

```
npm config set cmake_bubu="kittyfck"
npm config set cmake_BuBu="kittyfck"
```

Then write to your CMakeLists.txt the following:

```cmake
message (STATUS ${BUBU})
message (STATUS ${BuBu})
```

This will print during configure:
Expand Down
5 changes: 2 additions & 3 deletions lib/es5/cMake.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 2 additions & 3 deletions lib/es6/cMake.js
Original file line number Diff line number Diff line change
Expand Up @@ -192,10 +192,9 @@ CMake.prototype.getConfigureCommand = async(function* () {

// Load NPM config
for (let key of _.keys(npmConfigData)) {
let ukey = key.toUpperCase();
if (_.startsWith(ukey, "CMAKE_")) {
if (_.startsWith(key, "cmake_")) {
let s = {};
let sk = ukey.substr(6);
let sk = key.substr(6);
if (sk) {
s[sk] = npmConfigData[key];
if (s[sk]) {
Expand Down