Updating CMake breaks ignores set(CMAKE_CXX_COMPILER ...) in CMakeLists.txt [closed]
I'm running Ubuntu 18.04 with ROS Melodic, and recently updated my CMake to version 3.20.5. However, after doing this I noticed that using set(CMAKE_CXX_COMPILER "path/to/compiler")
command in CMakeLists.txt
to change compilers to, say, clang++
or nvc++
doesn't work, and I instead have to change compilers in the command line by using the -DCMAKE_CXX_COMPILER
command. For example,
catkin_make -DCMAKE_CXX_COMPILER=/usr/bin/clang++
Has anyone else noticed this change, and if so, is this intended or is there still a way to use set()
in CMakeLists.txt
? Any help would be appreciated.
I can see why you've posted this here -- as you're using CMake while building software for ROS Melodic -- but this is not a ROS question. CMake is a stand-alone tool, which we just happen to use for building ROS packages.
It's well possible that Kitware has decided to change how compilers should be specified when running CMake, but that's not something we are kept up-to-date about or have any influence on.
Please post your question in a more suitable location.
If/when you do, please post a comment here with a link to your new post, so we can keep things connected.