Skip to content

Commit

Permalink
Update 2024-01-31-CMake.md
Browse files Browse the repository at this point in the history
  • Loading branch information
koyumi0601 committed Feb 18, 2024
1 parent cfb387d commit ff3c22f
Showing 1 changed file with 46 additions and 0 deletions.
46 changes: 46 additions & 0 deletions _posts/Installation/2024-01-31-CMake.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,54 @@ search: true
---
*CMake*


# ubuntu

```bash
sudo apt update
sudo apt install cmake
cmake --version
```

# window

- download GUI

## example, dcmtk

### dcmtk 준비
- dcmtk downloader [https://dicom.offis.de/en/dcmtk/dcmtk-software-development/](https://dicom.offis.de/en/dcmtk/dcmtk-software-development/)
- DCMTK 3.6.8 Source Code and Documentation -> 다운로드 후 압축 풀고 이동 -> D:/Github_Blog/dcmtk-3.6.8
- Pre-compiled libraries for Visual Studio 2022 (MSVC 17.4), 64 bit, with "MT" option -> 다운로드 후 압축 풀고 이동 -> D:\Github_Blog\dcmtk-3.6.8-win64-support-MT-msvc-17.4
- prerequisit download (optional): bison [https://www.gnu.org/software/bison/](https://www.gnu.org/software/bison/)


### cmake 실행
- cmake.exe 실행
- where is the source code: D:/Github_Blog/dcmtk-3.6.8 빌드할 소스코드의 위치
- where to build the binaries: D:/Github_Blog/build 빌드 타겟 폴더, 새로 생성해서 만들기
- configure: 빌드 바이너리 생성 버튼 클릭
- configuration 실패하면서 창이 빨간색으로 바뀔 것임
- D:\Github_Blog\dcmtk-3.6.8-win64-support-MT-msvc-17.4
- 다음 라이브러리의 사용을 체크한 후
- DCMTK_WITH_ZLIB, DCMTK_WITH_XML, DCMTK_WITH_TIFF, DCMTK_WITH_THREADS, DCMTK_WITH_PNG, DCMTK_WITH_OPENSSL
- cmake에 라이브러리와 헤더파일 경로(다운받은 것)를 알려줌
- D:/Github_Blog/dcmtk-3.6.8-win64-support-MT-msvc-17.4/libpng-1.6.40
- D:/Github_Blog/dcmtk-3.6.8-win64-support-MT-msvc-17.4/libtiff-4.6.0
- D:/Github_Blog/dcmtk-3.6.8-win64-support-MT-msvc-17.4/libxml2-2.11.5
- D:/Github_Blog/dcmtk-3.6.8-win64-support-MT-msvc-17.4/openjpeg-2.5.0
- D:/Github_Blog/dcmtk-3.6.8-win64-support-MT-msvc-17.4/openssl-1.1.1w
- D:/Github_Blog/dcmtk-3.6.8-win64-support-MT-msvc-17.4/zlib-1.3
- 다시 configure 버튼 클릭
- 성공하면 창이 초록색
- Generate 버튼 클릭
- 빌드 타겟 폴더에 솔루션(인스톨러) 생성


### visual studio
- visual studio > open solution > cmake에서 생성한 인스톨러의 솔루션을 연다
- build > batch build > install > release build 혹은 debug build 체크 > build 버튼 클릭 > 빌드 시작
- 하기 빌드 결과물 사용
- D:\Github_Blog\build\lib (library)
- D:\Github_Blog\build\include (header)
- D:\Github_Blog\build\bin (dll)

0 comments on commit ff3c22f

Please sign in to comment.