-
Notifications
You must be signed in to change notification settings - Fork 0
/
README
202 lines (175 loc) · 7.97 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
CPP PROJECT TEMPLATE
--------------------
This is 'c++ project template' project, which provides basic layout of c++
project. It provides configuration properties and build properties, which can
be change in 'config_properties.m4' and 'build_properties.mk' files
respectively.
Configuration Properties -
--------------------------
Global Project name string
PROJECT_NAME='[projectname]'
Global Project name string in caps
PROJECT_NAME_CAPS='[PROJECTNAME]'
Current directory
abs_current_dir=`pwd`
Project sources top directory. This is the reference directory for all file
searches while building, installing and packaging.
abs_project_dir=`(cd $srcdir && pwd)`
Project build top directory. This is the reference directory for all build
directories.
abs_build_dir=$abs_current_dir/build
Project install top directory. If $prefix was not set while configuration. It
would be "/usr/local/$PROJECT_NAME" default.
abs_install_dir=$prefix
Global Project version number.
major.minor.bug-fixes.port<release type>
major - new feature may be not compatible with older version
minor - new feature, bug fixes, fully compatible with older version
bug-fixes - only bug fixes.
port - platform type 0 - linux64
release-type - a - alpha, b - beta, g - gama
PROJECT_VERSION='1.0.0.0b'
Project root directory identification file. This file identify that we are
running configuration in the right directory.
PROJECT_IDFILE='ABOUT_[PROJECTNAME]'
Project license string.
PROJECT_LICENSE='TODO - Add project license.'
Project distributable file name.
PROJECT_PACKAGE_NAME="$PROJECT_NAME"-"$PROJECT_VERSION"
Project configuration header file which has definition of all the variables
and can be included in project and used.
PROJECT_CONFIG_HEADERS="$abs_project_dir/include/config_options.h"
Project configuration file, If file name is XYZ here you should have XYZ.in
in your source directory. autoconf parse XYZ.in file, replace all variable
of type @VARIABLE@ and generate XYZ file.
PROJECT_CONFIG_FILES='Makefile'
Command line settings for optional features.
AC_ARG_ENABLE([cpplogger-vvlogging], [AS_HELP_STRING(
[--enable-cpplogger-vvlogging], \
[enable cpplogger very verbose logging. logs info and debug messages also.])],\
[AS_VAR_APPEND([CXXFLAGS],[" -DCPPLOGGER_VVLOGGING"])], [])
Command line settings for optional packages.
AC_ARG_WITH([input-value], [AS_HELP_STRING([--with-optional-package], \
[with or without optional package setting.])], \
[AS_VAR_SET([your_variable_name], [$with_input_value])], \
[AS_VAR_SET([your_variable_name], [no])])
Build Properties
----------------
# Important Points -
# 1. All directories paths are relative.
# 2. Files will be search within the directory and all its subdirectories
# recursively.
# 3. If any new directory created or existing directory modified, make sure
# you update corresponding variable entry.
# 4. For mutliple directories, directories should be separated by space char.
# 5. Directory should not have '/' char at end.
#############################################################################
# Project source directories structure.
# Relative path to - $abs_project_dir (top directory of project root).
#
# PROJECT_SRC_DIRS - all source files inside these directories will compile
# and generate object file with the name <filename>.o
#
# PROJECT_HEADERS_DIRS - these directories will be add in header files
# serach path while compiling source code.
#
# PROJECT_EXEC_SRC_FILES - these files has the main method and will generate
# executable files.
#
# PROJECT_API_HEADERS_DIRS - all headers files inside these directories
# will be installed, installation path will be relative to the given
# path.
#
# PROJECT_EXTRA_FILES_DIRS - all files inside these directories will
# be install.
#
# PROJECT_DIST_DIRS - directories which needs to be part of distributable.
# file searches are recursive in these directories.
#############################################################################
PROJECT_SRC_DIRS = src
PROJECT_HEADERS_DIRS = include
PROJECT_EXEC_SRC_FILES =
PROJECT_API_HEADERS_DIRS = include
PROJECT_EXTRA_FILES_DIRS = config logs
PROJECT_DIST_DIRS = config examples include src tests logs external \
ABOUT_PROJECTNAME acinclude.m4 build_properties.mk config_properties.m4 \
configure configure.ac DEV-README INSTALL Makefile.in QUESTION_ANSWER README \
TODO
#############################################################################
# Project tests source directories structure.
# Relative path to - $abs_project_dir (top directory of project root).
#
# PROJECT_TESTS_SRC_DIRS - all tests source files inside these directories
# will be compile and generate object file with the name <filename>.o
#
# PROJECT_TESTS_HEADERS_DIRS - these directories will be add in header files
# serach path while compiling tests source code.
#
# PROJECT_TESTS_EXEC_SRC_FILES - these files has the main method and will
# generate executable files.
#
# PROJECT_TESTS_EXTRA_FILES_DIRS - all files inside these directories will
# be used while running testcases.
#############################################################################
PROJECT_TESTS_SRC_DIRS = tests/src
PROJECT_TESTS_HEADERS_DIRS =
PROJECT_TESTS_EXEC_SRC_FILES = tests/main_test.cpp
PROJECT_TESTS_EXTRA_FILES_DIRS = tests/config
#############################################################################
# Project build directories structure.
# Relative path to - $abs_build_dir (top directory of project build)/build.
#############################################################################
PROJECT_BUILD_OBJS_DIR = objs
PROJECT_BUILD_LIBS_DIR = libs
PROJECT_BUILD_BIN_DIR = bin
#############################################################################
# Project tests build directories structure.
# Relative path to - $abs_build_dir (top directory of project build)/build.
#############################################################################
PROJECT_TESTS_BUILD_OBJS_DIR = tests/objs
PROJECT_TESTS_BUILD_LIBS_DIR = tests/libs
PROJECT_TESTS_BUILD_BIN_DIR = tests/bin
PROJECT_TESTS_BUILD_EXTRA_FILES_DIR = tests/config
#############################################################################
# Project install directories structure.
# Relative path to - $abs_install_dir (top directory of project install).
#############################################################################
PROJECT_INSTALL_BIN_DIR = bin
PROJECT_INSTALL_LIBS_DIR = lib
PROJECT_INSTALL_API_HEADERS_DIR = .
PROJECT_INSTALL_EXTRA_FILES_DIR = share/$(PROJECT_NAME)
#############################################################################
# Project compilation flags. These flags have some default entries if you need
# to customize more, make sure you update entries here.
# Default entries are -
# CPPFLAGS - -fPIC -Wall -Wextra
# CXXFLAGS - -std=c++11
# LIBS -
# INCLUDE_FLAGS - all project headers top directories entries
# LDFLAGS -
#############################################################################
#EXTRA_INCLUDE_FLAGS := -I/home/gagoel/gagoel_ggpw/tools/include
#EXTRA_CPPFLAGS :=
#EXTRA_CXXFLAGS :=
#EXTRA_LDFLAGS := -L/home/gagoel/gagoel_ggpw/tools/lib
#EXTRA_LIBS := -lcurl -lcpplogger -ldl
#EXTRA_TESTS_LIBS := /home/gagoel/gagoel_ggpw/tools/lib/gtest.a
#EXTRA_LD_LIBRARY_PATH := /home/gagoel/gagoel_ggpw/tools/lib
EXTRA_INCLUDE_FLAGS :=
EXTRA_CPPFLAGS :=
EXTRA_CXXFLAGS :=
EXTRA_LDFLAGS :=
EXTRA_LIBS := -lcurl -ldl
EXTRA_LD_LIBRARY_PATH :=
##############################################################################
# External packages configuration variables.
##############################################################################
GTEST_ROOT_DIR := $(abs_project_dir)/external/gtest
EXTRA_TESTS_IFLAGS := -I$(GTEST_ROOT_DIR)/include -I$(GTEST_ROOT_DIR)/include/gtest
EXTRA_TESTS_LIBS := $(GTEST_ROOT_DIR)/build/objs/gtest-all.o
CPPLOGGER_ROOT_DIR := $(abs_project_dir)/external/cpplogger
CPPLOGGER_INSTALL_ROOT_DIR := $(CPPLOGGER_ROOT_DIR)/install
EXTRA_LIBS += -lcpplogger
EXTRA_LDFLAGS += -L$(CPPLOGGER_INSTALL_ROOT_DIR)/lib
EXTRA_LD_LIBRARY_PATH += $(CPPLOGGER_INSTALL_ROOT_DIR)/lib
EXTRA_INCLUDE_FLAGS += -I$(CPPLOGGER_INSTALL_ROOT_DIR)/include