[cmake-developers] <FLAGS> on Darwin and custom languages

Brad King brad.king at kitware.com
Wed Oct 9 08:18:00 EDT 2013


On 10/08/2013 07:12 PM, Vittorio Giovara wrote:
> I noticed that in 2.8.11 under OSX CMake adds -F/Library/Frameworks in
> every kind of <FLAGS> rule, for any language.

The flag is hard-coded in the C++-implemented generator code under
the assumption that all compilers on APPLE support -F.  The "-F"
option appears in a few places literally in the C++ source:

$ git grep -- '"-F"' v2.8.11 -- 'Source/*.cxx'
v2.8.11:Source/cmCTest.cxx:  if(this->CheckArgument(arg, "-F"))
v2.8.11:Source/cmLocalGenerator.cxx:          << "-F" << this->Convert(frameworkDir.c_str(),
v2.8.11:Source/cmLocalGenerator.cxx:    frameworkPath += "-F";
v2.8.11:Source/cmMakefileTargetGenerator.cxx:        flags += "-F";
v2.8.11:Source/cmQtAutomoc.cxx:    this->MocIncludes.push_back("-F");
v2.8.11:Source/ctest.cxx:  {"-F", "Enable failover.", "This option allows ctest to resume a test "

Take a look at the occurrences in cmLocalGenerator.cxx and in
cmMakefileTargetGenerator.cxx.  The hard-coded "-F" should be
replaced with a platform information variable lookup that depends
on the language.  One could introduce a new variable such as

 CMAKE_<LANG>_FRAMEWORK_SEARCH_FLAG

and set it to -F in the upstream platform files but not in your
pascal file.

-Brad



More information about the cmake-developers mailing list