target_compile_features no known features for CXX compiler for clang 9.0

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

target_compile_features no known features for CXX compiler for clang 9.0

Rick Mann
Trying to build Ceres, I'm running into an issue in which CMake 3.11.0-rc3 doesn't seem to recognize the clang that comes with the latest Xcode (Version 9.2 (9C40b)). Googling turns up similar, but old results, that seem to suggest one needs to update CMake. But -rc4 is the only more recent version, and its release notes don't say anything about this.

CMake Error at cmake/AddCeresCXX11RequirementsToTarget.cmake:70 (target_compile_features):
  target_compile_features no known features for CXX compiler

  "Clang"

  version 9.0.0.9000039.


Any suggestions? Thanks.


--
Rick Mann
--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
https://cmake.org/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|

Re: target_compile_features no known features for CXX compiler for clang 9.0

Brad King
On 03/20/2018 08:52 PM, Rick Mann wrote:
> Xcode (Version 9.2 (9C40b))

That works with CMake 3.11.0-rc4 AFAIK.

> CMake Error at cmake/AddCeresCXX11RequirementsToTarget.cmake:70 (target_compile_features):
>   target_compile_features no known features for CXX compiler
>
>   "Clang"
>
>   version 9.0.0.9000039.

The compiler id should be AppleClang to work with compiler features,
but that is controlled by policy CMP0025:

  https://cmake.org/cmake/help/v3.11/policy/CMP0025.html

As of Ceres 1.14.0 they are not setting that policy to NEW:

  https://github.com/ceres-solver/ceres-solver/blob/1.14.0/CMakeLists.txt#L32-L40

That is necessary for this code:

  https://github.com/ceres-solver/ceres-solver/blob/1.14.0/cmake/AddCeresCXX11RequirementsToTarget.cmake#L58-L71

to work, since the target_compile_features command expects
behavior as of CMake 3.1 or above.  Typically the command
would only be used after `cmake_minimum_required(VERSION 3.1)`
which would automatically set CMP0025 to NEW.

Ceres is trying to support older CMake versions and so would
need to set the policy manually.

-Brad
--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
https://cmake.org/mailman/listinfo/cmake