[CMake] CMP0053: Unable to refer to $ENV{PROGRAMFILES(X86)}

Mario *LigH* Rohkrämer contact at ligh.de
Thu Nov 13 03:51:05 EST 2014


Greetings.

Updating CMake to v3.1.0-rc1, I get a warning CMP0053 when building the  
x265 project (https://bitbucket.org/multicoreware/x265).

source/cmake/FindVLD.cmake contains a statement listing several paths  
where to look for an installation of the Visual Leak Detector:

+----
FIND_PATH (VLD_ROOT_DIR
   NAMES include/vld.h
   PATHS ENV VLDROOT
         "$ENV{PROGRAMFILES}/Visual Leak Detector"
         "$ENV{PROGRAMFILES(X86)}/Visual Leak Detector"
         "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\Visual  
Leak Detector;InstallLocation]"
         "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\Visual  
Leak Detector;InstallLocation]"
   DOC "VLD root directory")
+----

Win64 has two distinct environment variables pointing to usual program  
installation paths:

   * for Win64 applications = %ProgramFiles%
   * for Win32 applications = %ProgramFiles(x86)%

The line

         "$ENV{PROGRAMFILES(X86)}/Visual Leak Detector"

causes warning CMP0053 because parentheses in identifiers are not allowed.  
Trying to escape them to

         "$ENV{PROGRAMFILES\(X86\)}/Visual Leak Detector"

instead errors out: Syntax error in cmake code; unexpected cal_SYMBOL,  
expecting } (19)

How can this be solved? Is it possible to "quote inside quotes", or are  
there different escapes?

-- 

Fun and success!
Mario *LigH* Rohkrämer
mailto:contact at ligh.de
 


More information about the CMake mailing list