Windows에서 CMake 실행
현재 Windows 7 (64 비트) 시스템에서 CMake를 실행하려고합니다. 작업중인 Qt 응용 프로그램에서 나중에 사용할 수 있도록 TagLib 를 컴파일하고 싶습니다 . MinGW ( 이 다른 질문 에서와 같이 Visual C ++가 아님)로 컴파일하고 싶습니다 .
설치 프로그램 (cmake-2.8.3-win32-x86.exe)을 다운로드하고 설치합니다 (또한 내 경로에 CMake를 추가하도록 선택). 그런 다음 CMakeLists.txt 파일이 왜 있는지 디렉토리로 이동하여 cmake .
. 그런 다음이 큰 오류가 발생합니다.
C:\Users\Joel\Downloads\taglib-1.6.3>cmake .
CMake Warning at CMakeLists.txt:1 (project):
To use the NMake generator, cmake must be run from a shell that can use the
compiler cl from the command line. This environment does not contain
INCLUDE, LIB, or LIBPATH, and these must be set for the cl compiler to
work.
-- The C compiler identification is unknown
-- The CXX compiler identification is unknown
CMake Warning at C:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Modules/Platform/Windows-cl.cmake:
28 (ENABLE_LANGUAGE):
To use the NMake generator, cmake must be run from a shell that can use the
compiler cl from the command line. This environment does not contain
INCLUDE, LIB, or LIBPATH, and these must be set for the cl compiler to
work.
Call Stack (most recent call first):
C:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Modules/CMakeCInformation.cmake:60 (INCLUDE)
CMakeLists.txt:1 (project)
CMake Error: your RC compiler: "CMAKE_RC_COMPILER-NOTFOUND" was not found. Please set CMAKE_RC_COM
PILER to a valid compiler path or name.
-- Check for CL compiler version
-- Check for CL compiler version - failed
-- Check if this is a free VC compiler
-- Check if this is a free VC compiler - yes
-- Using FREE VC TOOLS, NO DEBUG available
-- Check for working C compiler: cl
CMake Warning at CMakeLists.txt:2 (PROJECT):
To use the NMake generator, cmake must be run from a shell that can use the
compiler cl from the command line. This environment does not contain
INCLUDE, LIB, or LIBPATH, and these must be set for the cl compiler to
work.
CMake Warning at C:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Modules/Platform/Windows-cl.cmake:
28 (ENABLE_LANGUAGE):
To use the NMake generator, cmake must be run from a shell that can use the
compiler cl from the command line. This environment does not contain
INCLUDE, LIB, or LIBPATH, and these must be set for the cl compiler to
work.
Call Stack (most recent call first):
C:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Modules/CMakeCInformation.cmake:60 (INCLUDE)
CMakeLists.txt:2 (PROJECT)
CMake Error at C:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Modules/CMakeRCInformation.cmake:22
(GET_FILENAME_COMPONENT):
get_filename_component called with incorrect number of arguments
Call Stack (most recent call first):
C:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Modules/Platform/Windows-cl.cmake:28 (ENABLE_LANG
UAGE)
C:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Modules/CMakeCInformation.cmake:60 (INCLUDE)
CMakeLists.txt:2 (PROJECT)
CMake Error: CMAKE_RC_COMPILER not set, after EnableLanguage
CMake Error: your C compiler: "cl" was not found. Please set CMAKE_C_COMPILER to a valid compiler
path or name.
CMake Error: Internal CMake error, TryCompile configure of cmake failed
-- Check for working C compiler: cl -- broken
CMake Error at C:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Modules/CMakeTestCCompiler.cmake:52
(MESSAGE):
The C compiler "cl" 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:1 (project)
CMake Error: your C compiler: "cl" was not found. Please set CMAKE_C_COMPILER to a valid compiler
path or name.
CMake Error: your CXX compiler: "cl" was not found. Please set CMAKE_CXX_COMPILER to a valid compi
ler path or name.
-- Configuring incomplete, errors occurred!
C:\Users\Joel\Downloads\taglib-1.6.3>
나는 그것이 크로스 플랫폼 메이크로 광고한다는 점을 고려할 때 상자에서 너무 힘들게 실패했다는 사실에 다소 놀랐습니다.
I tried setting INCLUDE, LIB, and LIBPATH (Windows environment variables) all to my MinGW binaries directory (C:\MinGW\bin) but it's still giving me the same error. I also tried setting CMAKE_C_COMPILER and CMAKE_CXX_COMPILER to the location of g++ (C:\MinGW\bin\g++).
Does anyone know what's going on here?
SOLUTION:
Per tibur's suggestion, I ran the cmake GUI to create the make files. I then went into the directory taglib directory and ran mingw32-make.exe
to do the actual build.
The default generator for Windows seems to be set to NMAKE. Try to use:
cmake -G "MinGW Makefiles"
Or use the GUI, and select MinGW Makefiles when prompted for a generator. Don't forget to cleanup the directory where you tried to run CMake, or delete the cache in the GUI. Otherwise, it will try again with NMAKE.
There is a vcvars32.bat in your Visual Studio installation directory. You can add call cmd.exe at the end of that batch program and launch it. From that shell you can use CMake or cmake-gui and cl.exe would be known to CMake.
참고URL : https://stackoverflow.com/questions/4101456/running-cmake-on-windows
'programing tip' 카테고리의 다른 글
wpf 창에 사용자 정의 컨트롤 추가 (0) | 2020.11.28 |
---|---|
경고-부호있는 정수 식과 부호없는 정수 식 비교 (0) | 2020.11.28 |
MySQL IN 조건 제한 (0) | 2020.11.28 |
C에서 대소 문자를 구분하지 않는 문자열 comp (0) | 2020.11.28 |
float를 사용하지 않고 div를 왼쪽 / 오른쪽으로 정렬하는 방법은 무엇입니까? (0) | 2020.11.27 |