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

Added the template file to create a new development project.

parents
No related tags found
No related merge requests found
# Pre-requisites about cmake itself
CMAKE_MINIMUM_REQUIRED(VERSION 2.4)
if(COMMAND cmake_policy)
cmake_policy(SET CMP0005 NEW)
cmake_policy(SET CMP0003 NEW)
endif(COMMAND cmake_policy)
# The project name and the type of project
PROJECT(project_name)
SET(EXECUTABLE_OUTPUT_PATH ${CMAKE_CURRENT_SOURCE_DIR}/bin)
SET(LIBRARY_OUTPUT_PATH ${CMAKE_CURRENT_SOURCE_DIR}/lib)
SET(CMAKE_INSTALL_PREFIX /usr/local)
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")
ADD_SUBDIRECTORY(src)
FIND_PACKAGE(Doxygen)
FIND_PATH(IRI_DOC_DIR doxygen.conf ${CMAKE_SOURCE_DIR}/doc/iri_doc/)
IF (IRI_DOC_DIR)
ADD_CUSTOM_TARGET (doc ${DOXYGEN_EXECUTABLE} ${CMAKE_SOURCE_DIR}/doc/iri_doc/doxygen.conf)
ELSE (IRI_DOC_DIR)
ADD_CUSTOM_TARGET (doc ${DOXYGEN_EXECUTABLE} ${CMAKE_SOURCE_DIR}/doc/doxygen.conf)
ENDIF (IRI_DOC_DIR)
ADD_CUSTOM_TARGET (distclean @echo cleaning cmake files)
IF (UNIX)
ADD_CUSTOM_COMMAND(
COMMENT "distribution clean"
COMMAND make ARGS clean
COMMAND rm ARGS -rf ${CMAKE_SOURCE_DIR}/build/*
TARGET distclean
)
ELSE(UNIX)
ADD_CUSTOM_COMMAND(
COMMENT "distclean only implemented in unix"
TARGET distclean
)
ENDIF(UNIX)
ADD_CUSTOM_TARGET (uninstall @echo uninstall package)
IF (UNIX)
ADD_CUSTOM_COMMAND(
COMMENT "uninstall package"
COMMAND xargs ARGS rm < install_manifest.txt
TARGET uninstall
)
ELSE(UNIX)
ADD_CUSTOM_COMMAND(
COMMENT "uninstall only implemented in unix"
TARGET uninstall
)
ENDIF(UNIX)
#edit the following line to add the librarie's header files
FIND_PATH(library_name_INCLUDE_DIR header_file /usr/include/iridrivers /usr/local/include/iridrivers)
FIND_LIBRARY(library_name_LIBRARY
NAMES library_name
PATHS /usr/lib /usr/local/lib /usr/local/lib/iridrivers)
IF (library_name_INCLUDE_DIR AND library_name_LIBRARY)
SET(library_name_FOUND TRUE)
ENDIF (library_name_INCLUDE_DIR AND library_name_LIBRARY)
IF (library_name_FOUND)
IF (NOT library_name_FIND_QUIETLY)
MESSAGE(STATUS "Found library_name: ${library_name_LIBRARY}")
ENDIF (NOT library_name_FIND_QUIETLY)
ELSE (library_name_FOUND)
IF (library_name_FIND_REQUIRED)
MESSAGE(FATAL_ERROR "Could not find library_name")
ENDIF (library_name_FIND_REQUIRED)
ENDIF (library_name_FOUND)
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/>
Copyright (C) 2009-2010 Institut de Robòtica i Informàtica Industrial, CSIC-UPC.
Author author_name (author_email@iri.upc.edu)
All rights reserved.
This file is part of project_name library
project_name 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/>
int main(int argc,char *argv[])
{
}
PROJECT_NAME = "project_name"
# Doxyfile 1.5.5
@INCLUDE_PATH = ../doc/
@INCLUDE = doxygen_project_name.conf
#---------------------------------------------------------------------------
# Project related configuration options
#---------------------------------------------------------------------------
DOXYFILE_ENCODING = UTF-8
PROJECT_NUMBER =
OUTPUT_DIRECTORY = ../doc
CREATE_SUBDIRS = NO
OUTPUT_LANGUAGE = English
BRIEF_MEMBER_DESC = YES
REPEAT_BRIEF = NO
ABBREVIATE_BRIEF =
ALWAYS_DETAILED_SEC = NO
INLINE_INHERITED_MEMB = NO
FULL_PATH_NAMES = YES
STRIP_FROM_PATH =
STRIP_FROM_INC_PATH =
SHORT_NAMES = NO
JAVADOC_AUTOBRIEF = NO
QT_AUTOBRIEF = NO
MULTILINE_CPP_IS_BRIEF = NO
DETAILS_AT_TOP = NO
INHERIT_DOCS = YES
SEPARATE_MEMBER_PAGES = NO
TAB_SIZE = 8
ALIASES =
OPTIMIZE_OUTPUT_FOR_C = YES
OPTIMIZE_OUTPUT_JAVA = NO
OPTIMIZE_FOR_FORTRAN = NO
OPTIMIZE_OUTPUT_VHDL = NO
BUILTIN_STL_SUPPORT = NO
CPP_CLI_SUPPORT = NO
SIP_SUPPORT = NO
DISTRIBUTE_GROUP_DOC = NO
SUBGROUPING = YES
TYPEDEF_HIDES_STRUCT = NO
#---------------------------------------------------------------------------
# Build related configuration options
#---------------------------------------------------------------------------
EXTRACT_ALL = NO
EXTRACT_PRIVATE = NO
EXTRACT_STATIC = NO
EXTRACT_LOCAL_CLASSES = YES
EXTRACT_LOCAL_METHODS = NO
EXTRACT_ANON_NSPACES = NO
HIDE_UNDOC_MEMBERS = NO
HIDE_UNDOC_CLASSES = NO
HIDE_FRIEND_COMPOUNDS = NO
HIDE_IN_BODY_DOCS = NO
INTERNAL_DOCS = NO
CASE_SENSE_NAMES = YES
HIDE_SCOPE_NAMES = NO
SHOW_INCLUDE_FILES = YES
INLINE_INFO = YES
SORT_MEMBER_DOCS = NO
SORT_BRIEF_DOCS = NO
SORT_GROUP_NAMES = NO
SORT_BY_SCOPE_NAME = NO
GENERATE_TODOLIST = YES
GENERATE_TESTLIST = YES
GENERATE_BUGLIST = YES
GENERATE_DEPRECATEDLIST= YES
ENABLED_SECTIONS =
MAX_INITIALIZER_LINES = 30
SHOW_USED_FILES = YES
SHOW_DIRECTORIES = YES
FILE_VERSION_FILTER =
#---------------------------------------------------------------------------
# configuration options related to warning and progress messages
#---------------------------------------------------------------------------
QUIET = YES
WARNINGS = YES
WARN_IF_UNDOCUMENTED = YES
WARN_IF_DOC_ERROR = YES
WARN_NO_PARAMDOC = NO
WARN_FORMAT = "$file:$line: $text"
WARN_LOGFILE =
#---------------------------------------------------------------------------
# configuration options related to the input files
#---------------------------------------------------------------------------
INPUT = ../src \
../doc/main.dox
INPUT_ENCODING = UTF-8
FILE_PATTERNS = *.c \
*.h \
*.cpp
RECURSIVE = YES
EXCLUDE =
EXCLUDE_SYMLINKS = NO
EXCLUDE_PATTERNS = *.tab.c \
*.tab.h \
lex* \
*glr.h \
*llr.h \
*glr.c \
*llr.c \
*general.h
EXCLUDE_SYMBOLS =
EXAMPLE_PATH = ../src/examples
EXAMPLE_PATTERNS =
EXAMPLE_RECURSIVE = NO
IMAGE_PATH = ../doc/images
INPUT_FILTER =
FILTER_PATTERNS =
FILTER_SOURCE_FILES = NO
#---------------------------------------------------------------------------
# configuration options related to source browsing
#---------------------------------------------------------------------------
SOURCE_BROWSER = YES
INLINE_SOURCES = NO
STRIP_CODE_COMMENTS = YES
REFERENCED_BY_RELATION = YES
REFERENCES_RELATION = YES
REFERENCES_LINK_SOURCE = YES
USE_HTAGS = NO
VERBATIM_HEADERS = YES
#---------------------------------------------------------------------------
# configuration options related to the alphabetical class index
#---------------------------------------------------------------------------
ALPHABETICAL_INDEX = YES
COLS_IN_ALPHA_INDEX = 5
IGNORE_PREFIX =
#---------------------------------------------------------------------------
# configuration options related to the HTML output
#---------------------------------------------------------------------------
GENERATE_HTML = YES
HTML_OUTPUT = html
HTML_FILE_EXTENSION = .html
HTML_HEADER =
HTML_FOOTER =
HTML_STYLESHEET =
HTML_ALIGN_MEMBERS = YES
GENERATE_HTMLHELP = NO
GENERATE_DOCSET = NO
DOCSET_FEEDNAME = "Doxygen generated docs"
DOCSET_BUNDLE_ID = org.doxygen.Project
HTML_DYNAMIC_SECTIONS = NO
CHM_FILE =
HHC_LOCATION =
GENERATE_CHI = NO
BINARY_TOC = NO
TOC_EXPAND = NO
DISABLE_INDEX = NO
ENUM_VALUES_PER_LINE = 4
GENERATE_TREEVIEW = NO
TREEVIEW_WIDTH = 250
#---------------------------------------------------------------------------
# configuration options related to the LaTeX output
#---------------------------------------------------------------------------
GENERATE_LATEX = NO
LATEX_OUTPUT = latex
LATEX_CMD_NAME = latex
MAKEINDEX_CMD_NAME = makeindex
COMPACT_LATEX = NO
PAPER_TYPE = a4
EXTRA_PACKAGES =
LATEX_HEADER =
PDF_HYPERLINKS = YES
USE_PDFLATEX = NO
LATEX_BATCHMODE = NO
LATEX_HIDE_INDICES = NO
#---------------------------------------------------------------------------
# configuration options related to the RTF output
#---------------------------------------------------------------------------
GENERATE_RTF = NO
RTF_OUTPUT = rtf
COMPACT_RTF = NO
RTF_HYPERLINKS = NO
RTF_STYLESHEET_FILE =
RTF_EXTENSIONS_FILE =
#---------------------------------------------------------------------------
# configuration options related to the man page output
#---------------------------------------------------------------------------
GENERATE_MAN = NO
MAN_OUTPUT = man
MAN_EXTENSION = .3
MAN_LINKS = NO
#---------------------------------------------------------------------------
# configuration options related to the XML output
#---------------------------------------------------------------------------
GENERATE_XML = NO
XML_OUTPUT = xml
XML_SCHEMA =
XML_DTD =
XML_PROGRAMLISTING = YES
#---------------------------------------------------------------------------
# configuration options for the AutoGen Definitions output
#---------------------------------------------------------------------------
GENERATE_AUTOGEN_DEF = NO
#---------------------------------------------------------------------------
# configuration options related to the Perl module output
#---------------------------------------------------------------------------
GENERATE_PERLMOD = NO
PERLMOD_LATEX = NO
PERLMOD_PRETTY = YES
PERLMOD_MAKEVAR_PREFIX =
#---------------------------------------------------------------------------
# Configuration options related to the preprocessor
#---------------------------------------------------------------------------
ENABLE_PREPROCESSING = YES
MACRO_EXPANSION = NO
EXPAND_ONLY_PREDEF = NO
SEARCH_INCLUDES = YES
INCLUDE_PATH =
INCLUDE_FILE_PATTERNS =
PREDEFINED = _USE_MPI=1
EXPAND_AS_DEFINED =
SKIP_FUNCTION_MACROS = YES
#---------------------------------------------------------------------------
# Configuration::additions related to external references
#---------------------------------------------------------------------------
TAGFILES =
GENERATE_TAGFILE =
ALLEXTERNALS = NO
EXTERNAL_GROUPS = YES
PERL_PATH = /usr/bin/perl
#---------------------------------------------------------------------------
# Configuration options related to the dot tool
#---------------------------------------------------------------------------
CLASS_DIAGRAMS = YES
MSCGEN_PATH =
HIDE_UNDOC_RELATIONS = YES
HAVE_DOT = YES
CLASS_GRAPH = YES
COLLABORATION_GRAPH = YES
GROUP_GRAPHS = YES
UML_LOOK = NO
TEMPLATE_RELATIONS = NO
INCLUDE_GRAPH = NO
INCLUDED_BY_GRAPH = NO
CALL_GRAPH = YES
CALLER_GRAPH = YES
GRAPHICAL_HIERARCHY = YES
DIRECTORY_GRAPH = NO
DOT_IMAGE_FORMAT = png
DOT_PATH =
DOTFILE_DIRS =
DOT_GRAPH_MAX_NODES = 50
MAX_DOT_GRAPH_DEPTH = 2
DOT_TRANSPARENT = YES
DOT_MULTI_TARGETS = NO
GENERATE_LEGEND = YES
DOT_CLEANUP = YES
#---------------------------------------------------------------------------
# Configuration::additions related to the search engine
#---------------------------------------------------------------------------
SEARCHENGINE = NO
#include "library_name.h"
int main(int argc, char *argv[])
{
}
#ifndef _LIBRARY_NAME_H
#define _LIBRARY_NAME_H
class CLibrary_name
{
public:
CLibrary_name();
~CLibrary_name();
};
#endif
#include "library_name.h"
CLibrary_name::CLibrary_name()
{
}
CLibrary_name::~CLibrary_name()
{
}
/*! \mainpage project_name
\section Introduction
\subsection Pre-Requisites
This package requires of the following libraries and packages
- <A href="http://www.cmake.org">cmake</A>, a cross-platform build system.
- <A href="http://www.doxygen.org">doxygen</a> and
<A href="http://www.graphviz.org">graphviz</a> to generate the documentation.
- stdc++,
.
Under linux all of these utilities are available in ready-to-use packages.
Under MacOS most of the packages are available via <a href="http://www.finkproject.org/">fink</a>. <br>
\subsection Compilation
Just download this package, uncompress it, and execute
- cd build
- cmake ..
.
to generate the makefile and then
- make
.
to obtain the shared library (in this case called <em>iriutils.so</em>) and
also all the example programs.
The <em>cmake</em> only need to be executed once (make will automatically call
<em>cmake</em> if you modify one of the <em>CMakeList.txt</em> files).
To generate this documentation type
- make doc
.
The files in the <em>build</em> directory are genetated by <em>cmake</em>
and <em>make</em> and can be safely removed.
After doing so you will need to call cmake manually again.
\subsection Configuration
The default build mode is DEBUG. That is, objects and executables
include debug information.
The RELEASE build mode optimizes for speed. To build in this mode
execute
- cmake .. -DCMAKE_BUILD_TYPE=RELEASE
.
The release mode will be kept until next time cmake is executed.
\subsection Installation
In order to be able to use the library, it it necessary to copy it into the system.
To do that, execute
- make install
.
as root and the shared libraries will be copied to <em>/usr/local/lib/iriutils</em> directory
and the header files will be copied to <em>/usr/local/include/iriutils</em> dierctory. At
this point, the library may be used by any user.
To remove the library from the system, exceute
- make uninstall
.
as root, and all the associated files will be removed from the system.
\section Customization
To build a new application using these library, first it is necessary to locate if the library
has been installed or not using the following command
- FIND_PACKAGE(library_name REQUIRED)
In the case that the package is present, it is necessary to add the header files directory to
the include directory path by using
- INCLUDE_DIRECTORIES(${library_name_INCLUDE_DIR})
Finally, it is also nevessary to link with the desired libraries by using the following command
- TARGET_LINK_LIBRARIES(<executable name> ${library_name_LIBRARY})
.
\section License
This package is licensed under a
<a href="http://www.gnu.org/licenses/lgpl.html">
LGPL 3.0 License</a>.
\section Disclaimer
This 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/>.
*/
#! /bin/sh
DEP=
TYPE=
PROJECT_NAME=
NAME=
SVN=0
IRI_DOC=0
while getopts “t:p:n:d:si” OPTION
do
case $OPTION in
t)
TYPE=$OPTARG
;;
p)
PROJECT_NAME=$OPTARG
;;
n)
NAME=$OPTARG
;;
d)
DEP=$OPTARG
;;
s)
SVN=1
;;
i)
IRI_DOC=1
;;
?)
echo invalid argument $OPTION
exit
;;
esac
done
case $TYPE in
application) echo Generating an application project ...
;;
driver) echo Generating a driver project ...
;;
*) echo Unknown project type "$TYPE"
exit
;;
esac
if [ "$PROJECT_NAME" ]
then
echo "Generating folder structure for project $PROJECT_NAME ..."
else
echo "No project name provided, aborting ..."
exit
fi
if [ $NAME ]
then
echo "Using library name $NAME ..."
else
echo "No library name provided, aborting ..."
exit
fi
#create the bin directory
BIN_DIR="./bin"
if [ -e "$BIN_DIR" ]
then
echo "$BIN_DIR directory already exists, skipping ..."
else
echo "Creating $BIN_DIR directory"
mkdir $BIN_DIR
fi
# create the lib directory
LIB_DIR="./lib"
if [ -e "$LIB_DIR" ]
then
echo "$LIB_DIR directory already exists, skipping ..."
else
echo "Creating $LIB_DIR directory"
mkdir $LIB_DIR
fi
# create the src directory
SRC_DIR="./src"
if [ -e "$SRC_DIR" ]
then
echo "$SRC_DIR directory already exists, skipping ..."
else
echo "Creating $SRC_DIR directory"
mkdir $SRC_DIR
fi
#create the src/examples directory
if [ $TYPE = driver ]
then
EXAMPLES_DIR="./src/examples"
if [ -e "$EXAMPLES_DIR" ]
then
echo "$EXAMPLES_DIR directory already exists, skipping ..."
else
echo "Creating $EXAMPLES_DIR directory"
mkdir $EXAMPLES_DIR
fi
fi
# create the build directory
BUILD_DIR="./build"
if [ -e "$BUILD_DIR" ]
then
echo "$BUILD_DIR directory already exists, skipping ..."
else
echo "Creating $BUILD_DIR directory"
mkdir $BUILD_DIR
fi
#create the doc directory
DOC_DIR="./doc"
if [ -e "$DOC_DIR" ]
then
echo "$DOC_DIR directory already exists, skipping ..."
else
echo "Creating $DOC_DIR directory"
mkdir $DOC_DIR
fi
#create the doc/images directory
IMAGES_DIR="./doc/images"
if [ -e "$IMAGES_DIR" ]
then
echo "$IMAGES_DIR directory already exists, skipping ..."
else
echo "Creating $IMAGES_DIR directory"
mkdir $IMAGES_DIR
fi
# create the doc/files directory
FILES_DIR="./doc/files"
if [ -e "$FILES_DIR" ]
then
echo "$FILES_DIR directory already exists, skipping ..."
else
echo "Creating $FILES_DIR directory"
mkdir $FILES_DIR
fi
#parse the dependencies and create the dependencies file
arr=$(echo $DEP | tr "," "\n")
#Set the author's email on the ReadMe.txt disclaimer file
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
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
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
rm doxygen_project_name_template.conf
mv doxygen_template.conf doc/doxygen.conf
#create the CMakeLists.txt script file
if [ $TYPE = application ]
then
echo "# locate the necessary dependencies" >> CMakeLists.tmp
for x in $arr
do
echo "FIND_PACKAGE($x REQUIRED)" >> CMakeLists.tmp
done
echo "\n" >> CMakeLists.tmp
echo "# add the necessary include directories" >> CMakeLists.tmp
echo "INCLUDE_DIRECTORIES(.)" >> CMakeLists.tmp
for x in $arr
do
echo "INCLUDE_DIRECTORIES("'${'"${x}_INCLUDE_DIR"'}'")" >> CMakeLists.tmp
done
echo "\n" >> CMakeLists.tmp
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 "\n" >> CMakeLists.tmp
echo "# create the executable file" >> CMakeLists.tmp
echo "ADD_EXECUTABLE(${NAME} "'${'"sources"'}'")" >> CMakeLists.tmp
echo "\n" >> CMakeLists.tmp
echo "# link necessary libraries" >> CMakeLists.tmp
for x in $arr
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
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 "\n" >> CMakeLists.tmp
echo "# locate the necessary dependencies" >> CMakeLists.tmp
for x in $arr
do
echo "FIND_PACKAGE($x REQUIRED)" >> CMakeLists.tmp
done
echo "\n" >> CMakeLists.tmp
echo "# add the necessary include directories" >> CMakeLists.tmp
echo "INCLUDE_DIRECTORIES(.)" >> CMakeLists.tmp
for x in $arr
do
echo "INCLUDE_DIRECTORIES("'${'"${x}_INCLUDE_DIR"'}'")" >> CMakeLists.tmp
done
echo "\n" >> CMakeLists.tmp
echo "# create the shared library" >> CMakeLists.tmp
echo "ADD_LIBRARY(${NAME} SHARED "'${'"sources"'}'")" >> CMakeLists.tmp
echo "\n" >> CMakeLists.tmp
echo "# link necessary libraries" >> CMakeLists.tmp
for x in $arr
do
echo "TARGET_LINK_LIBRARIES(${NAME} "'${'"${x}_LIBRARY"'}'")" >> CMakeLists.tmp
done
echo "INSTALL(TARGETS $NAME" >> CMakeLists.tmp
echo " RUNTIME DESTINATION bin" >> CMakeLists.tmp
echo " LIBRARY DESTINATION lib/iridrivers" >> CMakeLists.tmp
echo " ARCHIVE DESTINATION lib/iridrivers)\n" >> CMakeLists.tmp
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
echo "# create an example application" >> CMakeLists.tmp
echo "ADD_EXECUTABLE(${NAME}_test ${NAME}_test.cpp)" >> CMakeLists.tmp
echo "# link necessary libraries" >> CMakeLists.tmp
echo "TARGET_LINK_LIBRARIES(${NAME}_test $NAME)" >> CMakeLists.tmp
for x in $arr
do
echo "TARGET_LINK_LIBRARIES(${NAME}_test "'${'"${x}_LIBRARY"'}'")" >> CMakeLists.tmp
done
mv CMakeLists.tmp ./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
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
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
rm tmp.cpp
rm tmp2.cpp
sed 's/library_name/'$NAME'/g' <driver_example_src_template.cpp >./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
rm driver_src_template.cpp
rm driver_header_template.h
rm driver_example_src_template.cpp
rm Findlib_template.cmake
rm main_template.dox
rm tmp.dox
rm template.tar.gz
rm new_project.sh
File added
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