Actin®  Version 5.1.0
Software for Robotics Simulation and Control
Actin SDK Build System

Overview

The Actin SDK build system is built on a set of custom CMake macros. These macros are defined in the section below.

Example Library CMake Script

The following CMake script creates a shared and static library target from the project files.

1 ecProject(exampleIO)
2 
3 ecIncludeSolutions(
4  stableFoundation
5  foundation
6 )
7 
8 ecProjectLinkLibraries(
9  stableFoundation-xml
10  stableFoundation-xmlReaderWriter
11 )
12 
13 ecExternIncludeDirs(Boost)
14 
15 ecSourceFiles(ecExampleIO.cpp)
16 
17 ecLibrary(BOTH)

Example Executable CMake Script

The following CMake script example creates a target executable that links to Boost OpenGL and OpenSceneGraph for rendering.

1 ecProject(quickStartExample)
2 
3 ecIncludeSolutions(stableFoundation foundation actin render sensor)
4 
5 ecExternIncludeDirs(Boost GL osg)
6 
7 ecProjectLinkLibraries(actin-convertSimulation render-rendCore)
8 
9 ecSourceFiles(ecQuickStartExample.cpp ecQuickStartMain.cpp)
10 
11 ecExecutable()

Example Actin XML Object Plugin CMake Script

The following CMake script example creates a target libary and plugin for an EcXmlObject. The resulting backend plugin can be loaded dynamically into an XML container at runtime as the XML file is read in.

1 ecProject(exampleIoModule)
2 
3 ecIncludeSolutions(
4  stableFoundation
5  foundation
6  actin
7 )
8 
9 ecProjectLinkLibraries(
10  foundation-analogDigitalIoInterface
11  stableFoundation-xmlReaderWriter
12 )
13 
14 ecExternIncludeDirs(Boost)
15 
16 ecExternLinkLibraries(
17  boost_chrono
18 )
19 
20 ecSourceFiles(
21  ecExampleIoModule.cpp
22  ecExampleAnalogInputChannel.cpp
23  ecExampleAnalogOutputChannel.cpp
24  ecExampleDigitalInputChannel.cpp
25  ecExampleDigitalOutputChannel.cpp
26  ecExampleTokens.cpp
27 )
28 
29 ecXmlObjectLibraryAndPlugin(
30  EcExampleIoModule
31  EcExampleAnalogInputChannel
32  EcExampleAnalogOutputChannel
33  EcExampleDigitalInputChannel
34  EcExampleDigitalOutputChannel
35  )

Example Actin Plugin CMake Script

The following CMake script example creates an Actin plugin.

1 ecProject(examplePlugin)
2 
3 ecIncludeSolutions(stableFoundation foundation actin)
4 
5 ecExternIncludeDirs(Boost)
6 
7 ecProjectLinkLibraries(actin-plugins)
8 
9 ecSourceFiles(examplePlugin.cpp)
10 
11 ecPlugin(0)

CMake Build Macros Reference

The toolkits/scripts/ecBuildMacros.cmake file contains the following macros that can be used to build custom projects with the Actin SDK.

Name Description Order Arguments
ecAddDependency(ARGN...) Adds a list of dependencies that must be built prior to building the current project target. Dependencies between projects and third-party libraries should be specified with the ecProjectDepends, ecExternDepends, or ecExternDependsWithDebug macros. This macro call should follow either a ecLibrary or ecExecutable call. The list of dependencies
ecAddSubdirs(ARGN...) Adds a list of subdirectories to search for CMakeLists.txt files in. This macro call should follow either a ecRepository or ecSolution call. The list of subdirectories
ecBuild() This macro begins the build tree by searching through the repositories specified by EC_REPOSITORIES. NONE NONE
ecBuildLocation(location) This macro must specify the build location as either SOLUTION or REPOSITORY. It determines whether the executable will be built in the bin subdirectory of the solution directory or repository directory. If this macro is not called, the default location is SOLUTION. This macro should only be used for executable projects, and it may only be called between the ecProject and ecExecutable calls. location: Must be either SOLUTION or REPOSITORY
ecDebug(flag) This macro turns the debug flag on or off, which is useful for debugging the CMake scripts. This macro may only be called between the ecProject and ecExecutable or ecLibrary calls. flag: Should be either TRUE or FALSE
ecExecutable() This macro specifies that the current project should produce an executable target. This macro may only be called following a ecProject call. NONE
ecExternDepends(ARGN...) Adds a list of third-party library dependencies that are required in order to use the current project. This macro may only be called between the ecProject and ecExecutable or ecLibrary calls. ARGN: The list of third-party library dependencies
ecExternDependsWithDebug(ARGN...) Does the same thing as ecExternDepends; however, it adds "d" to the third-party library name when linking to debug executables.
ecIncludeDirs(ARGN...) Adds a list of include directories that are required in order to build the current project. This is typically used to set include paths to third-party libraries. This macro may only be called between the ecProject and ecExecutable or ecLibrary calls. ARGN: The list of include directories
ecIncludeSolutions(ARGN...) Adds a list of solutions that are required in order to build the current project. This macro may only be called between the ecProject and ecExecutable or ecLibrary calls. ARGN: The list of solution names
ecLibrary(TYPE) This macro specifies that the current project should produce a library target. This macro may only be called following a ecProject call. TYPE: SHARED for shared library, STATIC for static library, or BOTH for both shared and static (currently only creates the shared library)
ecLinkDirs(ARGN...) Adds a list of third-party library link directories that are required in order to use the current project. This should correlate to the third-party libraries specified in ecExternDepends or ecExternDependsWithDebug calls. This macro may only be called between the ecProject and ecExecutable or ecLibrary calls. ARGN: The list of third-party library link directories
ecLinkFlags(ARGN...) Adds a list of link flags to add when linking an executable. This macro may only be called between the ecProject and ecExecutable calls. ARGN: The list of link flags
ecMex() This macro specifies that the current project should produce a MATLAB mex file (plugin). This macro may only be called following a ecProject call. NONE
ecPlugin(version extension) This macro specifies that the current project should produce a plugin target. This macro may only be called following a ecProject) call. version: Specify the plugin version
extension: Optionally specify the plugin file extension
ecProject(name) Specifies the name of the current project. This macro should be called at the beginning of a project CMakeLists.txt file. name: The current project name
ecProjectDepends(ARGN...) Adds a list of project dependencies that are required in order to use the current project. Each listed project should be specified with their respective solution, followed by a dash and the project name. In pseudocode, this looks like "${SOLUTION_NAME}-${PROJECT_NAME}". This macro may only be called between the ecProject and ecExecutable or ecLibrary or ecPlugin calls. ARGN: The list of project dependencies
ecProjectLinkLibraries(ARGN...) Adds a list of project libraries that are required in order to build the current project. Each listed project should be specified with their respective solution, followed by a dash and the project name. In pseudocode, this looks like "${SOLUTION_NAME}-${PROJECT_NAME}". This macro may only be called between the ecProject and ecExecutable or ecLibrary or ecPlugin calls. ARGN: The list of project libraries
ecRemoveConfigVars(ARGN...) Removes configuration variables from being listed as user-configurable options. In other words, this forces the specified variables to be INTERNAL cache variables. ARGN: The list of configuration variables
ecRepository(name) Specifies the name of the current repository. This macro should be called at the beginning of a repository CMakeLists.txt file. name: The current repository name
ecSolution(name) Specifies the name of the current solution. This macro should be called at the beginning of a solution CMakeLists.txt file. name: The current solution name
ecSourceFiles(ARGN...) Adds a list of source files to the current project. This macro may only be called between the ecProject and ecExecutable or ecLibrary or ecPlugin calls. ARGN: The list of source files
ecSwigAddPaths(ARGN...) Adds a list of paths available to SWIG when generating the wrapper interface. This macro is meant to be used by bundles and may be called in any order. ARGN: The list of paths to add
ecSwigAlternateProjectImports(ARGN...) Provide an alternate list of SWIG import projects. SWIG imports are normally added via the ecProjectLinkLibraries macro. This macro call will overwrite the list. Each listed project should be specified with their respective solution, followed by a dash and the project name. In pseudocode, this looks like "${SOLUTION_NAME}-${PROJECT_NAME}". This macro may only be called following a ecProjectLinkLibraries call. ARGN: The list of alternate project imports
ecSwigExcludeTemplateType(ARGN...) Provide a list of template typedef's that should be excluded from the automatically generated SWIG interface file. This is used to eliminate SWIG build errors for template types that are exactly the same but differ only by typedef name. This macro may only be called between the ecProject and ecLibrary or ecPlugin calls. ARGN: The list of template typedef names to be excluded
ecSwigExtraHeaders(ARGN...) Provide a list of extra headers for SWIG that are required at compile time. This macro may only be called between the ecProject and ecLibrary or ecPlugin calls. ARGN: The list of extra headers that will be passed to the SWIG wrapped c++ code
ecSwigExtraProjectLinkLibraries(ARGN...) Provide a list of extra projects link libraries for SWIG import. SWIG imports are normally added via the ecProjectLinkLibraries macro. This macro call will add project libraries to the list. Each listed project should be specified with their respective solution, followed by a dash and the project name. In pseudocode, this looks like "${SOLUTION_NAME}-${PROJECT_NAME}". This macro may only be called between the ecProject and ecLibrary or ecPlugin calls. ARGN: The list of extra project libraries
ecSwigRemovePaths(ARGN...) Removes a list of paths from the paths available to SWIG when generating the wrapper interface. This macro is meant to be used by bundles and may be called in any order. ARGN: The list of paths to remove
ecSwigWrapHeaderFiles(ARGN...) Provide a list of project header files for wrapping by SWIG. Note that the order of the headers in the list is important because SWIG does not follow the includes in the header files. This macro may only be called between the ecProject and ecLibrary or ecPlugin calls. ARGN: The ordered list of header files that will be wrapped by SWIG
ecXmlObjectLibraryAndPlugin(ARGN...) Generates a library target and plugin target for backend XML Objects. These objects can be loaded into the XML containers at runtime and are used to extend backend functionality This macro may only be called following a ecProject call. ARGN: The list of EcXmlObject derived classes in this library

There are additional macros recently introduced in the build system for working with QML-enabled projects. For further information on those macros, please see the CMake Macros Page in Actin QML Development Reference.

CMake Variables

Basic Configuration Variables

Name Description Default Value Platforms
EC_BUILD_DEBUG Flag to determine whether or not to build the debug targets or the release targets. If this flag is set to YES, build commands will be generated for the debug targets. If this flag is set to NO, build commands will be generated for the release targets. NO Non-IDE build environments (command-line build environments)
EC_BUILD_REPO_<name> Flag to determine whether or not to build the <name> repository. A flag of this type will be generated for each repository listed in EC_REPOSITORIES ON All platforms
EC_BUILD_SHARED_LIBS Builds shared libraries if set to ON ON All platforms
EC_DDS_DIRS Specifies the DDS implementations build with (opensplice, ndds, opendds, coredx, etc.) ndds All platforms
EC_ENABLE_DOCS Flag that determines if the Doxygen documentation will be built or not OFF All platforms
EC_ENABLE_MATLAB Flag that determines if the MATLAB Wrapper should be built OFF All platforms
EC_ENABLE_MULTISAMPLING Determines if multisampling antialiasing is used for 3D rendering. Disable for low performance graphics cards. ON All platforms
EC_ENABLE_PYTHON Determines if the Python wrapper is built OFF All platforms
EC_EXTERNAL_DIR The location of the installed "external" directory for third party bundles. (ie: /home/user/Energid/Actin_4.1.12-20160526/external). path/to/installer/external All platforms
EC_REPOSITORIES The repositories to build (ie: toolkits; third_party). This is a semicolon delimited list of repository names. Where the repositories are defined by the ecRepository() CMake Macro. toolkits All platforms
Created by Energid Technologies www.energid.com
Copyright © 2016 Energid. All trademarks mentioned in this document are property of their respective owners.