2017-04-19 1 views
2

Mac用のCLionがインストールされました。しかし、私が "こんにちは、世界"のプロジェクトを作るとき、私はいくつかの問題を抱えています。 CMakeがシステム情報や何を設定するのに失敗したようです。CLion 2017.1 MacでのCMakeのコンパイルエラーOS10.12

これはCLionデフォルトで生成された私のCMakeList.txtです:

cmake_minimum_required(VERSION 3.7) 
PROJECT(untitled) 

set(CMAKE_CXX_STANDARD 11) 

set(SOURCE_FILES main.cpp) 
add_executable(untitled ${SOURCE_FILES}) 

その後、私は以下のようにエラーを得た:私のMac上で初めて実行CLionプロジェクト、それが完全に実行されると

> /Applications/CMake.app/Contents/bin/cmake -DCMAKE_BUILD_TYPE=Debug -G "CodeBlocks - Unix Makefiles" /Users/changeset/CLionProjects/untitled 
> -- The C compiler identification is AppleClang 8.1.0.8020038 
> -- The CXX compiler identification is AppleClang 8.1.0.8020038 CMake Error at 
> /Applications/CMake.app/Contents/share/cmake-3.7/Modules/CMakeSystemSpecificInformation.cmake:26 
> (include): include called with wrong number of arguments. include() 
> only takes one file. Call Stack (most recent call first): 
> CMakeLists.txt:2 (PROJECT) 
> 
> 
> System is unknown to cmake, create: Platform/sysname:Darwin 
> nodename:Fez.local release:16.5.0 version:Darwin Kernel Version 
> 16.5.0: Fri Mar 3 16:52:33 PST 2017; root:xnu-3789.51.2~3/RELEASE_X86_64 machine:x86_64 to use this 
> system, please send your config file to [email protected] so it can 
> be added to cmake Your CMakeCache.txt file was copied to 
> CopyOfCMakeCache.txt. Please send that file to [email protected] 
> CMake Error at 
> /Applications/CMake.app/Contents/share/cmake-3.7/Modules/CMakeCInformation.cmake:38 
> (include): include called with wrong number of arguments. include() 
> only takes one file. Call Stack (most recent call first): 
> CMakeLists.txt:2 (PROJECT) 
> 
> 
> CMake Error at 
> /Applications/CMake.app/Contents/share/cmake-3.7/Modules/CMakeCInformation.cmake:41 
> (include): include called with invalid argument: 
> root:xnu-3789.51.2~3_RELEASE_X86_64 
> 
> machine:x86_64 Call Stack (most recent call first): 
> CMakeLists.txt:2 (PROJECT) 
> 
> 
> CMake Error at 
> /Applications/CMake.app/Contents/share/cmake-3.7/Modules/CMakeCInformation.cmake:48 
> (include): include called with wrong number of arguments. include() 
> only takes one file. Call Stack (most recent call first): 
> CMakeLists.txt:2 (PROJECT) 
> 
> 
> CMake Error at 
> /Applications/CMake.app/Contents/share/cmake-3.7/Modules/CMakeCInformation.cmake:52 
> (include): include called with wrong number of arguments. include() 
> only takes one file. Call Stack (most recent call first): 
> CMakeLists.txt:2 (PROJECT) 
> 
> 
> -- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc 
> CMake Error at 
> /Applications/CMake.app/Contents/share/cmake-3.7/Modules/CMakeSystemSpecificInformation.cmake:26 
> (include): include called with wrong number of arguments. include() 
> only takes one file. Call Stack (most recent call first): 
> /Users/changeset/CLionProjects/untitled/cmake-build-debug/CMakeFiles/CMakeTmp/CMakeLists.txt:2 
> (project) 
> 
> 
> System is unknown to cmake, create: Platform/sysname:Darwin 
> nodename:Fez.local release:16.5.0 version:Darwin Kernel Version 
> 16.5.0: Fri Mar 3 16:52:33 PST 2017; root:xnu-3789.51.2~3/RELEASE_X86_64 machine:x86_64 to use this 
> system, please send your config file to [email protected] so it can 
> be added to cmake CMake Error at 
> /Applications/CMake.app/Contents/share/cmake-3.7/Modules/CMakeCInformation.cmake:38 
> (include): include called with wrong number of arguments. include() 
> only takes one file. Call Stack (most recent call first): 
> /Users/changeset/CLionProjects/untitled/cmake-build-debug/CMakeFiles/CMakeTmp/CMakeLists.txt:2 
> (project) 
> 
> 
> CMake Error at 
> /Applications/CMake.app/Contents/share/cmake-3.7/Modules/CMakeCInformation.cmake:41 
> (include): include called with invalid argument: 
> root:xnu-3789.51.2~3_RELEASE_X86_64 
> 
> machine:x86_64 Call Stack (most recent call first): 
> /Users/changeset/CLionProjects/untitled/cmake-build-debug/CMakeFiles/CMakeTmp/CMakeLists.txt:2 
> (project) 
> 
> 
> CMake Error at 
> /Applications/CMake.app/Contents/share/cmake-3.7/Modules/CMakeCInformation.cmake:48 
> (include): include called with wrong number of arguments. include() 
> only takes one file. Call Stack (most recent call first): 
> /Users/changeset/CLionProjects/untitled/cmake-build-debug/CMakeFiles/CMakeTmp/CMakeLists.txt:2 
> (project) 
> 
> 
> CMake Error at 
> /Applications/CMake.app/Contents/share/cmake-3.7/Modules/CMakeCInformation.cmake:52 
> (include): include called with wrong number of arguments. include() 
> only takes one file. Call Stack (most recent call first): 
> /Users/changeset/CLionProjects/untitled/cmake-build-debug/CMakeFiles/CMakeTmp/CMakeLists.txt:2 
> (project) 
> 
> 
> CMake Error: Internal CMake error, TryCompile configure of cmake 
> failed 
> -- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc 
> -- broken CMake Error at /Applications/CMake.app/Contents/share/cmake-3.7/Modules/CMakeTestCCompiler.cmake:51 
> (message): The C compiler 
> "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc" 
> is not able to compile a simple test program. 
> 
> It fails with the following output: 
> 
>  
> 
> 
> 
> CMake will not be able to correctly generate this project. Call 
> Stack (most recent call first): CMakeLists.txt:2 (PROJECT) 
> 
> 
> -- Configuring incomplete, errors occurred! See also "/Users/changeset/CLionProjects/untitled/cmake-build-debug/CMakeFiles/CMakeOutput.log". 
> See also 
> "/Users/changeset/CLionProjects/untitled/cmake-build-debug/CMakeFiles/CMakeError.log". 

。しかし、私がXcodeでcocos2dをコンパイルした後、これらの問題が発生します。私は私のMac上のすべてのcocos2dファイルを削除しましたが、cmakeはまだ間違っています。

答えて

1

最後に、私はここで私の問題を解決しました。それは珍しいようです。

CMakeについて記載されているエラーは、間違って unameを呼び出したことが原因です。

私はCMake manualをチェックアウトしましたが、私のMacが間違ったCMAKE_HOST_SYSTEM_NAMEの結果を生成しました。私の端末上でテストunameを実行した後、カーネルが間違ったコマンドを使用した可能性があります。そして、私はecho $PATHが私の$PATHがcocos2d-xによって変更されたことを発見しました。新しい$PATHには私の研究用にプログラムされたunameが含まれており、カーネルunameを上書きしました。 my unameを削除した後、CMakeをクリーンアップし、CLionを再起動してください。すべて正常です。完了しました。

関連する問題