[cmake-developers] [CMake 0013506]: CMAKE_COMMAND variable must always be quoted when using Mac application bundle

Mantis Bug Tracker mantis at public.kitware.com
Fri Aug 31 11:38:01 EDT 2012


The following issue has been SUBMITTED. 
====================================================================== 
http://public.kitware.com/Bug/view.php?id=13506 
====================================================================== 
Reported By:                Jaime Frey
Assigned To:                
====================================================================== 
Project:                    CMake
Issue ID:                   13506
Category:                   CMake
Reproducibility:            always
Severity:                   minor
Priority:                   normal
Status:                     new
====================================================================== 
Date Submitted:             2012-08-31 11:38 EDT
Last Modified:              2012-08-31 11:38 EDT
====================================================================== 
Summary:                    CMAKE_COMMAND variable must always be quoted when
using Mac application bundle
Description: 
When you install the Mac application bundle for CMake, the CMAKE_COMMAND
variable ends up being "/Applications/CMake 2.8-9.app/Contents/bin/cmake". Note
the presence of a space in the path. Any time you try to use the
execute_process() function to run cmake using the ${CMAKE_COMMAND} variable, it
will silent fail because it thinks you're trying to run the command
"/Applications/CMake" with a first argument of "2.8-9.app/Contents/bin/cmake".
To avoid this, you must enclose ${CMAKE_COMMAND} in quotes every time you use
it.

All of the example usage I found of ${CMAKE_COMMAND} online does not quote it
and would be bitten by this behavior.

We use execute_process() to run ${CMAKE_COMMAND} with the -E option in numerous
places in our build files, and it would be easy for someone to forget to quote
${CMAKE_COMMAND}. The best solution we have for now is to manually rename the
application bundle on our Macs to remove the space.

I believe this same problem applies to the variables CMAKE_CTEST_COMMAND and
CMAKE_EDIT_COMMAND.
====================================================================== 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2012-08-31 11:38 Jaime Frey     New Issue                                    
======================================================================




More information about the cmake-developers mailing list