[cmake-developers] Objective-C support

Brad King brad.king at kitware.com
Mon Feb 17 10:55:54 EST 2014


On 02/15/2014 04:29 PM, Steve Wilson wrote:
> I just pushed the updated version of objective-c-support to stage.

Nice, thanks.  Here are some comments.

The "CMake<LANG>Compiler.cmake" files cannot have logic like

+if(CMAKE_OBJC_ENABLED AND NOT CMAKE_OBJCXX_ENABLED)

because the languages can be enabled in any order and the final
set is not known when these files are loaded.

I think it will take special C++-implemented logic to magically
use the best-matching language for .m and .mm sources.

> such as CheckOBJCCompilerFlag

I see new modules:

 CheckOBJCCompilerFlag.cmake
 CheckOBJCSourceCompiles.cmake
 CheckOBJCSourceRuns.cmake
 CheckOBJCXXCompilerFlag.cmake
 CheckOBJCXXSourceCompiles.cmake
 CheckOBJCXXSourceRuns.cmake

Rather than an explosion of modules I'd prefer to correct this
historical mistake and create a single API for each check that
takes the language as a parameter.  Modules CheckTypeSize and
CheckStructHasMember recently learned this, for example.  So,
we would need new modules:

 CheckCompilerFlag
 CheckSourceCompiles
 CheckSourceRuns

and then refactor the implementations of the existing modules
for C and CXX to be in terms of the general ones.

If you don't have time to work on that I think we can just leave
out the check modules for now.

Thanks,
-Brad




More information about the cmake-developers mailing list