1. Cmake 다운로드
- 아래 홈페이지 또는 wget 링크 주소로 최신 버전의 CMake 파일 다운로드
- 현재 최신 Release 버전은 v3.22.3이나 추후 더 높은 버전이 나올 수 있기에 최신 확인 버전 확인 필요
1.1 Cmake 공식 홈페이지
1.2 wget 사용
$wget https://github.com/Kitware/CMake/releases/download/v3.22.3/cmake-3.22.3.tar.gz
--2022-03-07 10:00:48-- https://github.com/Kitware/CMake/releases/download/v3.22.3/cmake-3.22.3.tar.gz
Resolving github.com (github.com)... 52.78.231.108
Connecting to github.com (github.com)|52.78.231.108|:443... connected.
HTTP request sent, awaiting response... 302 Found
--2022-03-07 10:00:49-- https://objects.githubusercontent.com/github-production-release-asset-2e65be/537699/d4132bc0-6bc5-4236-8af1-87d576bc17cd?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIWNJYAX4CSVEH53A%2F20220307%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20220307T010048Z&X-Amz-Expires=300&X-Amz-Signature=671748ba08958796dc5241829a0fe1779cd751b9a1ba93243baa731b76dc210e&X-Amz-SignedHeaders=host&actor_id=0&key_id=0&repo_id=537699&response-content-disposition=attachment%3B%20filename%3Dcmake-3.22.3.tar.gz&response-content-type=application%2Foctet-stream
Resolving objects.githubusercontent.com (objects.githubusercontent.com)... 185.199.111.133, 185.199.110.133, 185.199.109.133, ...
Connecting to objects.githubusercontent.com (objects.githubusercontent.com)|185.199.111.133|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 9779118 (9.3M) [application/octet-stream]
Saving to: ‘cmake-3.22.3.tar.gz.1’
cmake-3.22.3.tar.gz.1 100%[==================================>] 9.33M 21.1MB/s in 0.4s
2022-03-07 10:00:50 (21.1 MB/s) - ‘cmake-3.22.3.tar.gz.1’ saved [9779118/9779118]
2. Cmake 설치
# 압축 해제
$ tar -xvzf cmake-3.22.3.tar.gz
# 디렉토리 이동
$ cd cmake-3.22.3/
# 설치
$ ./bootstrap
$ make
$ sudo make install
3. 버전 확인
$ cmake --version
CMake Error: Could not find CMAKE_ROOT !!!
CMake has most likely not been installed correctly.
Modules directory not found in
/usr/local/share/cmake-3.5
cmake version 3.5.1
CMake suite maintained and supported by Kitware (kitware.com/cmake).
주의사항
※ 설치 후 위와 같은 에러가 발생하면 터미널을 종료 하였다 재 실행 하거나 재부팅 후 실행
$cmake --version
cmake version 3.22.2
CMake suite maintained and supported by Kitware (kitware.com/cmake).
위와 같이 cmake version 3.22.2가 출력되면 설치가 정상적으로 완료 되었다는 뜻 임.
4. CMake 예제
'Linux > CMake' 카테고리의 다른 글
간단한 CMake 예제 (0) | 2024.01.10 |
---|
댓글