2017-04-19 8 views
2

Mac 용 CLion을 설치했습니다. 그러나 "Hello, world"프로젝트를 만들 때 몇 가지 문제점이 있습니다. CMake가 시스템 정보 나 무엇을 설정하지 못한 것 같습니다.CLion 2017.1 Mac에서 컴파일이 잘못되었습니다. OS10.12

> /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". 

가 맥에 나는 처음으로 실행 CLion 프로젝트, 그것은 완벽하게 실행 : 나는 다음과 같은 오류를 가지고

다음
cmake_minimum_required(VERSION 3.7) 
PROJECT(untitled) 

set(CMAKE_CXX_STANDARD 11) 

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

:

내 CMakeList.txt는 CLion에 기본적으로 생성됩니다 . 그러나 Xcode에서 cocos2d를 컴파일 한 후에 이러한 문제가 발생합니다. 내 맥에있는 모든 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을 다시 시작하면 모든 것이 잘 진행됩니다. 끝난.