ysbaekFox
ysbaekFox

Reputation: 113

I can't get environment variables using CMake in Windows 10

I added THIRD_PARTY environment variable in Windows 10

enter image description here

and I tried using $ENV in CMake to load the path.

But, it failed. When checked using the CMake message function, nothing is output.

I checked the environment variable path once more.

I don't know what my problem is. Please help me.

enter image description here

enter image description here enter image description here

Upvotes: 3

Views: 1008

Answers (1)

vre
vre

Reputation: 6734

You need to close and reopen your console or Visual Studio window after adding or changing the environment variable.

The environment is only passed to a program at startup. Later changes to the environment are not propagated to running programs.

Upvotes: 1

Related Questions