-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCodelite_cmake_fd.sh
executable file
·136 lines (121 loc) · 4.36 KB
/
Codelite_cmake_fd.sh
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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
#!/bin/bash
if [ "$#" -ne 2 ]; then
echo "$0 path_to_deploy program_name"
exit 1
fi
PATH_TO_DEPLOY=$1
PROGRAM_NAME=$2
mkdir -p $PATH_TO_DEPLOY
mkdir -p $PATH_TO_DEPLOY/src
echo "cmake_minimum_required(VERSION 2.8)
## Use the variable PROJECT_NAME for changing the target name
set( PROJECT_NAME \"$PROGRAM_NAME\" )
## Set our project name
project(\${PROJECT_NAME})
#add_definitions(-std=c++14)
## Use all the *.cpp files we found under this folder for the project
FILE(GLOB SRCS \"src/*.cpp\" \"src/*.c\")
add_executable(\${PROJECT_NAME} \${SRCS})
#target_link_libraries( \${PROJECT_NAME} )
" > $PATH_TO_DEPLOY/CMakeLists.txt
echo "#include <iostream>
#ifndef DBGMSG
#define DBGMSG(msg) \\
std::cout << \\
\"thread id: \" << \\
std::this_thread::get_id() << \\
\":\" << \\
__FILE__ << \":\" << \\
__FUNCTION__ << \":Line \" << \\
__LINE__ << \" \" << \\
std::endl << msg << std::endl; \\
std::cout.flush();
#define DBGVAR(var) DBGMSG(#var << "= " << var)
#endif
using namespace std;
int main(int argc, char **argv)
{
cout << \"Hola Universo\" << endl;
}
" > $PATH_TO_DEPLOY/src/main.cpp
echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>
<CodeLite_Project Name=\"$PROGRAM_NAME\" InternalType=\"Console\" Version=\"10.0.0\">
<Plugins>
<Plugin Name=\"qmake\">
<![CDATA[00010001N0011Debug_Linux000000000000]]>
</Plugin>
<Plugin Name=\"CppCheck\"/>
<Plugin Name=\"CMakePlugin\">
<![CDATA[[{
\"name\": \"Linux\",
\"enabled\": false,
\"buildDirectory\": \"build\",
\"sourceDirectory\": \"\$(ProjectPath)\",
\"generator\": \"\",
\"buildType\": \"\",
\"arguments\": [],
\"parentProject\": \"\"
}]]]>
</Plugin>
</Plugins>
<Description/>
<Dependencies/>
<VirtualDirectory Name=\"resources\">
<File Name=\"CMakeLists.txt\"/>
</VirtualDirectory>
<VirtualDirectory Name=\"src\">
<File Name=\"src/main.cpp\"/>
</VirtualDirectory>
<Dependencies Name=\"Linux\"/>
<Settings Type=\"Executable\">
<GlobalSettings>
<Compiler Options=\"\" C_Options=\"\" Assembler=\"\">
<IncludePath Value=\".\"/>
</Compiler>
<Linker Options=\"\">
<LibraryPath Value=\".\"/>
</Linker>
<ResourceCompiler Options=\"\"/>
</GlobalSettings>
<Configuration Name=\"Linux\" CompilerType=\"GCC\" DebuggerType=\"GNU gdb debugger\" Type=\"Executable\" BuildCmpWithGlobalSettings=\"append\" BuildLnkWithGlobalSettings=\"append\" BuildResWithGlobalSettings=\"append\">
<Compiler Options=\"-g;-O0;-Wall\" C_Options=\"-g;-O0;-Wall\" Assembler=\"\" Required=\"yes\" PreCompiledHeader=\"\" PCHInCommandLine=\"no\" PCHFlags=\"\" PCHFlagsPolicy=\"0\">
<IncludePath Value=\".\"/>
</Compiler>
<Linker Options=\"\" Required=\"yes\"/>
<ResourceCompiler Options=\"\" Required=\"no\"/>
<General OutputFile=\"\$(IntermediateDirectory)/\$(ProjectName)\" IntermediateDirectory=\"./Debug\" Command=\"\$(ProjectPath)/build-debug/\$(ProjectName)\" CommandArguments=\"\" UseSeparateDebugArgs=\"no\" DebugArguments=\"\" WorkingDirectory=\"\" PauseExecWhenProcTerminates=\"yes\" IsGUIProgram=\"no\" IsEnabled=\"yes\"/>
<Environment EnvVarSetName=\"<Use Defaults>\" DbgSetName=\"<Use Defaults>\">
<![CDATA[]]>
</Environment>
<Debugger IsRemote=\"no\" RemoteHostName=\"\" RemoteHostPort=\"\" DebuggerPath=\"\" IsExtended=\"no\">
<DebuggerSearchPaths/>
<PostConnectCommands/>
<StartupCommands/>
</Debugger>
<PreBuild/>
<PostBuild/>
<CustomBuild Enabled=\"yes\">
<Target Name=\"cmake\">cmake .. -DCMAKE_BUILD_TYPE=Debug -DCMAKE_EXPORT_COMPILE_COMMANDS=1</Target>
<RebuildCommand>make clean && make -j4</RebuildCommand>
<CleanCommand>make clean</CleanCommand>
<BuildCommand>make -j4</BuildCommand>
<PreprocessFileCommand/>
<SingleFileCommand/>
<MakefileGenerationCommand/>
<ThirdPartyToolName>None</ThirdPartyToolName>
<WorkingDirectory>\$(ProjectPath)/build-debug</WorkingDirectory>
</CustomBuild>
<AdditionalRules>
<CustomPostBuild/>
<CustomPreBuild/>
</AdditionalRules>
<Completion EnableCpp11=\"no\" EnableCpp14=\"no\">
<ClangCmpFlagsC/>
<ClangCmpFlags/>
<ClangPP/>
<SearchPaths/>
</Completion>
</Configuration>
</Settings>
</CodeLite_Project>
" > $PATH_TO_DEPLOY/$PROGRAM_NAME.project