2012-07-21 10 views
12

私はbuild_ios.shを実行してAssimpを構築しようとすると、それは私に語った:iOSのAssimpを構築するためにCMAKE_C_COMPILERとCMAKE_CXX_COMPILERをどのように設定しますか?

CMake Error: your C compiler: "/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/llvm-gcc" was not found. Please set CMAKE_C_COMPILER to a valid compiler path or name. 
CMake Error: your CXX compiler: "/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/llvm-g++" was not found. Please set CMAKE_CXX_COMPILER to a valid compiler path or name. 

私はパスをする必要があり、何がある:

/Applications/XCode.app/Contents/Developer/Platforms/... 

私はbuild_ios.shDEVROOTIPHONE_xxxx_TOOLCHAIN.cmakeを変更しようとしました、それはCMAKE_C_COMPILERなどが生成されているようだからですが、それでも私には同じエラーが表示されます。

+1

ソリューションを見つけましたか? – MatterGoal

答えて

31

オプション1:

あなたは、このようなコマンドラインでCMakeの変数を設定することができます。

cmake -D CMAKE_C_COMPILER="/path/to/your/c/compiler/executable" -D CMAKE_CXX_COMPILER "/path/to/your/cpp/compiler/executable" /path/to/directory/containing/CMakeLists.txt 

CMakeのキャッシュエントリを作成する方法を学ぶためにthisを参照してください。


オプション2:

あなたのシェルスクリプトでbuild_ios.shあなたは、それぞれあなたのCおよびC++コンパイラの実行可能ファイルを指すように環境変数CCCXXを設定することができ、例:

export CC=/path/to/your/c/compiler/executable 
export CXX=/path/to/your/cpp/compiler/executable 
cmake /path/to/directory/containing/CMakeLists.txt 

オプション3:

編集「Assimp」のCMakeLists.txtファイル:先頭にこれらの行を追加します(あなたがproject()enable_language()コマンドを使用する前に追加する必要があります)

set(CMAKE_C_COMPILER "/path/to/your/c/compiler/executable") 
set(CMAKE_CXX_COMPILER "/path/to/your/cpp/compiler/executable") 

setコマンドを使用する方法を学ぶためにthisを参照してください。 CMake。また、thisは、一般的なCMake変数のいくつかの使用を理解するのに役立つリソースです。ここで


公式よくある質問から関連エントリです:http://www.cmake.org/Wiki/CMake_FAQ#How_do_I_use_a_different_compiler.3F

6

CCとCXXが/Applications/Xcode.appの内側に位置しています。これは正しい経路を見つけるはずです

export CXX=`xcrun -find c++` 
export CC=`xcrun -find cc` 
関連する問題