Hi,

This is my first submission to the ML, so please let me know if I did
something wrong.

I'm reaching you to ask about Clang support in the FindBoost.cmake script.
AFAIK _Boost_GUESS_COMPILER_PREFIX() function doesn't take Clang into
account, so currently configuration fails if you are using clang++ compiler
and you don't explicitly set Boost_COMPILER variable to "clang[clang
version]".
As part of a C++/CMake course I'm giving I have been modifying the Boost
bootstrapping scripts I did for biicode past year (See
https://github.com/Manu343726/boost). My fork now has a local copy of
FindBoost.cmake that adds the following lines at the beginning of
_Boost_GUESS_COMPILER_PREFIX() function to guess clang prefix:

    if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
        execute_process(COMMAND ${CMAKE_CXX_COMPILER} --version
OUTPUT_VARIABLE out)
        string(REGEX REPLACE ".*clang version ([0-9]+)\\.([0-9]+).*"
"\\1\\2" _boost_COMPILER_VERSION "${out}")
        set(_boost_COMPILER "-clang${_boost_COMPILER_VERSION}")

        if(Boost_DEBUG)
          message(STATUS "EXPERIMENTAL: Clang compiler.
_boost_COMPILER = ${_boost_COMPILER}")
        endif()

    elseif(CMAKE_CXX_COMPILER_ID STREQUAL "Intel"

    ... (Original code follows here)

(Link 
https://github.com/Manu343726/boost/blob/master/blocks/boost/install/FindBoost.cmake#L404)

As you can see the approach is very similar to what's currently done
with gcc: Getting compiler version string and extracting required
version numbers with a regex.

I would like to know if this lack of support is intended behavior,
else propose to patch this if you find my changes above useful.
-- 

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:
http://public.kitware.com/mailman/listinfo/cmake-developers

Reply via email to