[C++] CMake 총정리 (2) - CMakeLists.txt 명령어 변수 패턴 include directories compile options glob file Release


[C++] CMake 총정리 (2) - CMakeLists.txt 명령어 변수 패턴 include directories compile options glob file Release

이전 시간에 우리는 CMake 파일에 대한 개략적인 소개와 간단한 프로젝트를 만들어서 빌드를 해보는 것까지 해 봤습니다. https://blog.naver.com/dorergiverny/223747933345 [C++] cmake 총정리 (1) - CMakeLists.txt 의 기초 cmake 설치 빌드 cmake_minimum_required project add_executable 지난 시간에 우리는 우분투 리눅스 환경에서 Makefile을 이용한 C++ 소스 파일을 컴파일하고 실행파일을 ... blog.naver.com 이번에는 CMakeLists.txt를 직접 구현해 보겠습니다. 파일 구조는 아래와 같습니다.

CMakeLists.txt 파일은 아래와 같습니다. 빌드를 해 보겠습니다.

이번에는 build 폴더 내에 Release 폴더를 생성하고 이 폴더 내에 실행파일이 있네요. 실행을 해 보면 실행이 잘 되는 것을 보실 수 있습니다.

위 예시를 기준으로, 자주 사용되는 명령어와...



원문링크 : [C++] CMake 총정리 (2) - CMakeLists.txt 명령어 변수 패턴 include directories compile options glob file Release