DrawingProcess
๋“œํ”„ DrawingProcess
DrawingProcess
์ „์ฒด ๋ฐฉ๋ฌธ์ž
์˜ค๋Š˜
์–ด์ œ
ยซ   2025/07   ยป
์ผ ์›” ํ™” ์ˆ˜ ๋ชฉ ๊ธˆ ํ† 
1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30 31
  • ๋ถ„๋ฅ˜ ์ „์ฒด๋ณด๊ธฐ (971)
    • Profile & Branding (25)
      • Career (18)
    • IT Trends (254)
      • Conference, Faire (Experien.. (31)
      • News (187)
      • Youtube (19)
      • TED (8)
      • Web Page (2)
      • IT: Etc... (6)
    • Contents (98)
      • Book (67)
      • Lecture (31)
    • Project Process (95)
      • Ideation (0)
      • Study Report (35)
      • Challenge & Award (22)
      • 1Day1Process (5)
      • Making (5)
      • KRC-FTC (Team TC(5031, 5048.. (10)
      • GCP (GlobalCitizenProject) (15)
    • Study: ComputerScience(CS) (72)
      • CS: Basic (9)
      • CS: Database(SQL) (5)
      • CS: Network (14)
      • CS: OperatingSystem (3)
      • CS: Linux (39)
      • CS: Etc... (2)
    • Study: Software(SW) (95)
      • SW: Language (29)
      • SW: Algorithms (1)
      • SW: DataStructure & DesignP.. (1)
      • SW: Opensource (15)
      • SW: Error Bug Fix (43)
      • SW: Etc... (6)
    • Study: Artificial Intellige.. (150)
      • AI: Research (1)
      • AI: 2D Vision(Det, Seg, Tra.. (35)
      • AI: 3D Vision (71)
      • AI: MultiModal (3)
      • AI: SLAM (0)
      • AI: Light Weight(LW) (3)
      • AI: Data Pipeline (7)
      • AI: Machine Learning(ML) (1)
    • Study: Robotics(Robot) (33)
      • Robot: ROS(Robot Operating .. (9)
      • Robot: Positioning (8)
      • Robot: Planning & Control (7)
    • Study: DeveloperTools(DevTo.. (83)
      • DevTool: Git (12)
      • DevTool: CMake (13)
      • DevTool: NoSQL(Elastic, Mon.. (25)
      • DevTool: Container (17)
      • DevTool: IDE (11)
      • DevTool: CloudComputing (4)
    • ์ธ์ƒ์„ ์‚ด๋ฉด์„œ (65)
      • ๋‚˜์˜ ์ทจ๋ฏธ๋“ค (7)
      • ๋‚˜์˜ ์ƒ๊ฐ๋“ค (42)
      • ์—ฌํ–‰์„ ๋– ๋‚˜์ž~ (10)
      • ๋ถ„๊ธฐ๋ณ„ ํšŒ๊ณ  (6)

๊ฐœ๋ฐœ์ž ๋ช…์–ธ

โ€œ ๋งค์ฃผ ๋ชฉ์š”์ผ๋งˆ๋‹ค ๋‹น์‹ ์ด ํ•ญ์ƒ ํ•˜๋˜๋Œ€๋กœ ์‹ ๋ฐœ๋ˆ์„ ๋ฌถ์œผ๋ฉด ์‹ ๋ฐœ์ด ํญ๋ฐœํ•œ๋‹ค๊ณ  ์ƒ๊ฐํ•ด๋ณด๋ผ.
์ปดํ“จํ„ฐ๋ฅผ ์‚ฌ์šฉํ•  ๋•Œ๋Š” ์ด๋Ÿฐ ์ผ์ด ํ•ญ์ƒ ์ผ์–ด๋‚˜๋Š”๋ฐ๋„ ์•„๋ฌด๋„ ๋ถˆํ‰ํ•  ์ƒ๊ฐ์„ ์•ˆ ํ•œ๋‹ค. โ€

- Jef Raskin

๋งฅ์˜ ์•„๋ฒ„์ง€ - ์• ํ”Œ์ปดํ“จํ„ฐ์˜ ๋งคํ‚จํ† ์‹œ ํ”„๋กœ์ ํŠธ๋ฅผ ์ฃผ๋„

์ธ๊ธฐ ๊ธ€

์ตœ๊ทผ ๊ธ€

์ตœ๊ทผ ๋Œ“๊ธ€

ํ‹ฐ์Šคํ† ๋ฆฌ

hELLO ยท Designed By ์ •์ƒ์šฐ.
DrawingProcess

๋“œํ”„ DrawingProcess

Study: DeveloperTools(DevTool)/DevTool: CMake

[CMake] FetchContent: ์™ธ๋ถ€ ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ๋ฅผ ์‚ฌ์šฉํ•˜์ž~

2022. 6. 24. 16:08
๋ฐ˜์‘ํ˜•
๐Ÿ’ก ๋ณธ ๋ฌธ์„œ๋Š” CMake๋กœ ํ™˜๊ฒฝ์„ buildํ•˜๋Š” ์ค‘ ์™ธ๋ถ€์˜ ํ•„์š”ํ•œ ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ๋ฅผ ๊ฐ€์ ธ์˜ค๋Š” FetchContent๊ณผ์ •์— ๋Œ€ํ•ด ์ž์„ธํžˆ ์„ค๋ช…ํ•ฉ๋‹ˆ๋‹ค.

1. FetchContent

  • FetchContent: 'configure time'์— ์™ธ๋ถ€ ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ๋ฅผ ๊ฐ€์ ธ์˜ต๋‹ˆ๋‹ค(populating).
    • configure time: CMake๋ฅผ ์‹คํ–‰ํ•˜๋Š” ์‹œ์ 
  • ExternalProject_Add(): ์™ธ๋ถ€ ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ๋ฅผ 'build time'์— ๊ฐ€์ ธ์˜ต๋‹ˆ๋‹ค.
    • build time: makefile์„ ํ™œ์šฉํ•˜์—ฌ make ํ•˜๋Š” ์‹œ์ .
  • the FetchContent module makes content available immediately, allowing the configure step to use the content in commands like add_subdirectory(), include() or file() operations.

1.1 FetchContent ์ •์˜: ์™ธ๋ถ€ ํ”„๋กœ์ ํŠธ์˜ ์ €์žฅ์†Œ ์ •์˜

typical example of declaring content details for some dependencies

FetchContent_Declare(
  googletest
  GIT_REPOSITORY https://github.com/google/googletest.git
  GIT_TAG        703bd9caab50b139428cea1aaff9974ebee5742e # release-1.10.0
)

then ensuring they are populated with a separate call: ์™ธ๋ถ€ ํ”„๋กœ์ ํŠธ ์„ค์ •

  • Default Population: performing the population using FetchContent_MakeAvailable()
  • Costom Population: the lower level FetchContent_GetProperties() and FetchContent_Populate() commands can be used (ํ•˜๋‹จ 'FetchContent Custom Population' ์ฐธ์กฐ)

 1.1.1 FetchContent Default Population: FetchContent_MakeAvailable

include(FetchContent)
FetchContent_Declare(
  <name>
  <contentOptions>...
  [OVERRIDE_FIND_PACKAGE |
   FIND_PACKAGE_ARGS args...]
)
FetchContent_MakeAvilable(<name>)
include(FetchContent)
FetchContent_Declare(
  googletest
  GIT_REPOSITORY https://github.com/google/googletest.git
  GIT_TAG        703bd9caab50b139428cea1aaff9974ebee5742e # release-1.10.0
)
FetchContent_MakeAvailable(googletest)
  • FetchContent_MakeAvailable : () ๋‚ด๋ถ€์— ๋Œ€์†Œ๋ฌธ์ž ํ—ˆ์šฉ

1.1.2 FetchContent Custom Population: FetchContent_Populate

Content population details should be defined separately from the command that performs the actual population.

# NOTE: Where possible, prefer to use FetchContent_MakeAvailable()
#       instead of custom logic like this

# Check if population has already been performed
FetchContent_GetProperties(${PROJECT_NAME})
if(NOT ${PROJECT_NAME}_POPULATED)
  # Fetch the content using previously declared details
  FetchContent_Populate(${PROJECT_NAME})

  # Set custom variables, policies, etc.
  # ...

  # Bring the populated content into the build
  add_subdirectory(${PROJECT_SOURCE_DIR} ${PROJECT_BINARY_DIR})
endif()
  • FetchContent_GetProperties : () ๋‚ด๋ถ€์— ์†Œ๋ฌธ์ž๋งŒ ํ—ˆ์šฉ
  • FetchContent_Populate(${PROJECT_NAME})์„ ํ•˜๋ฉด PROJECT_SOURCE_DIR, PROJECT_BINARY_DIR๊ณผ ๊ฐ™์€ ๋ณ€์ˆ˜๋„ ์ƒ์„ฑํ•ด์ค๋‹ˆ๋‹ค. ๋”ฐ๋ผ์„œ ๋‹ค์Œ๊ณผ ๊ฐ™์€ ๋ณ€์ˆ˜๋ฅผ ์ด์šฉํ•˜๊ธฐ ์œ„ํ•ด์„œ๋Š” MakeAvailable์„ ์‚ฌ์šฉํ•˜๋ฉด ์•ˆ๋ฉ๋‹ˆ๋‹ค.

1.2 Example of FetchContent

message(STATUS "Fetching googletest...")
FetchContent_Declare(
  googletest
  GIT_REPOSITORY https://github.com/google/googletest.git
  GIT_TAG        release-1.10.0 # GCC 5.0 ๋ฏธ๋งŒ์„ ์‚ฌ์šฉํ•˜๋Š” ๊ฒฝ์šฐ is_trivially_copy_constructible ์ง€์›์ด ๋˜์ง€ ์•Š์œผ๋ฏ€๋กœ 1.11.0 ์ดํ›„๋Š” ์‚ฌ์šฉ ๋ถˆ๊ฐ€
)
FetchContent_GetProperties(googletest)
if(NOT googletest_POPULATED)
  FetchContent_Populate(googletest)
  set(gtest_build_tests OFF CACHE BOOL "Enable gtest tests" FORCE)
  add_subdirectory(${googletest_SOURCE_DIR} ${googletest_BINARY_DIR} EXCLUDE_FROM_ALL)
endif()
  • <name>_SOURCE_DIR: ./build/_deps/<name>-src"
  • <name>_BINARY_DIR: ./build/_deps/<name>-build"
  • EXCLUDE_FROM_ALL: /build/bin ํด๋”์— ํ•„์š” ์—†๋Š” binary file ์ปดํŒŒ์ผ์„ ๋ง‰๊ธฐ ์œ„ํ•ด์„œ FetchContent_MakeAvailable ๋Œ€์‹ ์— FetchContent_GetProperties์™€ FetchContent_Populate๋ฅผ ์‚ฌ์šฉํ•ด์„œ EXCLUDE_FROM_ALL ์„ค์ •์„ ํ•ด์ฃผ๋ฉด ํ•„์š”์—†๋Š” ํŒŒ์ผ์„ ์ƒ์„ฑํ•˜์ง€ ์•Š๋Š”๋‹ค. 

+ FetchContent๋ฅผ ํ†ตํ•ด ์ƒ์„ฑ๋œ ํด๋” ๊ตฌ์กฐ

  • <name>_SOURCE_DIR: ${CMAKE_CURRENT_BINARY_DIR}/<lowercaseName>-src
    • ./build/_deps/<name>-src"
    • ์™ธ๋ถ€ ํ”„๋กœ์ ํŠธ์˜ ์ €์žฅ์†Œ์— ์žˆ๋Š” ์ „์ฒด ํŒŒ์ผ
  • <name>_BINARY_DIR: ${CMAKE_CURRENT_BINARY_DIR}/<lowercaseName>-build
    • ./build/_deps/<name>-build"
    • ์™ธ๋ถ€ ํ”„๋กœ์ ํŠธ๋ฅผ ๋นŒ๋“œํ•ด์„œ ์–ป์€ ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ ๋ฐ *.cpp๋ฅผ ์ปดํŒŒ์ผํ•œ *.o, *.o.d ํŒŒ์ผ๋“ค
  • <name>_SUBBUILD_DIR: ${CMAKE_CURRENT_BINARY_DIR}/<lowercaseName>-subbuild
    • ./build/_deps/<name>-subbuild"

์ฐธ๊ณ 

  • [Official CMake] FatchContent: https://cmake.org/cmake/help/latest/module/FetchContent.html#integrating-with-find-package
  • cmake source usage #187: https://github.com/open-source-parsers/jsoncpp/issues/187
  • [runebook] FetchContent: https://runebook.dev/ko/docs/cmake/module/fetchcontent
  • ๊ตฌ๊ธ€ ํ…Œ์ŠคํŠธ ํˆด์„ ์ด์šฉํ•œ UnitTest์šฉ CMakefile: https://object-world.tistory.com/25 
๋ฐ˜์‘ํ˜•
์ €์ž‘์žํ‘œ์‹œ ๋น„์˜๋ฆฌ ๋ณ€๊ฒฝ๊ธˆ์ง€ (์ƒˆ์ฐฝ์—ด๋ฆผ)

'Study: DeveloperTools(DevTool) > DevTool: CMake' ์นดํ…Œ๊ณ ๋ฆฌ์˜ ๋‹ค๋ฅธ ๊ธ€

[CMake] function: ๋ฐ˜๋ณต๋˜๋Š” ์ž‘์—…์€ ํ•จ์ˆ˜ํ™”ํ•˜์ž!  (0) 2022.06.28
[CMake] ํฌ๋กœ์Šค ํ”Œ๋žซํผ ๋นŒ๋“œ ํ™˜๊ฒฝ ๊ตฌ์ถ•  (0) 2022.06.24
[CMake] Effective Modern CMake ์ •๋ฆฌ  (0) 2022.06.24
[CMake] An Introduction to Modern CMake ์ •๋ฆฌ  (1) 2022.06.24
[CMake] CMake ์†Œ๊ฐœ ๋ฐ ํ•„์š”์„ฑ: Modern CMake 3.23+  (0) 2022.06.24
    'Study: DeveloperTools(DevTool)/DevTool: CMake' ์นดํ…Œ๊ณ ๋ฆฌ์˜ ๋‹ค๋ฅธ ๊ธ€
    • [CMake] function: ๋ฐ˜๋ณต๋˜๋Š” ์ž‘์—…์€ ํ•จ์ˆ˜ํ™”ํ•˜์ž!
    • [CMake] ํฌ๋กœ์Šค ํ”Œ๋žซํผ ๋นŒ๋“œ ํ™˜๊ฒฝ ๊ตฌ์ถ•
    • [CMake] Effective Modern CMake ์ •๋ฆฌ
    • [CMake] An Introduction to Modern CMake ์ •๋ฆฌ
    DrawingProcess
    DrawingProcess
    ๊ณผ์ •์„ ๊ทธ๋ฆฌ์ž!

    ํ‹ฐ์Šคํ† ๋ฆฌํˆด๋ฐ”