Skip to content

Commit f244d49

Browse files
authored
Fix newline in new module's script (QC-229) (#223)
1 parent 4687062 commit f244d49

3 files changed

Lines changed: 17 additions & 41 deletions

File tree

.cmake-format.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# How wide to allow formatted cmake files
2-
line_width = 80
2+
line_width = 120
33

44
# How many spaces to tab for indent
55
tab_size = 2

.cmake-format.yaml

Lines changed: 0 additions & 31 deletions
This file was deleted.

Modules/o2-qc-module-configurator.sh

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ set -u # exit when using undeclared variable
66
DONOR=Skeleton
77
DONOR_LC=skeleton
88

9+
OS=`uname`
10+
911
function inplace_sed() {
1012
sed -ibck "$1" $2 && rm $2bck
1113
}
@@ -55,7 +57,7 @@ function create_module() {
5557

5658
function cmake_format() {
5759
if command cmake-format >/dev/null 2>&1; then
58-
cmake-format -i $1
60+
cmake-format -i $1 -c ../.cmake-format.py
5961
fi
6062
}
6163

@@ -107,14 +109,19 @@ function create_class() {
107109
' $DONOR_INCLUDE_FILENAME >$INCLUDE_FILENAME
108110

109111
# add LinkDef.h
110-
inplace_sed '/#endif/ i\
111-
#pragma link C++ class o2::quality_control_modules::'${MODULE_LC}'::'$classname'+;
112-
113-
' $modulename/include/$modulename/LinkDef.h
114-
115-
inplace_sed '/LINKDEF include/ i\
116-
include/'$modulename'/'$classname'.h\
117-
' $modulename/CMakeLists.txt
112+
if [[ $OS == Linux ]] ; then
113+
sed -i '/#endif/ i #pragma link C++ class o2::quality_control_modules::'${MODULE_LC}'::'$classname'+;' \
114+
$modulename/include/$modulename/LinkDef.h
115+
sed -i '/HEADERS/ a \ \ include/'$modulename'/'$classname'.h' $modulename/CMakeLists.txt
116+
else #Darwin/BSD
117+
inplace_sed '/#endif/ i\
118+
#pragma link C++ class o2::quality_control_modules::'${MODULE_LC}'::'$classname'+;\
119+
\
120+
' $modulename/include/$modulename/LinkDef.h
121+
inplace_sed '/LINKDEF include/ i\
122+
include/'$modulename'/'$classname'.h\
123+
' $modulename/CMakeLists.txt
124+
fi
118125

119126
# add src
120127
sed '

0 commit comments

Comments
 (0)