๋ณธ๋ฌธ ๋ฐ”๋กœ๊ฐ€๊ธฐ
C++ ์‘์šฉ

vcpkg๋ฅผ ์“ฐ์ž

by ์„œ์•„๋ž‘๐Ÿ˜ 2023. 3. 19.

vcpkg ๋กœ๊ณ (https://devblogs.microsoft.com/search?query=vcpkg)

ํ•ญ์ƒ C/C++ ๊ฐœ๋ฐœ์ž๋“ค์€ ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ๋กœ ์ธํ•ด ๊ณ ํ†ต๋ฐ›์Šต๋‹ˆ๋‹ค. ํ”Œ๋žซํผ ์ข…์†์ ์ด๋ฉด์„œ ๋ฌด๊ตฌํ•œ ์—ญ์‚ฌ๋ฅผ ๊ฐ€์ง„ ์–ธ์–ด์ด๊ธฐ ๋•Œ๋ฌธ์— ๋น„๊ต์  ์ตœ๊ทผ์— ๋‚˜์˜จ ์–ธ์–ด์™€ ๋‹ฌ๋ฆฌ ์„œ๋“œํŒŒํ‹ฐ ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ๋ฅผ ์ ์šฉํ•˜๊ธฐ๊ฐ€ ๊นŒ๋‹ค๋กœ์› ์ฃ .

 

node์ง„์˜์˜ npm๊นŒ์ง€๋Š” ์•„๋‹ˆ์ง€๋งŒ C/C++์ง„์˜์—์„œ๋„ MS๊ฐ€ ๋งŒ๋“  vcpkg๋ฅผ ์“ฐ๋Š”๊ฒŒ ๊ทธ๋‚˜๋งˆ ํƒˆ๋ชจ์˜ ์†๋„๋ฅผ ๋Šฆ์ถฐ์ค„ ๊ฒƒ์ž…๋‹ˆ๋‹ค.

 

vcpkg์˜ ๊ณต์‹ ํ™ˆํŽ˜์ด์ง€๋Š” ๋‹ค์Œ๊ณผ ๊ฐ™์Šต๋‹ˆ๋‹ค.

 

https://vcpkg.io/en/index.html

 

vcpkg - Open source C/C++ dependency manager from Microsoft

Easy To Use Download and build popular libraries in a single step. Never worry about upstream dependencies or version conflicts. Declare dependencies with commandline actions or in a manifest that can live with your repo. Get support from the development t

vcpkg.io

 

https://github.com/microsoft/vcpkg

 

GitHub - microsoft/vcpkg: C++ Library Manager for Windows, Linux, and MacOS

C++ Library Manager for Windows, Linux, and MacOS. Contribute to microsoft/vcpkg development by creating an account on GitHub.

github.com

 

๊ณตํ™ˆ์— ๋‚˜์˜จ ์„ค์น˜๊ฐ€์ด๋“œ๋ฅผ ์ฐจ๋ถ„ํžˆ ๋”ฐ๋ผ๊ฐ€๋ฉด ์–ด๋ ต์ง€ ์•Š๊ฒŒ vcpkg๋ฅผ ์„ค์น˜ํ•  ์ˆ˜ ์žˆ์œผ๋ฉฐ, vcpkg install xxxx ๋ช…๋ น์–ด๋ฅผ ํ†ตํ•ด ํ•„์š”ํ•œ ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ๋ฅผ ์ ์šฉํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

 

Linux, windows ๋ชจ๋‘ ์ง€์›ํ•˜๋ฉฐ, ํŠนํžˆ windows์—์„œ๋Š” ์ฐฐ๋–ก ๊ถํ•ฉ์„ ์ž๋ž‘ํ•˜๋Š” ๊ฒƒ ๊ฐ™์Šต๋‹ˆ๋‹ค.(์—ญ์‹œ MSํ˜ธํ™˜..) vcpkg๋กœ ํ•„์š”ํ•œ ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ๋ฅผ ์„ค์น˜ํ•˜๋ฉด ํ—ค๋”ํŒŒ์ผ include path๋ฅผ ๋ฐ”๋กœ ์žก์•„์ค˜์„œ ์ฆ‰์‹œ ์ฝ”๋“œ์— ์ ์šฉํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ๋งํ‚น์‹œ์—๋„ ํ•ด๋‹น ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ๊ฐ€ ํ•„์š”๋กœ ํ•˜๋Š” lib์„ ์ž๋™์œผ๋กœ ๋งํฌํ•˜๊ธฐ ๋•Œ๋ฌธ์— ๋นŒ๋“œ์— ์–ด๋ ค์›€์ด ์—†์Šต๋‹ˆ๋‹ค. ์‹ฌ์ง€์–ด ๋™์ ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ(dll)๋Š” ๋นŒ๋“œ ํ›„ ์‹คํ–‰ํŒŒ์ผ์ด ์žˆ๋Š” ์œ„์น˜์— ์ž๋™์œผ๋กœ ๋ณต์‚ฌ๊นŒ์ง€ ๋ฉ๋‹ˆ๋‹ค.

 

 

์ œ๊ฐ€ ์—ฌํƒœ๊นŒ์ง€ vcpkg๋กœ ์„ค์น˜ํ–ˆ๋˜ ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ๋Š” jsoncpp, cpp-redis, IXWebsocket, grpc ์ •๋„๊ฐ€ ์žˆ๊ฒ ๋„ค์š”. ๊ทธ ์™ธ์—๋„ vcpkg search xxxx๋กœ ์–ด๋–ค ํŒจํ‚ค์ง€๋“ค์ด ์˜ฌ๋ผ์™€์žˆ๋Š” ์ง€ ํ™•์ธํ•ด๋ณผ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

 

๊ฐœ์ธ์ ์œผ๋กœ cmake๋ฅผ ์‹ซ์–ดํ•˜๋Š” ์‚ฌ๋žŒ์œผ๋กœ์„œ vcpkg์˜ ์˜ํ–ฅ๋ ฅ์ด ํ™•๋Œ€๋˜๋Š” ๊ฒƒ์ด ๋„ˆ๋ฌด ์ข‹๋„ค์š”. ์‹œ๊ฐ„๋œ๋‹ค๋ฉด ๋‹ค์Œ์—” ์ œ๊ฐ€ ์„ค์น˜ํ–ˆ๋˜ ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ๋“ค์˜ ์„ค์น˜๊ณผ์ •์„ ์˜ฌ๋ ค๋ณด๋ ค๊ณ  ํ•ฉ๋‹ˆ๋‹ค. ๋ˆ„๊ตฐ๊ฐ€์—๊ฒŒ ๋„์›€์ด ๋˜๊ธธ ๋ฐ”๋ผ๋ฉฐ...

๋Œ“๊ธ€