Skip to content

Commit c904746

Browse files
committed
testing
1 parent 07c10a4 commit c904746

File tree

5 files changed

+319
-23
lines changed

5 files changed

+319
-23
lines changed

.gitignore

Lines changed: 256 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,274 @@
1+
2+
# =========================
3+
# Conan build for msvc
4+
# =========================
5+
6+
build-msvc/
7+
8+
9+
# =========================
10+
# GitHub C++ Default Template Additions
11+
# =========================
112
# Prerequisites
213
*.d
314

4-
# Compiled Object files
5-
*.slo
6-
*.lo
15+
# Object files
716
*.o
817
*.obj
18+
*.elf
19+
20+
# Linker output
21+
*.ilk
22+
*.map
23+
*.exp
924

10-
# Precompiled Headers
25+
# Precompiled headers
1126
*.gch
1227
*.pch
1328

14-
# Linker files
15-
*.ilk
16-
17-
# Debugger Files
18-
*.pdb
29+
# Libraries
30+
*.lib
31+
*.a
32+
*.la
33+
*.lo
1934

20-
# Compiled Dynamic libraries
35+
# Shared objects (DLLs, shared libraries)
36+
*.dll
2137
*.so
38+
*.so.*
2239
*.dylib
23-
*.dll
24-
25-
# Fortran module files
26-
*.mod
27-
*.smod
28-
29-
# Compiled Static libraries
30-
*.lai
31-
*.la
32-
*.a
33-
*.lib
3440

3541
# Executables
3642
*.exe
3743
*.out
3844
*.app
3945

40-
# debug information files
41-
*.dwo
46+
# Debug files
47+
*.dSYM/
48+
*.su
49+
*.idb
50+
*.pdb
51+
52+
# =========================
53+
# OS specific
54+
# =========================
55+
# macOS
56+
.DS_Store
57+
.AppleDouble
58+
.LSOverride
59+
*.dSYM/
60+
61+
# Windows
62+
Thumbs.db
63+
ehthumbs.db
64+
Desktop.ini
65+
$RECYCLE.BIN/
66+
67+
# Linux / UNIX
68+
*~
69+
.fuse_hidden*
70+
.directory
71+
.Trash-*
72+
.nfs*
73+
74+
# =========================
75+
# C/C++ build artifacts
76+
# =========================
77+
# (Note: many patterns already covered above by GitHub default)
78+
*.lo
79+
*.al
80+
*.libs
81+
*.exp
82+
*.ilk
83+
*.gch
84+
*.pch
85+
*.prof
86+
*.profraw
87+
*.profdata
88+
*.dasm
89+
*.log
90+
*.log.*
91+
.cache/
92+
.ccache/
93+
.distcc/
94+
95+
# =========================
96+
# Build systems
97+
# =========================
98+
# CMake
99+
[Cc]MakeCache.txt
100+
[Cc]MakeFiles/
101+
CMakeScripts/
102+
Testing/
103+
cmake_install.cmake
104+
install_manifest.txt
105+
compile_commands.json
106+
CTestTestfile.cmake
107+
CMakeUserPresets.json
108+
_deps/
109+
Makefile
110+
111+
# Build directories (use out-of-source when possible)
112+
build/
113+
build-*/
114+
cmake-build-*/
115+
116+
# Ninja
117+
.ninja_deps
118+
.ninja_log
119+
120+
# Meson
121+
meson-logs/
122+
meson-private/
123+
builddir/
124+
125+
# SCons
126+
.sconsign.dblite
127+
SConstruct.out
128+
129+
# =========================
130+
# Package / dependency managers
131+
# =========================
132+
# Conan
133+
conanbuildinfo.*
134+
conaninfo.txt
135+
conan.lock
136+
.conan/
137+
138+
# vcpkg
139+
vcpkg_installed/
140+
141+
# Hunter
142+
_HUNTER/
143+
144+
# CPM.cmake
145+
_cpm_cache/
146+
147+
# =========================
148+
# LSP / code intelligence
149+
# =========================
150+
.clangd/
151+
.clangd-cache/
152+
.cache/clangd/
153+
.ccls-cache/
154+
tags
155+
TAGS
156+
GTAGS
157+
GRTAGS
158+
GPATH
159+
160+
# =========================
161+
# IDE / Editor specific ignores
162+
# =========================
163+
# Visual Studio (2019/2022)
164+
.vs/
165+
*.vcxproj*
166+
*.sln
167+
*.suo
168+
*.user
169+
*.filters
170+
*.lastbuildstate
171+
*.tlog
172+
*.opendb
173+
174+
# VSCode
175+
.vscode/
176+
.history/
177+
178+
# CLion / JetBrains
179+
.idea/
180+
cmake-build-*/
181+
182+
# Qt Creator
183+
*.pro.user*
184+
*.qbs.user*
185+
*.creator.user*
186+
*.creator
187+
*.autosave
188+
*.qmlproject.user*
189+
CMakeLists.txt.user
190+
.qmake.stash
191+
192+
# Eclipse CDT
193+
.project
194+
.cproject
195+
.settings/
196+
.metadata/
197+
.externalToolBuilders/
198+
bin/
199+
tmp/
200+
201+
# Xcode
202+
DerivedData/
203+
build/
204+
*.pbxuser
205+
!default.pbxuser
206+
*.mode1v3
207+
!default.mode1v3
208+
*.mode2v3
209+
!default.mode2v3
210+
*.perspectivev3
211+
!default.perspectivev3
212+
xcuserdata/
213+
*.xccheckout
214+
*.moved-aside
215+
*.xcuserstate
216+
*.xcscmblueprint
217+
218+
# Neovim / Vim
219+
*~
220+
.*.swp
221+
.*.swo
222+
.*.swm
223+
Session.vim
224+
225+
# Emacs
226+
\#*\#
227+
.#*
228+
.emacs.desktop
229+
.emacs.desktop.lock
230+
auto-save-list/
231+
tramp
232+
.dir-locals.el
233+
234+
# Sublime Text
235+
*.sublime-workspace
236+
*.sublime-project
237+
sftp-config.json
238+
239+
# Atom
240+
.atom/
241+
*.atom-build.yml
242+
243+
# Code::Blocks
244+
*.cbp
245+
*.depend
246+
*.layout
247+
248+
# CodeLite
249+
.codelite/
250+
*.project
251+
*.workspace
252+
253+
# KDevelop
254+
.kdev4/
255+
*.kdev4
256+
257+
# NetBeans (C/C++)
258+
nbproject/private/
259+
build/
260+
dist/
261+
262+
# Geany
263+
*.geany
264+
265+
# Dev-C++
266+
*.dev
267+
*.layout
268+
269+
# JetBrains Fleet
270+
.fleet/
271+
272+
# Kate
273+
*.kate-swp
274+
.kateproject.*

CMakeLists.txt

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
cmake_minimum_required(VERSION 3.21)
2+
project(conan_sample LANGUAGES CXX)
3+
4+
set(CMAKE_CXX_STANDARD 17)
5+
set(CMAKE_CXX_STANDARD_REQUIRED ON)
6+
7+
add_executable(app src/main.cpp)
8+
9+
find_package(Boost CONFIG REQUIRED)
10+
11+
if(TARGET Boost::headers)
12+
target_link_libraries(app PRIVATE Boost::headers)
13+
elseif(TARGET Boost::boost)
14+
target_link_libraries(app PRIVATE Boost::boost)
15+
else()
16+
message(FATAL_ERROR "Boost target not found (Boost::headers / Boost::boost).")
17+
endif()

README.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
2+
- 코난 프로젝트 빌드 명령 (MSVC 2022)
3+
4+
```
5+
# msvc cmd 에서 다음과 같은 명령들을 실행한다.
6+
7+
cmake -E rm -rf build-msvc
8+
# build-msvc 디렉터리를 존재 여부와 관계없이, 하위 내용까지 전부 삭제
9+
10+
conan install . -pr:h %USERPROFILE%\.conan2\profiles\msvc_release -pr:b default -of build-msvc --build=missing
11+
# conan install . : 현재 디렉터리(.)에 있는 conanfile.txt 또는 conanfile.py를 기준
12+
# -pr:h %USERPROFILE%\.conan2\profiles\msvc_release : host profile 지정
13+
# -pr:b default : 보통 host와 동일하면 default를 사용
14+
# -of build-msvc : Conan이 생성하는 파일들을 build-msvc 디렉터리에 출력
15+
# --build=missing : 로컬 캐시에 없는 패키지는 소스에서 빌드. 이미 캐시에 있으면 빌드하지 않음.
16+
17+
cmake -S . -B build-msvc -DCMAKE_TOOLCHAIN_FILE=build-msvc\conan_toolchain.cmake -G "Visual Studio 17 2022"
18+
# -S . : 현재 디렉터리(.)에 CMakeLists.txt가 있음
19+
# -B build-msvc : CMake 결과물을 build-msvc에 생성
20+
# -DCMAKE_TOOLCHAIN_FILE=build-msvc\conan_toolchain.cmake :
21+
22+
cmake --build build-msvc --config Release
23+
# --build build-msvc : build-msvc 경로의 것을 빌드
24+
# --config Release : 릴리즈로 빌드
25+
```
26+
27+
28+
29+
30+

conanfile.txt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
[requires]
2+
boost/1.84.0
3+
4+
[options]
5+
boost/*:shared=False
6+
7+
[generators]
8+
CMakeToolchain
9+
CMakeDeps

src/main.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#include <iostream>
2+
#include <boost/version.hpp>
3+
4+
int main() {
5+
std::cout << "Boost version: " << BOOST_LIB_VERSION << "\n";
6+
return 0;
7+
}

0 commit comments

Comments
 (0)