[CMake] CHECK_INCLUDE_FILE_CXX with built from source compiler

houssen houssen at ipgp.fr
Wed Mar 15 05:12:44 EDT 2017


For the record, the solution is (try_compile needs this option):
SET(CMAKE_REQUIRED_FLAGS "-std=c++11")

Is there a way to get this flag whatever the compiler to do this ? 
[SET_TARGET_PROPERTIES(myTarget PROPERTIES CXX_STANDARD 11) seems to be 
relevant only for target - flags are not available]

Franck

Le 2017-03-13 19:36, houssen a écrit :
> Forgot to mention:
>
> ~> cmake --version
> cmake version 3.5.0
>
>
> Le 2017-03-13 19:33, houssen a écrit :
>> Hello,
>>
>> I do NOT use /usr/bin/g++ that is installed in the system (long 
>> story
>> - don't ask why).
>> I compiled gcc from source and installed it in 
>> /my/path/local/bin/g++.
>>
>> Now I need to check for tuple with CHECK_INCLUDE_FILE_CXX : it fails 
>> !
>>
>> Still failing if:
>> 1. I export CPLUS_INCLUDE_PATH to point at
>> /my/path/local/include/c++/x.y.z (I checked: tuple is here)
>> 2. set this before calling CHECK_INCLUDE_FILE_CXX :
>>   SET ( CMAKE_REQUIRED_FLAGS "-I$ENV{CPLUS_INCLUDE_PATH}" )
>>   SET ( CMAKE_REQUIRED_INCLUDES "$ENV{CPLUS_INCLUDE_PATH}" )
>>
>> What is wrong ?
>>
>> Franck
>
> --
>
> 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



More information about the CMake mailing list