- Windows : Visual Studio (2022), cmake, ninja
- Linux : gcc, cmake, ninja
conanfile.txt
[requires]
boost/1.84.0
[options]
boost/*:shared=False
[generators]
CMakeToolchain
CMakeDeps
์ฝ๋ ํ๋กํ ํ์ผ์ ์ฌ์ ์ ์์ฑํ๋ค.
C:\Users\<user>\.conan2\profiles\msvc_release<user>๋ ๊ฐ์ธ ๊ณ์
[settings]
os=Windows
arch=x86_64
build_type=Release
compiler=msvc
compiler.version=194
compiler.runtime=dynamic
compiler.runtime_type=Release
compiler.cppstd=17
[conf]
tools.cmake.cmaketoolchain:generator=NinjaC:\Users\<user>\.conan2\profiles\msvc_debug
[settings]
os=Windows
arch=x86_64
build_type=Debug
compiler=msvc
compiler.version=194
compiler.runtime=dynamic
compiler.runtime_type=Debug
compiler.cppstd=17
[conf]
tools.cmake.cmaketoolchain:generator=Ninja- Release ๋น๋
# msvc cmd ์์ ๋ค์๊ณผ ๊ฐ์ ๋ช
๋ น๋ค์ ์คํํ๋ค.
cmake -E rm -rf build-msvc-release
# build-msvc ๋๋ ํฐ๋ฆฌ๋ฅผ ์กด์ฌ ์ฌ๋ถ์ ๊ด๊ณ์์ด, ํ์ ๋ด์ฉ๊น์ง ์ ๋ถ ์ญ์
conan install . ^
-pr:h %USERPROFILE%\.conan2\profiles\msvc_release ^
-pr:b default ^
-of build-msvc-release ^
--build=missing
# conan install . : ํ์ฌ ๋๋ ํฐ๋ฆฌ(.)์ ์๋ conanfile.txt ๋๋ conanfile.py๋ฅผ ๊ธฐ์ค
# -pr:h %USERPROFILE%\.conan2\profiles\msvc_release : host profile ์ง์
# -pr:b default : ๋ณดํต host์ ๋์ผํ๋ฉด default๋ฅผ ์ฌ์ฉ
# -of build-msvc-release : Conan์ด ์์ฑํ๋ ํ์ผ๋ค์ build-msvc-release ๋๋ ํฐ๋ฆฌ์ ์ถ๋ ฅ
# --build=missing : ๋ก์ปฌ ์บ์์ ์๋ ํจํค์ง๋ ์์ค์์ ๋น๋. ์ด๋ฏธ ์บ์์ ์์ผ๋ฉด ๋น๋ํ์ง ์์.
cmake -S . ^
-B build-msvc-release ^
-DCMAKE_TOOLCHAIN_FILE=build-msvc\conan_toolchain.cmake ^
-G "Visual Studio 17 2022"
# -S . : ํ์ฌ ๋๋ ํฐ๋ฆฌ(.)์ CMakeLists.txt๊ฐ ์์
# -B build-msvc : CMake ๊ฒฐ๊ณผ๋ฌผ์ build-msvc์ ์์ฑ
# -DCMAKE_TOOLCHAIN_FILE=build-msvc\conan_toolchain.cmake :
cmake --build build-msvc-release --config Release
# --build build-msvc-release : build-msvc-release ๊ฒฝ๋ก ๋น๋
# --config Release : ํ๋กํ ํ์ผ(msvc_release)์ Release๋ก ์ค์ ๋ ๊ฒฝ์ฐ, ๋ฆด๋ฆฌ์ฆ๋ก ๋น๋ํ์ฌ์ผ ํจ.- Debug ๋น๋
cmake -E rm -rf build-msvc-debug
conan install . ^
-pr:h %USERPROFILE%\.conan2\profiles\msvc_debug ^
-pr:b default ^
-of build-msvc-debug ^
--build=missing
cmake -S . -B build-msvc-debug ^
-DCMAKE_TOOLCHAIN_FILE=build-msvc-debug\conan_toolchain.cmake ^
-G "Visual Studio 17 2022"
cmake --build build-msvc-debug --config Debug
/home/<user>/.conan2/profiles/linux_gcc_release
[settings]
os=Linux
arch=x86_64
compiler=gcc
compiler.version=8
compiler.libcxx=libstdc++11
build_type=Release
[conf]
tools.cmake.cmaketoolchain:generator=Ninja- Release ๋น๋
cmake -E rm -rf build-linux-gcc-release
conan install . \
-pr:h ~/.conan2/profiles/linux_gcc_release \
-pr:b default \
-of build-linux-gcc-release \
--build=b2* \
--build=missing
# b2์ ์ข
์์ฑ ๋ฌธ์ ๊ฐ ์์ ๊ฒฝ์ฐ๋ฅผ ๋๋นํ์ฌ b2๋ ๋น๋ํจ
cmake -S . \
-B build-linux-gcc-release \
-DCMAKE_TOOLCHAIN_FILE=build-linux-gcc/conan_toolchain.cmake \
-G "Unix Makefiles" \
-DCMAKE_BUILD_TYPE=Release
cmake --build build-linux-gcc-release --config Release