-
Notifications
You must be signed in to change notification settings - Fork 0
/
cppProject
executable file
·62 lines (46 loc) · 1.41 KB
/
cppProject
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
56
57
58
59
60
#! /bin/bash
# hack to be able to execute the cmakeMain, cmakeSrc, cmakeInclude files in only current session.
export PATH="$PATH:$SCRIPTS_LIB_PATH/cppProject_include"
# ASSERT ----------------------------------------------------------------------
# Testing the current directory for any other directories or files that match
# the ones we are creating here. This is to not override the existing files and
# loose work
# run assert script
assert_no_existing_files_or_Dirs
# test assert exit status
if [ $? -eq 1 ] ; then
exit 1
fi
# -----------------------------------------------------------------------------
# Adding git to project
git init
# adds gitIgnore file with preset ignore files.
gitIgnore
# Creating root CMakeLists.txt file
if [[ "$1" == '-wx' ]]; then
cmakeWxWidgets
else
cmakeMain
fi
# adding all directories
mkdir build include src
# Setting up the source file directory CMakeLists.txt and main.cpp entry file
cd src
cmakeSrc
touch main.cpp
# setting up include directory
cd ../include
cmakeInclude
cd ..
# Adding README.md to the Root.
echo "
## PROJECT
----
" > README.md
# adding googletest to project
git clone https://github.com/google/googletest.git -b v1.13.0
cd googletest # Main directory of the cloned repository.
mkdir build # Create a directory to hold the build output.
cd build
cmake .. # Generate native build scripts for GoogleTest.
cd ../../