Skip to content
Snippets Groups Projects
Commit f94fffac authored by Sergi Hernandez's avatar Sergi Hernandez
Browse files

Solved a problem with the project name letter case. Now, the project name is...

Solved a problem with the project name letter case. Now, the project name is transformed to lower case and then manipulated.
parent f4ef08b8
No related branches found
No related tags found
No related merge requests found
...@@ -19,7 +19,7 @@ do ...@@ -19,7 +19,7 @@ do
n) n)
NAME=$OPTARG NAME=$OPTARG
;; ;;
d) d)
DEP=$OPTARG DEP=$OPTARG
;; ;;
s) s)
...@@ -55,6 +55,7 @@ fi ...@@ -55,6 +55,7 @@ fi
if [ $NAME ] if [ $NAME ]
then then
NAME=$(echo $NAME | tr '[:upper:]' '[:lower:]')
echo "Using library name $NAME ..." echo "Using library name $NAME ..."
else else
echo "No library name provided, aborting ..." echo "No library name provided, aborting ..."
...@@ -196,22 +197,18 @@ then ...@@ -196,22 +197,18 @@ then
do do
echo "FIND_PACKAGE($x REQUIRED)" >> CMakeLists.tmp echo "FIND_PACKAGE($x REQUIRED)" >> CMakeLists.tmp
done done
echo "\n" >> CMakeLists.tmp
echo "# add the necessary include directories" >> CMakeLists.tmp echo "# add the necessary include directories" >> CMakeLists.tmp
echo "INCLUDE_DIRECTORIES(.)" >> CMakeLists.tmp echo "INCLUDE_DIRECTORIES(.)" >> CMakeLists.tmp
for x in $arr for x in $arr
do do
echo "INCLUDE_DIRECTORIES("'${'"${x}_INCLUDE_DIR"'}'")" >> CMakeLists.tmp echo "INCLUDE_DIRECTORIES("'${'"${x}_INCLUDE_DIR"'}'")" >> CMakeLists.tmp
done done
echo "\n" >> CMakeLists.tmp
echo "# application source files" >> CMakeLists.tmp echo "# application source files" >> CMakeLists.tmp
echo "SET(sources ${NAME}.cpp)" >> CMakeLists.tmp echo "SET(sources ${NAME}.cpp)" >> CMakeLists.tmp
echo "# application header files" >> CMakeLists.tmp echo "# application header files" >> CMakeLists.tmp
echo "SET(headers ${NAME}.h)" >> CMakeLists.tmp echo "SET(headers ${NAME}.h)" >> CMakeLists.tmp
echo "\n" >> CMakeLists.tmp
echo "# create the executable file" >> CMakeLists.tmp echo "# create the executable file" >> CMakeLists.tmp
echo "ADD_EXECUTABLE(${NAME} "'${'"sources"'}'")" >> CMakeLists.tmp echo "ADD_EXECUTABLE(${NAME} "'${'"sources"'}'")" >> CMakeLists.tmp
echo "\n" >> CMakeLists.tmp
echo "# link necessary libraries" >> CMakeLists.tmp echo "# link necessary libraries" >> CMakeLists.tmp
for x in $arr for x in $arr
do do
...@@ -224,23 +221,19 @@ else ...@@ -224,23 +221,19 @@ else
echo "SET(sources ${NAME}.cpp)" >> CMakeLists.tmp echo "SET(sources ${NAME}.cpp)" >> CMakeLists.tmp
echo "# application header files" >> CMakeLists.tmp echo "# application header files" >> CMakeLists.tmp
echo "SET(headers ${NAME}.h)" >> CMakeLists.tmp echo "SET(headers ${NAME}.h)" >> CMakeLists.tmp
echo "\n" >> CMakeLists.tmp
echo "# locate the necessary dependencies" >> CMakeLists.tmp echo "# locate the necessary dependencies" >> CMakeLists.tmp
for x in $arr for x in $arr
do do
echo "FIND_PACKAGE($x REQUIRED)" >> CMakeLists.tmp echo "FIND_PACKAGE($x REQUIRED)" >> CMakeLists.tmp
done done
echo "\n" >> CMakeLists.tmp
echo "# add the necessary include directories" >> CMakeLists.tmp echo "# add the necessary include directories" >> CMakeLists.tmp
echo "INCLUDE_DIRECTORIES(.)" >> CMakeLists.tmp echo "INCLUDE_DIRECTORIES(.)" >> CMakeLists.tmp
for x in $arr for x in $arr
do do
echo "INCLUDE_DIRECTORIES("'${'"${x}_INCLUDE_DIR"'}'")" >> CMakeLists.tmp echo "INCLUDE_DIRECTORIES("'${'"${x}_INCLUDE_DIR"'}'")" >> CMakeLists.tmp
done done
echo "\n" >> CMakeLists.tmp
echo "# create the shared library" >> CMakeLists.tmp echo "# create the shared library" >> CMakeLists.tmp
echo "ADD_LIBRARY(${NAME} SHARED "'${'"sources"'}'")" >> CMakeLists.tmp echo "ADD_LIBRARY(${NAME} SHARED "'${'"sources"'}'")" >> CMakeLists.tmp
echo "\n" >> CMakeLists.tmp
echo "# link necessary libraries" >> CMakeLists.tmp echo "# link necessary libraries" >> CMakeLists.tmp
for x in $arr for x in $arr
do do
...@@ -249,9 +242,9 @@ else ...@@ -249,9 +242,9 @@ else
echo "INSTALL(TARGETS $NAME" >> CMakeLists.tmp echo "INSTALL(TARGETS $NAME" >> CMakeLists.tmp
echo " RUNTIME DESTINATION bin" >> CMakeLists.tmp echo " RUNTIME DESTINATION bin" >> CMakeLists.tmp
echo " LIBRARY DESTINATION lib/iridrivers" >> CMakeLists.tmp echo " LIBRARY DESTINATION lib/iridrivers" >> CMakeLists.tmp
echo " ARCHIVE DESTINATION lib/iridrivers)\n" >> CMakeLists.tmp echo " ARCHIVE DESTINATION lib/iridrivers)" >> CMakeLists.tmp
echo "INSTALL(FILES "'${'"headers"'}' "DESTINATION include/iridrivers)\n" >> CMakeLists.tmp echo "INSTALL(FILES "'${'"headers"'}' "DESTINATION include/iridrivers)" >> CMakeLists.tmp
echo "INSTALL(FILES ../Find$NAME.cmake DESTINATION "'${'"CMAKE_ROOT"'}'"/Modules/)\n" >> CMakeLists.tmp echo "INSTALL(FILES ../Find$NAME.cmake DESTINATION "'${'"CMAKE_ROOT"'}'"/Modules/)" >> CMakeLists.tmp
echo "ADD_SUBDIRECTORY(examples)" >> CMakeLists.tmp echo "ADD_SUBDIRECTORY(examples)" >> CMakeLists.tmp
mv CMakeLists.tmp ./trunk/src/CMakeLists.txt mv CMakeLists.tmp ./trunk/src/CMakeLists.txt
...@@ -270,7 +263,7 @@ else ...@@ -270,7 +263,7 @@ else
rm tmp.cmake rm tmp.cmake
LIBRARY_NAME=$(echo $NAME | tr '[:lower:]' '[:upper:]') LIBRARY_NAME=$(echo $NAME | tr '[:lower:]' '[:upper:]')
Library_name=$(echo $NAME | sed 's/\([a-z]\)\([a-zA-Z0-9]*\)/\u\1\2/g') Library_name=$(echo $NAME | sed 's/\([a-zA-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' <driver_header_template.h >tmp.h
sed 's/LIBRARY_NAME/'$LIBRARY_NAME'/g' <tmp.h >./trunk/src/$NAME.h sed 's/LIBRARY_NAME/'$LIBRARY_NAME'/g' <tmp.h >./trunk/src/$NAME.h
rm tmp.h rm tmp.h
......
No preview for this file type
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment