# CMAKE\_INSTALL\_PREFIX in Spanish on Windows

**URL:** https://discourse.cmake.org/t/cmake-install-prefix-in-spanish-on-windows/2361
**Category:** Code
**Created:** [December 13, 2020, 12:06am UTC](https://discourse.cmake.org/t/cmake-install-prefix-in-spanish-on-windows/2361 "2020-12-13T00:06:21Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![MelvinG24](https://discourse.cmake.org/user_avatar/discourse.cmake.org/melving24/32/1025_2.png) [@MelvinG24](https://discourse.cmake.org/u/MelvinG24)
#### Post date: [December 13, 2020, 12:06am UTC](https://discourse.cmake.org/t/cmake-install-prefix-in-spanish-on-windows/2361/1 "2020-12-13T00:06:21Z")

</div>

How can I define CMAKE\_INSTALL\_PREFIX if Windows is in English to go to C:\program file\ and if Windows is in Spanish to go to C:\Archivos de Programas\

---

<div class="post-metadata">

### Author: ![ben.boeckel](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.cmake.org/u/ben.boeckel)
#### Post date: [December 13, 2020, 2:38am UTC](https://discourse.cmake.org/t/cmake-install-prefix-in-spanish-on-windows/2361/2 "2020-12-13T02:38:10Z")

</div>

I think you can use `$ENV{ProgramFiles}` to get that path in any language. If you need the 32-bit version:

```cmake
set(envvar "ProgramFiles(x86)")
set(program_files "$ENV{${envvar}}")

```

is needed because variable names cannot have `()` in them literally.

---

<div class="post-metadata">

### Author: ![McMartin](https://discourse.cmake.org/user_avatar/discourse.cmake.org/mcmartin/32/150_2.png) [@McMartin](https://discourse.cmake.org/u/McMartin)
#### Post date: [December 13, 2020, 9:49am UTC](https://discourse.cmake.org/t/cmake-install-prefix-in-spanish-on-windows/2361/3 "2020-12-13T09:49:14Z")

</div>

```auto
set(program_files "$ENV{ProgramFiles\(x86\)}")

```

should also work.

---

<div class="post-metadata">

### Author: ![ben.boeckel](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.cmake.org/u/ben.boeckel)
#### Post date: [December 13, 2020, 2:36pm UTC](https://discourse.cmake.org/t/cmake-install-prefix-in-spanish-on-windows/2361/4 "2020-12-13T14:36:09Z")

</div>

I don’t think so (at least with CMP0053 set to NEW) because `\(` is not a recognized escape sequence. We discussed this when I implemented the policy and decided it was rare enough that the workaround was fine.

---

<div class="post-metadata">

### Author: ![McMartin](https://discourse.cmake.org/user_avatar/discourse.cmake.org/mcmartin/32/150_2.png) [@McMartin](https://discourse.cmake.org/u/McMartin)
#### Post date: [December 13, 2020, 8:55pm UTC](https://discourse.cmake.org/t/cmake-install-prefix-in-spanish-on-windows/2361/5 "2020-12-13T20:55:16Z")

</div>

```auto
message("$ENV{ProgramFiles\(x86\)}")

```

gives a warning and doesn’t output what we want:

```auto
CMake Warning (dev) at D:/dev/CMExt/env_var.cmake:1 (message):
  Syntax error in cmake code at

    D:/dev/CMExt/env_var.cmake:1

  when parsing string

    $ENV{ProgramFiles\(x86\)}

  syntax error, unexpected cal_SYMBOL, expecting } (19)

  Policy CMP0010 is not set: Bad variable reference syntax is an error. Run
  "cmake --help-policy CMP0010" for policy details. Use the cmake_policy
  command to set the policy and suppress this warning.
This warning is for project developers. Use -Wno-dev to suppress it.

$ENV{ProgramFiles\(x86\)}

```

* * *

```auto
cmake_policy(SET CMP0010 NEW)
message("$ENV{ProgramFiles\(x86\)}")

```

gives an error and stops processing:

```auto
CMake Error at D:/dev/CMExt/env_var.cmake:2 (message):
  Syntax error in cmake code at

    D:/dev/CMExt/env_var.cmake:2

  when parsing string

    $ENV{ProgramFiles\(x86\)}

  syntax error, unexpected cal_SYMBOL, expecting } (19)

```

* * *

```auto
cmake_policy(SET CMP0053 NEW)
message("$ENV{ProgramFiles\(x86\)}")

```

gives what we want:

```auto
C:\Program Files (x86)

```

---

<div class="post-metadata">

### Author: ![ben.boeckel](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.cmake.org/u/ben.boeckel)
#### Post date: [December 14, 2020, 12:59pm UTC](https://discourse.cmake.org/t/cmake-install-prefix-in-spanish-on-windows/2361/6 "2020-12-14T12:59:55Z")

</div>

Oh, maybe we decided differently. In that case, carry on 🙂 . It’s too late to change such a minor behavior that has a small upside IMO 🙂 .

---

<div class="post-metadata">

### Author: ![MelvinG24](https://discourse.cmake.org/user_avatar/discourse.cmake.org/melving24/32/1025_2.png) [@MelvinG24](https://discourse.cmake.org/u/MelvinG24)
#### Post date: [December 15, 2020, 3:59am UTC](https://discourse.cmake.org/t/cmake-install-prefix-in-spanish-on-windows/2361/7 "2020-12-15T03:59:43Z")

</div>

Thank you very much, it really helps.
