Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
project_cpp_template
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
labrobotica
project_cpp_template
Commits
6af592ee
Commit
6af592ee
authored
13 years ago
by
Sergi Hernandez
Browse files
Options
Downloads
Patches
Plain Diff
Added the new folder structure with the branches, tags and trunk directories.
Added the compilation flags for C++
parent
2dfbd876
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
CMakeLists_template.txt
+2
-2
2 additions, 2 deletions
CMakeLists_template.txt
ReadMe.txt
+0
-19
0 additions, 19 deletions
ReadMe.txt
new_project.sh
+49
-21
49 additions, 21 deletions
new_project.sh
with
51 additions
and
42 deletions
CMakeLists_template.txt
+
2
−
2
View file @
6af592ee
...
...
@@ -18,8 +18,8 @@ IF (NOT CMAKE_BUILD_TYPE)
SET(CMAKE_BUILD_TYPE "DEBUG")
ENDIF (NOT CMAKE_BUILD_TYPE)
SET(CMAKE_C_FLAGS_DEBUG "-g -Wall -D_REENTRANT")
SET(CMAKE_C_FLAGS_RELEASE "-O3 -D_REENTRANT")
SET(CMAKE_C
XX
_FLAGS_DEBUG "-g -Wall -D_REENTRANT")
SET(CMAKE_C
XX
_FLAGS_RELEASE "-O3 -D_REENTRANT")
ADD_SUBDIRECTORY(src)
...
...
This diff is collapsed.
Click to expand it.
ReadMe.txt
deleted
100755 → 0
+
0
−
19
View file @
2dfbd876
Copyright (C) 2009-2010 Institut de Robòtica i Informàtica Industrial, CSIC-UPC.
Author shernand (shernand@iri.upc.edu)
All rights reserved.
This file is part of scripts_test library
scripts_test library is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>
This diff is collapsed.
Click to expand it.
new_project.sh
+
49
−
21
View file @
6af592ee
...
...
@@ -61,8 +61,36 @@ else
exit
fi
#create the branches directory
BRANCHES_DIR
=
"./branches"
if
[
-e
"
$BRANCHES_DIR
"
]
then
echo
"
$BRANCHES_DIR
directory already exists, skipping ..."
else
echo
"Creating
$BRANCHES_DIR
directory"
mkdir
$BRANCHES_DIR
fi
#create the tags directory
TAGS_DIR
=
"./tags"
if
[
-e
"
$TAGS_DIR
"
]
then
echo
"
$TAGS_DIR
directory already exists, skipping ..."
else
echo
"Creating
$TAGS_DIR
directory"
mkdir
$TAGS_DIR
fi
#create the tags directory
TRUNK_DIR
=
"./trunk"
if
[
-e
"
$TRUNK_DIR
"
]
then
echo
"
$TRUNK_DIR
directory already exists, skipping ..."
else
echo
"Creating
$TRUNK_DIR
directory"
mkdir
$TRUNK_DIR
fi
#create the bin directory
BIN_DIR
=
"./bin"
BIN_DIR
=
"./
trunk/
bin"
if
[
-e
"
$BIN_DIR
"
]
then
echo
"
$BIN_DIR
directory already exists, skipping ..."
...
...
@@ -71,7 +99,7 @@ else
mkdir
$BIN_DIR
fi
# create the lib directory
LIB_DIR
=
"./lib"
LIB_DIR
=
"./
trunk/
lib"
if
[
-e
"
$LIB_DIR
"
]
then
echo
"
$LIB_DIR
directory already exists, skipping ..."
...
...
@@ -80,7 +108,7 @@ else
mkdir
$LIB_DIR
fi
# create the src directory
SRC_DIR
=
"./src"
SRC_DIR
=
"./
trunk/
src"
if
[
-e
"
$SRC_DIR
"
]
then
echo
"
$SRC_DIR
directory already exists, skipping ..."
...
...
@@ -91,7 +119,7 @@ fi
#create the src/examples directory
if
[
$TYPE
=
driver
]
then
EXAMPLES_DIR
=
"./src/examples"
EXAMPLES_DIR
=
"./
trunk/
src/examples"
if
[
-e
"
$EXAMPLES_DIR
"
]
then
echo
"
$EXAMPLES_DIR
directory already exists, skipping ..."
...
...
@@ -102,7 +130,7 @@ then
fi
# create the build directory
BUILD_DIR
=
"./build"
BUILD_DIR
=
"./
trunk/
build"
if
[
-e
"
$BUILD_DIR
"
]
then
echo
"
$BUILD_DIR
directory already exists, skipping ..."
...
...
@@ -111,7 +139,7 @@ else
mkdir
$BUILD_DIR
fi
#create the doc directory
DOC_DIR
=
"./doc"
DOC_DIR
=
"./
trunk/
doc"
if
[
-e
"
$DOC_DIR
"
]
then
echo
"
$DOC_DIR
directory already exists, skipping ..."
...
...
@@ -120,7 +148,7 @@ else
mkdir
$DOC_DIR
fi
#create the doc/images directory
IMAGES_DIR
=
"./doc/images"
IMAGES_DIR
=
"./
trunk/
doc/images"
if
[
-e
"
$IMAGES_DIR
"
]
then
echo
"
$IMAGES_DIR
directory already exists, skipping ..."
...
...
@@ -129,7 +157,7 @@ else
mkdir
$IMAGES_DIR
fi
# create the doc/files directory
FILES_DIR
=
"./doc/files"
FILES_DIR
=
"./
trunk/
doc/files"
if
[
-e
"
$FILES_DIR
"
]
then
echo
"
$FILES_DIR
directory already exists, skipping ..."
...
...
@@ -146,19 +174,19 @@ sed 's/author_email/'$LOGNAME'/g' <ReadMe_template.txt >tmp1.txt
#set the author's name on the ReadMe.txt disclaimer file
sed
's/author_name/'
$LOGNAME
'/g'
<tmp1.txt
>
tmp2.txt
#Set the project name on the ReadMe.txt disclaimer file
sed
's/project_name/'
"
$PROJECT_NAME
"
'/g'
<tmp2.txt
>
ReadMe.txt
sed
's/project_name/'
"
$PROJECT_NAME
"
'/g'
<tmp2.txt
>
./trunk/
ReadMe.txt
rm
tmp1.txt
rm
tmp2.txt
rm
ReadMe_template.txt
#Set the project name on the CMakeLists.txt script file
sed
's/project_name/'
$NAME
'/g'
<CMakeLists_template.txt
>
CMakeLists.txt
sed
's/project_name/'
$NAME
'/g'
<CMakeLists_template.txt
>
./trunk/
CMakeLists.txt
rm
CMakeLists_template.txt
#Set the project name on the doxygen_project_name.dox sript file
sed
's/project_name/'
"
$PROJECT_NAME
"
'/g'
<doxygen_project_name_template.conf
>
doc/doxygen_project_name.conf
sed
's/project_name/'
"
$PROJECT_NAME
"
'/g'
<doxygen_project_name_template.conf
>
./trunk/
doc/doxygen_project_name.conf
rm
doxygen_project_name_template.conf
mv
doxygen_template.conf doc/doxygen.conf
mv
doxygen_template.conf
./trunk/
doc/doxygen.conf
#create the CMakeLists.txt script file
if
[
$TYPE
=
application
]
...
...
@@ -189,8 +217,8 @@ then
do
echo
"TARGET_LINK_LIBRARIES(
${
NAME
}
"
'${'
"
${
x
}
_LIBRARY"
'}'
")"
>>
CMakeLists.tmp
done
mv
CMakeLists.tmp ./src/CMakeLists.txt
mv
application_src_template.cpp ./src/
$NAME
.cpp
mv
CMakeLists.tmp ./
trunk/
src/CMakeLists.txt
mv
application_src_template.cpp ./
trunk/
src/
$NAME
.cpp
else
echo
"# driver source files"
>>
CMakeLists.tmp
echo
"SET(sources
${
NAME
}
.cpp)"
>>
CMakeLists.tmp
...
...
@@ -225,7 +253,7 @@ else
echo
"INSTALL(FILES "
'${'
"headers"
'}'
"DESTINATION include/iridrivers)
\n
"
>>
CMakeLists.tmp
echo
"INSTALL(FILES ../Find
$NAME
.cmake DESTINATION "
'${'
"CMAKE_ROOT"
'}'
"/Modules/)
\n
"
>>
CMakeLists.tmp
echo
"ADD_SUBDIRECTORY(examples)"
>>
CMakeLists.tmp
mv
CMakeLists.tmp ./src/CMakeLists.txt
mv
CMakeLists.tmp ./
trunk/
src/CMakeLists.txt
echo
"# create an example application"
>>
CMakeLists.tmp
echo
"ADD_EXECUTABLE(
${
NAME
}
_test
${
NAME
}
_test.cpp)"
>>
CMakeLists.tmp
...
...
@@ -235,29 +263,29 @@ else
do
echo
"TARGET_LINK_LIBRARIES(
${
NAME
}
_test "
'${'
"
${
x
}
_LIBRARY"
'}'
")"
>>
CMakeLists.tmp
done
mv
CMakeLists.tmp ./src/examples/CMakeLists.txt
mv
CMakeLists.tmp ./
trunk/
src/examples/CMakeLists.txt
sed
's/header_file/'
"
${
NAME
}
.h"
'/g'
<Findlib_template.cmake
>
tmp.cmake
sed
's/library_name/'
$NAME
'/g'
<tmp.cmake
>
Find
$NAME
.cmake
sed
's/library_name/'
$NAME
'/g'
<tmp.cmake
>
./trunk/
Find
$NAME
.cmake
rm
tmp.cmake
LIBRARY_NAME
=
$(
echo
$NAME
|
tr
'[:lower:]'
'[:upper:]'
)
Library_name
=
$(
echo
$NAME
|
sed
's/\([a-z]\)\([a-zA-Z0-9]*\)/\u\1\2/g'
)
sed
's/Library_name/'
$Library_name
'/g'
<driver_header_template.h
>
tmp.h
sed
's/LIBRARY_NAME/'
$LIBRARY_NAME
'/g'
<tmp.h
>
./src/
$NAME
.h
sed
's/LIBRARY_NAME/'
$LIBRARY_NAME
'/g'
<tmp.h
>
./
trunk/
src/
$NAME
.h
rm
tmp.h
sed
's/library_name/'
$NAME
'/g'
<driver_src_template.cpp
>
tmp.cpp
sed
's/Library_name/'
$Library_name
'/g'
<tmp.cpp
>
tmp2.cpp
sed
's/Library_name/'
$Library_name
'/g'
<tmp2.cpp
>
./src/
$NAME
.cpp
sed
's/Library_name/'
$Library_name
'/g'
<tmp2.cpp
>
./
trunk/
src/
$NAME
.cpp
rm
tmp.cpp
rm
tmp2.cpp
sed
's/library_name/'
$NAME
'/g'
<driver_example_src_template.cpp
>
./src/examples/
${
NAME
}
_test.cpp
sed
's/library_name/'
$NAME
'/g'
<driver_example_src_template.cpp
>
./
trunk/
src/examples/
${
NAME
}
_test.cpp
rm
application_src_template.cpp
fi
sed
's/library_name/'
$NAME
'/g'
<main_template.dox
>
tmp.dox
sed
's/project_name/'
"
$PROJECT_NAME
"
'/g'
<tmp.dox
>
doc/main.dox
sed
's/project_name/'
"
$PROJECT_NAME
"
'/g'
<tmp.dox
>
./trunk/
doc/main.dox
rm
driver_src_template.cpp
rm
driver_header_template.h
rm
driver_example_src_template.cpp
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment