简体   繁体   中英

In CLion: CMake was unable to find a build program corresponding to "Unix Makefiles"

I'm working in CLion with the full remote mode. I got an error when loading the cmake project:

/mnt/home/idmg/lhz/tool/cmake-3.17.5-Linux-x86_64/bin/cmake -DCMAKE_BUILD_TYPE=Debug -G "CodeBlocks - Unix Makefiles" /mnt/home/idmg/lhz/CLionProjects/IOE-SORW
CMake Error: CMake was unable to find a build program corresponding to "Unix Makefiles".  CMAKE_MAKE_PROGRAM is not set.  You probably need to select a different build tool.
CMake Error: CMAKE_C_COMPILER not set, after EnableLanguage
CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage
-- Configuring incomplete, errors occurred!
See also "/mnt/home/idmg/lhz/CLionProjects/IOE-SORW/cmake-build-debug-idmg/CMakeFiles/CMakeOutput.log".

[Failed to reload]

However, when I execute the command directly in the terminal, everything works fine:

$ /mnt/home/idmg/lhz/tool/cmake-3.17.5-Linux-x86_64/bin/cmake -DCMAKE_BUILD_TYPE=Debug -G "CodeBlocks - Unix Makefiles" /mnt/home/idmg/lhz/CLionProjects/IOE-SORW
-- The C compiler identification is GNU 7.4.0
-- The CXX compiler identification is GNU 7.4.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc - works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ - works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Configuring done
-- Generating done
-- Build files have been written to: /mnt/home/idmg/lhz/CLionProjects/IOE-SORW/cmake-build-debug-idmg

I'm confused about this, and thus this CMake profile is not shown in CLion. How can I fix this?

Have the same issue. As a workaround can suggest to generate cmake cache manually in terminal and then CLion can work with existed cache with CMAKE_MAKE_PROGRAM setted.

CLion 2021.1.1 full remote mode. remote: ubuntu18.04 docker container

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM