我嘗試用cmake的改變編譯:與cmake的更改編譯器創建無限循環
SET(CMAKE_C_COMPILER "/opt/rh/devtoolset-2/root/usr/bin/gcc")
SET(CMAKE_CXX_COMPILER "/opt/rh/devtoolset-2/root/usr/bin/g++")
我這樣做,在我的項目的開頭只是打電話的「項目」命令。 但我得到一個無限循環當我打電話cmake的,我有以下的輸出:
-- The C compiler identification is GNU 4.8.2
-- The CXX compiler identification is GNU 4.8.2
-- Check for working C compiler: /opt/rh/devtoolset-2/root/usr/bin/gcc
-- Check for working C compiler: /opt/rh/devtoolset-2/root/usr/bin/gcc -- 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: /opt/rh/devtoolset-2/root/usr/bin/g++
-- Check for working CXX compiler: /opt/rh/devtoolset-2/root/usr/bin/g++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found Doxygen: /usr/bin/doxygen (found version "1.6.1")
-- Looking for C++ include tut.h
-- Looking for C++ include tut.h - found
-- [STATUS] Found tut.h
-- Configuring done
You have changed variables that require your cache to be deleted.
Configure will be re-run and you may have to reset some variables.
The following variables have changed:
CMAKE_CXX_COMPILER= /usr/bin/c++
CMAKE_CXX_COMPILER= /usr/bin/c++
所以我在一個無限循環一次又一次有這種消息,即使我調用cmake的前刪除緩存...
編輯:解決方法很簡單:您需要使用cmake 2.8.9版本,並且問題不會出現。
你嘗試完全乾淨的配置(調用'cmake'空編譯目錄)?我不確定,但編譯器相關的變量不僅可以存儲在緩存中,所以緩存空虛不會保證整潔的配置。 – Tsyvarev
是的,我做過。我找到了解決方案並將編輯第一篇文章。謝謝 –