<div dir="auto">I would bet that enabling the toolset before launching CMake will do the trick.<div dir="auto">Otherwise set CC and/or CXX env var to the desired path before launching CMake.</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Le jeu. 20 juin 2019 à 17:39, David Aldrich <<a href="mailto:david.aldrich.ntml@gmail.com">david.aldrich.ntml@gmail.com</a>> a écrit :<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">My Centos 7.6 machine has CMake 3.13.5 and g++ 4.8.5 installed:<div><br></div><div>$ /usr/bin/x86_64-redhat-linux-g++ --version<br>x86_64-redhat-linux-g++ (GCC) 4.8.5 20150623 (Red Hat 4.8.5-36)<br></div><div><br></div><div>I have a very simple CMakeLists.txt:</div><div><br></div><div>cmake_minimum_required(VERSION 3.5 FATAL_ERROR)<br>project(hello_world LANGUAGES CXX)<br><br>add_executable(hello_world "")<br><br>target_sources(hello_world<br>  PRIVATE<br>    main.cpp<br>    Message.hpp<br>    Message.cpp)<br></div><div><br></div><div>I also have Redhat Developer Toolset 7 installed which I can enable in my bash shell:</div><div><br></div>$ scl enable devtoolset-7 bash<br>$ which g++<br>/opt/rh/devtoolset-7/root/usr/bin/g++<br>$ g++ --version<br>g++ (GCC) 7.3.1 20180303 (Red Hat 7.3.1-5)<div><br></div><div>How can I get CMake to use the later version of g++ instead of 4.8.5?</div><div><br></div></div>
-- <br>
<br>
Powered by <a href="http://www.kitware.com" rel="noreferrer noreferrer" target="_blank">www.kitware.com</a><br>
<br>
Please keep messages on-topic and check the CMake FAQ at: <a href="http://www.cmake.org/Wiki/CMake_FAQ" rel="noreferrer noreferrer" target="_blank">http://www.cmake.org/Wiki/CMake_FAQ</a><br>
<br>
Kitware offers various services to support the CMake community. For more information on each offering, please visit:<br>
<br>
CMake Support: <a href="http://cmake.org/cmake/help/support.html" rel="noreferrer noreferrer" target="_blank">http://cmake.org/cmake/help/support.html</a><br>
CMake Consulting: <a href="http://cmake.org/cmake/help/consulting.html" rel="noreferrer noreferrer" target="_blank">http://cmake.org/cmake/help/consulting.html</a><br>
CMake Training Courses: <a href="http://cmake.org/cmake/help/training.html" rel="noreferrer noreferrer" target="_blank">http://cmake.org/cmake/help/training.html</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" rel="noreferrer noreferrer" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="https://cmake.org/mailman/listinfo/cmake" rel="noreferrer noreferrer" target="_blank">https://cmake.org/mailman/listinfo/cmake</a><br>
</blockquote></div>