MantisBT - CMake
View Issue Details
0012942CMakeCMakepublic2012-02-07 16:532016-06-10 14:31
Michael Pechner 
Kitware Robot 
normalminoralways
closedmoved 
maxosx10.6
CMake 2.8.7 
 
0012942: Would like to specify a different default location for OSX binary
We don't put our apps in the default location. We have a change to cmTarget.cxx to make this happen.

We means I finally got permission to report changes my employer made to the code base.
We defines a new property:

  cm->DefineProperty
    ("MACOSX_BUNDLE_BINARY_PATH", cmProperty::TARGET,
     "If unset, the actual linked binary is assumed to be in ",
     "appname.app/Contents/MacOS/appname, if set, then ",
     "appname.app/MACOSX_BUNDLE_BINARY_PATH/appname for iOS apps ",
     "setting this to the NULL string is currently the correct thing");

In cmTarget::NormalGetLocation we added some code to over ride the default location:

  if(this->IsAppBundleOnApple())
    {
    this->Location += this->GetFullName(config, false);
    //
    // iOS binaries are not stored in contents/macos
    //
    const char* path_override = this->GetProperty( "MACOSX_BUNDLE_BINARY_PATH" );
    if( path_override == NULL )
      {
      this->Location += ".app/Contents/MacOS/";
      }
    else
      {
      this->Location += ".app/";
      this->Location += path_override;
      if( *path_override )
        {
        this->Location += "/";
        }
      }
    }
No tags attached.
Issue History
2012-02-07 16:53Michael PechnerNew Issue
2012-02-08 09:06Brad KingNote Added: 0028524
2012-02-08 09:06Brad KingStatusnew => backlog
2016-06-10 14:28Kitware RobotNote Added: 0041980
2016-06-10 14:28Kitware RobotStatusbacklog => resolved
2016-06-10 14:28Kitware RobotResolutionopen => moved
2016-06-10 14:28Kitware RobotAssigned To => Kitware Robot
2016-06-10 14:31Kitware RobotStatusresolved => closed

Notes
(0028524)
Brad King   
2012-02-08 09:06   
This looks like a useful feature. However, there are many more places than just cmTarget::NormalGetLocation that need to know about this property:

$ git grep '\<Contents\>' v2.8.7 -- Source Modules |wc -l
     57

The change will also need a test.
(0041980)
Kitware Robot   
2016-06-10 14:28   
Resolving issue as `moved`.

This issue tracker is no longer used. Further discussion of this issue may take place in the current CMake Issues page linked in the banner at the top of this page.