
개요이 장에서 알 수 있는 것 라이브러리에 대한 사용 요구 사항 추가 필요한 C++ 표준을 지정하기 위해 INTERFACE 라이브러리 타겟을 추가 사용한 CMake 커맨드target_compile_definitions()target_compile_options()target_include_directories()target_link_directories()target_link_options()target_precompile_headers()target_sources()타깃 포함 디렉토리 속성에 대한 이해 해당 챕터를 공부하면서 이해하느라 가장 오랜시간을 소비한 부분 같다. target_include_directories() 커맨드 앞 절에도 사용했었지만 3가지 속성을 선택할 수 있다.PRIVATE 지정된..

개요이 장에서 알 수 있는 것CMake에서 라이브러리 추가 하는 방법사용한 CMake 커맨드 add_library()add_subdirectory()target_include_directories()target_link_libraries()PROJECT_SOURCE_DIR연습 1. 라이브러리 생성 연습 1.1. 라이브러리 디렉토리 CMakeLists.txt 편집 'Step2' 디렉토리의 'MathFunctions' 디렉토리에 들어가면 위 이미지와 같이 소스코드와 CMakeLists.txt 파일이 있다. 우리는 해당 디렉토리에 있는 소스 코드들을 라이브러리 형태로 만들 것이다. 일반적인 정적 라이브러리를 빌드하는 원리를 생각해보면 헤더파일은 원형 그대로 유지대고 나머지 구현부(.cpp)는 .lib 형태..

이 장에서 알 수 있는 것 CMake의 기본 구문CMake의 명령 및 변수에 대한 소개연습 1: Building a Basic Project (기초 프로젝트 빌드하기) 가장 기본적인 CMake 프로젝트는 단일 소스 코드 파일로 작성된 실행 파일이다. 이러한 간단한 프로젝트의 경우 세 가지 명령이 포함된 CMakeLists.txt 파일만 있으면 충분하다. 1. cmake_minimum_required() 어떤 프로젝트든 최상위 CMakeLists.txt 파일은 최소 CMake 버전을 지정하는 cmake_minimum_required() 명령으로 시작해야 한다. 이는 정책 설정을 확립하고 이후 CMake 기능이 호환 가능한 CMake 버전에서 실행되도록 보장한다. 2. project()프로젝트를 시작..

CMake 공부할 때 참고한 사이트https://cmake.org/cmake/help/latest/guide/tutorial/index.html# CMake Tutorial — CMake 3.31.3 DocumentationIntroduction The CMake tutorial provides a step-by-step guide that covers common build system issues that CMake helps address. Seeing how various topics all work together in an example project can be very helpful.cmake.org 예제 파일 다운로드 CMake 튜토리얼 예제 소스파일은 메인 페이지의 'Steps' 중제목..

CMake 설치 아래의 링크에 들어가서 OS에 맞는 CMake 설치한다.https://cmake.org/download/ Download CMakeYou can either download binaries or source code archives for the latest stable or previous release or access the current development (aka nightly) distribution through Git. This software may not be exported in violation of any U.S. export laws or regulatiocmake.org 필자는 윈도우 OS를 사용하므로 플랫폼이 Windows x64 Installer 인 설치 ..