In order to be able to work with the cgv framework, the following environment variables need to be set
Under windows the following six scripts - located in the root directory of the cgv framework - help to manage the necessary environment variables. Just double click them to execute them:
The framework uses the following platform independent third party libraries with completely free licenses
The following third party libraries are used and are typically preinstalled on most platforms
The cgv framework comes with a generator for visual studio solutions. It is based on cgv specific project files with the extension ".pj". All project files are located in the source directories. Currently, the following target platforms are supported
vs8, vs9, vs9e, vs10, vs12, vs14, vs141, and vs142 are the shortcuts for the target compiler / development environment. The environment variable CGV_COMPILER is to be set to this shortcut (with the script define_system_variables.bat)
After a project file has been created, one can simply transform it to the target platform by passing the file as command line argument to the batch-script "generate_makefile.bat"
located in CGV_DIR/bin
. This script only runs if the system variable CGV_COMPILER
is set.
@=
// previous line ensures that one can use the direct mode of ppp
//
// on entering this file, the following variables are predefined:
//
// - SYSTEM ... one of "windows" or "linux"
//
// - INPUT_DIR ... directory containing the currently processed project file
// - INPUT_PATH ... full path to the currently processed project file
// - INPUT_FILE ... name of the project file with extension
//
// - CGV_DIR ... from the obligatory environment variable CGV_DIR
// - CGV_INSTALL ... from environment variable CGV_INSTALL or if not defined
// defaults to CGV_DIR
// - CGV_BUILD ... from environment variable CGV_BUILD or if not defined
// defaults CGV_DIR/build
// - CGV_BUILD_DIR ... CGV_BUILD extended by compiler / ide specific sub directory
//
// - CGV_SUPPORT_DIR ... from environment variable CGV_SUPPORT_DIR or undefined if
// environment variable not defined
// - CGV_CHARSET ... from environment variable CGV_CHARSET or Unicode if
// environment variable is not defined. Use define_charset.bat to set environment variable
// - CGV_DATA ... from environment variable CGV_DATA or undefined if
// environment variable not defined
// - CGV_COMPILER ... from environment variable CGV_COMPILER or if not defined
// the defaults are "vs9" for "windows" and "gcc" for "linux"
// - CGV_COMPILER_VERSION ... 8, 9, 10, 12, 14 for the visual studio compilers
// "vs8", "vs9", "vs10", "vs12", "vs14"
// - CGV_IDE ... from environment variable CGV_IDE or from command line
// argument to ppp. Defaults to "visual studio" for vs compilers.
// For gcc also "eclipse" is allowed.
//
//========================================
// there is only one obligatory define:
//========================================
// the globally unique identifier of project
projectGUID = "E4E3902D-4700-4EE9-A64E-6BD4DD762E4D";
//====================================================================
// optional project definition
//====================================================================
//projectType can take the values
// - "library" ... library that can be compiled to static and shared version
// - "static_library" ... library that can be compiled only in static version
// - "shared_library" ... library that can be compiled only in shared version
// - "plugin" ... same as library but used as plugin to an application
// - "application" ... executable that can take arguments of the form "plugin:my_plugin"
// - "application_plugin" ... has the same configurations as a plugin plus two additional
// configurations called "Release Exe" and "Debug Exe" that generate an
// executable with all plugins statically linked in. The solution of an
// application_plugin uses the new configurations by default in the static
// solution configurations "Release" and "Debug". When an application_plugin
// is a dependent plugin of another application_plugin, the other solution uses
// the "Release" and "Debug" configurations of the application_plugin to link
// it into the other executable.
// - "tool" ... executable used during the build process like ppp
// - "test" ... plugin to the tester tool that provides boolean functions to test code
//if not specified, the projectType defaults to "plugin"
projectType = "library";
//name of project defaults to INPUT_NAME without extension
projectName = "my_project";
//list of individual source files that must be specified with full path
sourceFiles = [INPUT_DIR."my_source.cxx", INPUT_DIR."my_resource.png"];
//Specify a list of files that should be excluded from the project.
//The files must be specified by the same path as in the sourceDirs.
//If you specify INPUT_PATH, the "*.pj"-file is excluded from the project.
//
//If a file is listed in sourceFiles AND excludeSourceFiles it is INCLUDED.
excludeSourceFiles = [INPUT_PATH];
//list of directories that are scanned recursively for source files,
//defaults to empty list [] if sourceFiles are defined or to [INPUT_DIR] if
//sourceFiles is not defined
sourceDirs = [INPUT_DIR."/my_subdir"];
//specify subdirs in the source directories that should be excluded
excludeSourceDirs = [];
// define additional directories, in which project files are located.
// By default the directories CGV_DIR/cgv, CGV_DIR/apps and CGV_DIR/tool
// are project directories.
addProjectDirs = [
CGV_DIR."/3rd",
CGV_DIR."/plugins",
CGV_DIR."/libs",
env::CGV_SUPPORT_DIR."/plugins"];
//Define projects on which this project depends. All projects that are
//handled by the cgv-framework need to be added as addProjectDeps and
//not as addDependencies even if the resulting libraries are installed
//on the system. Please add the following libraries which are installed
//under linux to addProjectDeps:
//- zlib
//- libjpeg
//- libpng
//- libtiff
//- fltk
//- glew
//ppp will automatically classify them as dependencies under linux and
//as dependent projects under windows.
//
//If a plugin depends on an application, this application
//is used as executable for running and debugging the plugin.
//
//A "test" project is always dependent on the "tester" tool.
//Default dependencies are the tools used during the build process.
//The tool projects specified in the rules are added to the solution
//recursively.
addProjectDeps = ["cgv","cgv_viewer","fltk"];
// By default all projects on which this project depends are included to the workspace (solution).
// By setting "referenceDeps" to 0, only the workspace only contains this project. This feature is
// currently only supported for Visual Studio 2010 and works only in the shared version of application
// plugins as all registration code of statically compiled plugins is discarded when the plugin is not
// included in the solution.
referenceDeps = 0;
// add additional command line arguments. The most common usage of this
// is to add a default config file as in the given example
addCommandLineArguments = ['config:"'.INPUT_DIR.'/my_config.def"'];
// working directory in which the resulting program should be started
// this defaults to the platform specific default directories
workingDirectory = INPUT_DIR;
//additional include paths, which are appended to the default paths
//that include CGV_DIR and the list of paths defined in the INCLUDE
//environment variable that are automatically recognized by the compiler.
//To export include paths to projects that depend on this project, specify
//the include path in a list of two strings with the second entry equal to "all"
addIncDirs = [ INPUT_DIR."/my_include_subdir",
[ env::CGV_SUPPORT_DIR."/libs/capture", "all"]
];
//additional preprocessor definitions for all configurations. By default the
//following symbols are defined:
// - INPUT_DIR ... is defined to the input directory of the project
// - CGV_DIR ... is defined to the cgv directory active during compilation
//Both predefined paths come without enclosing double quotes. You can use the
//macro QUOTE_SYMBOL_VALUE defined in <cgv/defines/quote.h> to enclose the directories
//in double quotes.
//
//To export defines to projects that depend on this project, specify
//the define in a list of two strings with the second entry equal to "all"
addDefines = ["LOCAL_DEFINE", ["EXPORTED_DEFINE", "all"] ];
//additional preprocessor definitions for shared configurations
//To export shared defines to projects that depend on this project, specify
//the shared define in a list of two strings with the second entry equal to "all"
addSharedDefines = ["CGV_FORCE_EXPORT", ["FL_SHARED", "all"] ];
//additional preprocessor definitions for static configurations
//To export static defines to projects that depend on this project, specify
//the static define in a list of two strings with the second entry equal to "all"
addStaticDefines = [];
//additional library paths. The default library paths include
//CGV_DIR/lib and the path list defined in the environment
//variable LIBRARIES that is automatically recognized by the
//linker.
//To export lib dirs to projects that depend on this project, specify
//the lib dir in a list of two strings with the second entry equal to "all"
addLibDirs=["regular_lib_dir", ["exported_lib_dir", "all"] ];
//define a dependency by specification of a configuration specific library name either
//for current project only or to be exported to all dependent projects
addMapDeps = [
[ "testlib2", ["testlib1_s10","testlib1_sd10","testlib1_10","testlib1_d10"] ],
[ ["testlib1", ["testlib1_s10","testlib1_sd10","testlib1_10","testlib1_d10"] ], "all" ]
];
//external libraries on which the project depends. If one project
//depends on another, it is sufficient to add the project to the
//addProjectDeps list without entry in addDendencies. As library names
//are platform dependent, the platform and configuration specific
//library names of the following libraries are tabulated and translated
//from the given name correctly:
// - "opengl"
// - "glu"
// - "glew"
//In order to extend the translation mapping use the syntax addMapDeps variable
//
//The library paths to the corresponding libs need to be present
//in the environment variable LIBRARIES or need to be added with a
//addLibDirs declaration.
//
//To export dependencies to projects that depend on this project, specify
//the dependency in a list of two strings with the second entry equal to
// - "static" ... dependency exported only to static configurations
// - "shared" ... dependency exported only to shared configurations
// - "all" ... dependency exported to all configurations
addDependencies = ["opengl","glu","glew",["Vfw32", "static"] ];
// enable openmp support by the following line (0 is default value)
useOpenMP = 1;
// set the C++ language standard to "stdcpp14" or "stdcpp17" by the following line
cppLanguageStandard = "stdcpp17";
// overwrite windows character set used to encode string, which defaults to "Unicode" or if set env::CGV_CHARSET
charset = "MultiByte";
// overwrite windows subsystem used for linking of executables, which defaults to "Console"
subsystem = "Windows";
//set the name of the definition file, in which the symbols are
//defined that should be exported in a dll which has been implemented
//with extern "C" declarations. An example usage is in the project
//file for libtiff.
defFile = INPUT_PATH."/my_definition_file.def";
//DEPRECATED as the current version of the make file generation allows
//to generate rule files also via the addRules variable.
//
//Add the entries of the given list as rule files to the project.
//To export a rule file to projects that depend on this project, specify
//the rule file in a list of two strings with the second entry equal to "all"
addRuleFiles=[];
//Add new rules that specify how to handle extensions during makefile
//generation. Each rule is defined by a MAP with the following entries:
// - extensions : LIST of STRING ... list of extensions covered by this rule
// - folder : STRING ... project folder into which the corresponding
// files should be sorted
// - excl_cfg_idxs : LIST of INT ... list of configuration indices for which the rule
// should not be applied. The following indices can be used:
// 0 ... Release
// 1 ... Debug
// 2 ... Release Dll
// 3 ... Debug Dll
// 4 ... Release Exe (for application plugins)
// 5 ... Debug Exe (for application plugins)
// - tool : optional STRING ... project name of tool used to transform the file
// - rules : optional LIST of MAP ... list of rules to be applied to the source file in order
// to generate new source files. Each list entry of type
// MAP can have the following entries:
// - keep_extension : optional BOOL ... whether to keep extension of source file name
// - suffix : optional STRING ... suffix added to the source file name before adding the extension
// - extension : STRING ... extension of file generated with the tool from the source file
// - path : STRING ... path to the directory where the generated file can be found
// - command_line : LIST of STRING/INT ... list of components of the command line to be executed by
// the rule. First entry defines the command. Other entries of type
// STRING are directly used. Integer entries correspond to
// 0 ... input file
// 1 ... first rule target
// 2 ... second rule target
// 3 ... etc
addRules=[];