forked from degauden/Elements
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathaddCppProgram_test
More file actions
executable file
·119 lines (99 loc) · 4.14 KB
/
Copy pathaddCppProgram_test
File metadata and controls
executable file
·119 lines (99 loc) · 4.14 KB
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
#!/bin/sh
# Call common script
. createCommonStructure_test
cpp_program_name="CppProgramTest"
module_dep_name="Alexandria"
library_dep_name="Boost"
elements_kernel="ElementsKernel"
# Create a unique directory
tmploc=${TEMPORARY_LOCATION}
cd ${tmploc}
cd ${MODULE_NAME_PATH}
# Create a CPP program
AddCppProgram $cpp_program_name -md $module_dep_name -ld $library_dep_name --yes
# if error stop and clean up
if [ $? -ne 0 ]; then
echo "Error: <AddCppProgram $cpp_program_name -md $module_dep_name -ld $library_dep_name> command failed!" 1>&2
clean_and_exit 1
fi
# make sure the class files are created
if [ ! -e "src/program/$cpp_program_name.cpp" ]; then
echo "Error: <src/program/$cpp_program_name.cpp> file not found!" 1>&2
clean_and_exit 1
fi
# Make sure the elements_depends_on_subdirs Macro is there and ElementsKernel
result=$( grep "elements_depends_on_subdirs" ${MODULE_NAME_PATH}/CMakeLists.txt |
grep ElementsKernel )
if [ $? -ne 0 ] ;then
echo "Error: <elements_depends_on_subdirs> macro with <ElementsKernel> module not found!" 1>&2
clean_and_exit 1
fi
# Make sure the elements_depends_on_subdirs Macro is there and module dependency
result=$( grep "elements_depends_on_subdirs" ${MODULE_NAME_PATH}/CMakeLists.txt |
grep -v "#" | grep $module_dep_name )
if [ $? -ne 0 ] ;then
echo "Error: <elements_depends_on_subdirs> macro with <$module_dep_name> dependency not found!" 1>&2
clean_and_exit 1
fi
# Make sure the find_package Macro is there and module dependency
result=$( grep "find_package" ${MODULE_NAME_PATH}/CMakeLists.txt | grep -v "#" |
grep $library_dep_name )
if [ $? -ne 0 ] ;then
echo "Error: find_package macro not found!" 1>&2
clean_and_exit 1
fi
# Make sure the elements_add_executable Macro is there
result=$( grep "elements_add_executable" ${MODULE_NAME_PATH}/CMakeLists.txt | grep $cpp_program_name )
if [ $? -ne 0 ] ;then
echo "Error: <elements_add_executable> macro with <$cpp_program_name> executable not found!" 1>&2
clean_and_exit 1
fi
# Make sure the LINK_LIBRARIES Macro is there and ElementsKernel
result=$( grep "LINK_LIBRARIES" ${MODULE_NAME_PATH}/CMakeLists.txt | grep -v "#" |
grep $elements_kernel )
if [ $? -ne 0 ] ;then
echo "Error: <LINK_LIBRARIES> macro with <$elements_kernel> module not found!" 1>&2
clean_and_exit 1
fi
# Make sure the LINK_LIBRARIES Macro is there and module dependency
result=$( grep "LINK_LIBRARIES" ${MODULE_NAME_PATH}/CMakeLists.txt | grep -v "#" |
grep $module_dep_name )
if [ $? -ne 0 ] ;then
echo "Error: <LINK_LIBRARIES> macro with <$module_dep_name> module not found!" 1>&2
clean_and_exit 1
fi
# Make sure the LINK_LIBRARIES Macro is there and library dependency
result=$( grep "LINK_LIBRARIES" ${MODULE_NAME_PATH}/CMakeLists.txt | grep -v "#" |
grep $library_dep_name )
if [ $? -ne 0 ] ;then
echo "Error: <LINK_LIBRARIES> macro with <$library_dep_name> library not found!" 1>&2
clean_and_exit 1
fi
# Make sure the INCLUDE_DIRS is there and ElementsKernel dependency
result=$( grep "INCLUDE_DIRS" ${MODULE_NAME_PATH}/CMakeLists.txt | grep -v "#" |
grep $elements_kernel)
if [ $? -ne 0 ] ;then
echo "Error: <INCLUDE_DIRS> macro with <$elements_kernel> module not found!" 1>&2
clean_and_exit 1
fi
# Make sure the INCLUDE_DIRS is there and module dependency
result=$( grep "INCLUDE_DIRS" ${MODULE_NAME_PATH}/CMakeLists.txt | grep -v "#" |
grep $module_dep_name)
if [ $? -ne 0 ] ;then
echo "Error: <INCLUDE_DIRS> macro with <$module_dep_name> module dependency not found!" 1>&2
clean_and_exit 1
fi
# Make sure the INCLUDE_DIRS is there and library dependency
result=$( grep "INCLUDE_DIRS" ${MODULE_NAME_PATH}/CMakeLists.txt | grep -v "#" |
grep $library_dep_name)
if [ $? -ne 0 ] ;then
echo "Error: <INCLUDE_DIRS> macro with <$library_dep_name> library dependency not found!" 1>&2
clean_and_exit 1
fi
# Make sure the elements_install_conf_files Macro is there
result=$( grep "elements_install_conf_files" ${MODULE_NAME_PATH}/CMakeLists.txt )
if [ $? -ne 0 ] ;then
echo "Error: <elements_install_conf_files> macro not found!" 1>&2
clean_and_exit 1
fi
clean_and_exit 0