FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
cmkr/src/arguments.cpp at main · build-cpp/cmkr · GitHub
Uh oh!
There was an error while loading.
Please reload this page
.
build-cpp
/
cmkr
Public
Uh oh!
There was an error while loading.
Please reload this page
.
Notifications
You must be signed in to change notification settings
Fork
42
Star
631
Code
Issues
41
Pull requests
0
Discussions
Actions
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Discussions
Actions
Security and quality
Insights
Expand file tree
Breadcrumbs
cmkr
/
src
/
arguments.cpp
Copy path
More file actions
More file actions
Latest commit
History
History
History
55 lines (52 loc) · 1.75 KB
Breadcrumbs
cmkr
/
src
/
arguments.cpp
Copy path
File metadata and controls
55 lines (52 loc) · 1.75 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#
include
"
arguments.hpp
"
#
include
"
build.hpp
"
#
include
"
cmake_generator.hpp
"
#
include
"
help.hpp
"
#
include
"
fs.hpp
"
#
include
<
stdexcept
>
#
include
<
string
>
#
include
<
vector
>
namespace
cmkr
{
namespace
args
{
const
char
*
handle_args
(
int
argc,
char
**argv) {
std::vector<std::string> args;
for
(
int
i =
0
; i < argc; ++i)
args.
push_back
(argv[i]);
if
(args.
size
() <
2
)
throw
std::runtime_error
(
cmkr::help::message
());
std::string main_arg = args[
1
];
if
(main_arg ==
"
gen
"
) {
cmkr::gen::generate_cmake
(
fs::current_path
().
string
().
c_str
());
return
"
CMake generation successful!
"
;
}
else
if
(main_arg ==
"
help
"
) {
return
cmkr::help::message
();
}
else
if
(main_arg ==
"
version
"
) {
return
cmkr::help::version
();
}
else
if
(main_arg ==
"
init
"
) {
std::string type =
"
executable
"
;
if
(args.
size
() >
2
)
type = args[
2
];
cmkr::gen::generate_project
(type.
c_str
());
cmkr::gen::generate_cmake
(
fs::current_path
().
string
().
c_str
());
return
"
Directory initialized!
"
;
}
else
if
(main_arg ==
"
build
"
) {
auto
ret =
build::run
(argc, argv);
if
(ret)
throw
std::runtime_error
(
"
CMake build failed!
"
);
return
"
CMake build completed!
"
;
}
else
if
(main_arg ==
"
install
"
) {
auto
ret =
build::install
();
if
(ret)
throw
std::runtime_error
(
"
CMake install failed!
"
);
return
"
CMake install completed!
"
;
}
else
if
(main_arg ==
"
clean
"
) {
auto
ret =
build::clean
();
if
(ret)
throw
std::runtime_error
(
"
CMake clean failed!
"
);
return
"
Cleaned build directory!
"
;
}
else
{
throw
std::runtime_error
(
cmkr::help::message
());
}
}
}
//
namespace args
}
//
namespace cmkr
Back
|
FazBrowse Home
|
New Git URL