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

Added an include folder for the header files.

parent d38837b4
No related branches found
No related tags found
No related merge requests found
......@@ -83,6 +83,7 @@ WARN_LOGFILE =
# configuration options related to the input files
#---------------------------------------------------------------------------
INPUT = ../src \
../include \
../ReadMe.md
INPUT_ENCODING = UTF-8
FILE_PATTERNS = *.c \
......
......@@ -81,6 +81,15 @@ else
echo "Creating $SRC_DIR directory"
mkdir $SRC_DIR
fi
# create the include directory
INCLUDE_DIR="./include"
if [ -e "$INCLUDE_DIR" ]
then
echo "$INCLUDE_DIR directory already exists, skipping ..."
else
echo "Creating $INCLUDE_DIR directory"
mkdir $INCLUDE_DIR
fi
#create the src/examples directory
if [ $TYPE = library ]
then
......@@ -163,7 +172,7 @@ then
echo "FIND_PACKAGE($x REQUIRED)" >> CMakeLists.tmp
done
echo "# add the necessary include directories" >> CMakeLists.tmp
echo "INCLUDE_DIRECTORIES(.)" >> CMakeLists.tmp
echo "INCLUDE_DIRECTORIES(../include)" >> CMakeLists.tmp
for x in $arr
do
echo "INCLUDE_DIRECTORIES("'${'"${x}_INCLUDE_DIR"'}'")" >> CMakeLists.tmp
......@@ -171,7 +180,7 @@ then
echo "# application source files" >> CMakeLists.tmp
echo "SET(sources ${NAME}.cpp)" >> CMakeLists.tmp
echo "# application header files" >> CMakeLists.tmp
echo "SET(headers ${NAME}.h)" >> CMakeLists.tmp
echo "SET(headers ../include/${NAME}.h)" >> CMakeLists.tmp
echo "# create the executable file" >> CMakeLists.tmp
echo "ADD_EXECUTABLE(${NAME} "'${'"sources"'}'")" >> CMakeLists.tmp
echo "# link necessary libraries" >> CMakeLists.tmp
......@@ -185,14 +194,14 @@ else
echo "# driver source files" >> CMakeLists.tmp
echo "SET(sources ${NAME}.cpp)" >> CMakeLists.tmp
echo "# application header files" >> CMakeLists.tmp
echo "SET(headers ${NAME}.h)" >> CMakeLists.tmp
echo "SET(headers ../include/${NAME}.h)" >> CMakeLists.tmp
echo "# locate the necessary dependencies" >> CMakeLists.tmp
for x in $arr
do
echo "FIND_PACKAGE($x REQUIRED)" >> CMakeLists.tmp
done
echo "# add the necessary include directories" >> CMakeLists.tmp
echo "INCLUDE_DIRECTORIES(.)" >> CMakeLists.tmp
echo "INCLUDE_DIRECTORIES(../include)" >> CMakeLists.tmp
for x in $arr
do
echo "INCLUDE_DIRECTORIES("'${'"${x}_INCLUDE_DIR"'}'")" >> CMakeLists.tmp
......@@ -230,7 +239,7 @@ else
LIBRARY_NAME=$(echo $NAME | tr '[:lower:]' '[:upper:]')
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' <tmp.h >./src/$NAME.h
sed 's/LIBRARY_NAME/'$LIBRARY_NAME'/g' <tmp.h >./include/$NAME.h
rm tmp.h
sed 's/library_name/'$NAME'/g' <driver_src_template.cpp >tmp.cpp
......
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