2013-10-04 03:51:56 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								project ( GTSAM  CXX  C ) 
 
							 
						 
					
						
							
								
									
										
										
										
											2019-01-15 07:38:14 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								cmake_minimum_required ( VERSION  3.0 ) 
 
							 
						 
					
						
							
								
									
										
										
										
											2013-10-04 03:51:56 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2014-10-23 11:27:01 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								# new feature to Cmake Version > 2.8.12
 
							 
						 
					
						
							
								
									
										
										
										
											2014-10-23 11:42:35 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								# Mac ONLY. Define Relative Path on Mac OS
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								if ( NOT  DEFINED  CMAKE_MACOSX_RPATH ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								  set ( CMAKE_MACOSX_RPATH  0 ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								endif ( ) 
 
							 
						 
					
						
							
								
									
										
										
										
											2014-10-23 11:27:01 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2013-10-04 03:51:56 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								# Set the version number for the library
 
							 
						 
					
						
							
								
									
										
										
										
											2014-11-14 09:27:04 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								set  ( GTSAM_VERSION_MAJOR  4 ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								set  ( GTSAM_VERSION_MINOR  0 ) 
 
							 
						 
					
						
							
								
									
										
										
										
											2013-10-04 03:51:56 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								set  ( GTSAM_VERSION_PATCH  0 ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								math  ( EXPR  GTSAM_VERSION_NUMERIC  "10000 * ${GTSAM_VERSION_MAJOR} + 100 * ${GTSAM_VERSION_MINOR} + ${GTSAM_VERSION_PATCH}" ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								set  ( GTSAM_VERSION_STRING  "${GTSAM_VERSION_MAJOR}.${GTSAM_VERSION_MINOR}.${GTSAM_VERSION_PATCH}" ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								###############################################################################
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								# Gather information, perform checks, set defaults
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								# Set the default install path to home
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								#set (CMAKE_INSTALL_PREFIX ${HOME} CACHE PATH "Install prefix for library")
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								set ( CMAKE_MODULE_PATH  "${CMAKE_MODULE_PATH}"  "${CMAKE_CURRENT_SOURCE_DIR}/cmake" ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								include ( GtsamMakeConfigFile ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								# Record the root dir for gtsam - needed during external builds, e.g., ROS
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								set ( GTSAM_SOURCE_ROOT_DIR  ${ CMAKE_CURRENT_SOURCE_DIR } ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								message ( STATUS  "GTSAM_SOURCE_ROOT_DIR: [${GTSAM_SOURCE_ROOT_DIR}]" ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								# Load build type flags and default to Debug mode
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								include ( GtsamBuildTypes ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								# Use macros for creating tests/timing scripts
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								include ( GtsamTesting ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								include ( GtsamPrinting ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								# guard against in-source builds
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								if ( ${ CMAKE_SOURCE_DIR }  STREQUAL  ${ CMAKE_BINARY_DIR } ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								  message ( FATAL_ERROR  "In-source builds not allowed. Please make a new directory (called a build directory) and run CMake from there. You may need to remove CMakeCache.txt. " ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								endif ( ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2014-06-13 02:40:24 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								# See whether gtsam_unstable is available (it will be present only if we're using a git checkout)
 
							 
						 
					
						
							
								
									
										
										
										
											2013-10-04 03:51:56 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								if ( EXISTS  "${PROJECT_SOURCE_DIR}/gtsam_unstable"  AND  IS_DIRECTORY  "${PROJECT_SOURCE_DIR}/gtsam_unstable" ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    set ( GTSAM_UNSTABLE_AVAILABLE  1 ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								else ( ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    set ( GTSAM_UNSTABLE_AVAILABLE  0 ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								endif ( ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								###############################################################################
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								# Set up options
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								# Configurable Options
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								if ( GTSAM_UNSTABLE_AVAILABLE ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    option ( GTSAM_BUILD_UNSTABLE               "Enable/Disable libgtsam_unstable"           ON ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								endif ( ) 
 
							 
						 
					
						
							
								
									
										
										
										
											2018-12-21 20:04:15 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								option ( BUILD_SHARED_LIBS                  "Build shared gtsam library, instead of static"  ON ) 
 
							 
						 
					
						
							
								
									
										
										
										
											2013-10-04 03:51:56 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								option ( GTSAM_USE_QUATERNIONS              "Enable/Disable using an internal Quaternion representation for rotations instead of rotation matrices. If enable, Rot3::EXPMAP is enforced by default."  OFF ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								option ( GTSAM_POSE3_EXPMAP  			 	 "Enable/Disable using Pose3::EXPMAP as the default mode. If disabled, Pose3::FIRST_ORDER will be used."  OFF ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								option ( GTSAM_ROT3_EXPMAP  			 	 "Ignore if GTSAM_USE_QUATERNIONS is OFF (Rot3::EXPMAP by default). Otherwise, enable Rot3::EXPMAP, or if disabled, use Rot3::CAYLEY."  OFF ) 
 
							 
						 
					
						
							
								
									
										
										
										
											2014-10-15 07:14:59 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								option ( GTSAM_ENABLE_CONSISTENCY_CHECKS    "Enable/Disable expensive consistency checks"        OFF ) 
 
							 
						 
					
						
							
								
									
										
										
										
											2013-10-04 03:51:56 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								option ( GTSAM_WITH_TBB                     "Use Intel Threaded Building Blocks (TBB) if available"  ON ) 
 
							 
						 
					
						
							
								
									
										
										
										
											2019-03-13 00:22:09 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								option ( GTSAM_WITH_EIGEN_MKL               "Eigen will use Intel MKL if available"  OFF ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								option ( GTSAM_WITH_EIGEN_MKL_OPENMP        "Eigen, when using Intel MKL, will also use OpenMP for multithreading if available"  OFF ) 
 
							 
						 
					
						
							
								
									
										
										
										
											2013-10-24 08:10:09 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								option ( GTSAM_THROW_CHEIRALITY_EXCEPTION  "Throw exception when a triangulated point is behind a camera"  ON ) 
 
							 
						 
					
						
							
								
									
										
										
										
											2016-02-13 05:19:00 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								option ( GTSAM_BUILD_PYTHON                 "Enable/Disable building & installation of Python module"  OFF ) 
 
							 
						 
					
						
							
								
									
										
										
										
											2016-01-27 15:57:44 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								option ( GTSAM_ALLOW_DEPRECATED_SINCE_V4    "Allow use of methods/functions deprecated in GTSAM 4"  ON ) 
 
							 
						 
					
						
							
								
									
										
										
										
											2016-06-07 09:31:10 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								option ( GTSAM_TYPEDEF_POINTS_TO_VECTORS    "Typdef Point2 and Point3 to Eigen::Vector equivalents"  OFF ) 
 
							 
						 
					
						
							
								
									
										
										
										
											2016-02-25 03:01:19 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								option ( GTSAM_SUPPORT_NESTED_DISSECTION    "Support Metis-based nested dissection"  ON ) 
 
							 
						 
					
						
							
								
									
										
										
										
											2016-05-16 04:15:37 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								option ( GTSAM_TANGENT_PREINTEGRATION       "Use new ImuFactor with integration on tangent space"  ON ) 
 
							 
						 
					
						
							
								
									
										
										
										
											2018-12-19 07:03:33 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								if ( NOT  MSVC  AND  NOT  XCODE_VERSION ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    option ( GTSAM_BUILD_WITH_CCACHE            "Use ccache compiler cache"  ON ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								endif ( ) 
 
							 
						 
					
						
							
								
									
										
										
										
											2013-10-04 03:51:56 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								# Options relating to MATLAB wrapper
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								# TODO: Check for matlab mex binary before handling building of binaries
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								option ( GTSAM_INSTALL_MATLAB_TOOLBOX       "Enable/Disable installation of matlab toolbox"   OFF ) 
 
							 
						 
					
						
							
								
									
										
										
										
											2016-11-25 15:27:12 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								option ( GTSAM_INSTALL_CYTHON_TOOLBOX       "Enable/Disable installation of Cython toolbox"   OFF ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								option ( GTSAM_BUILD_WRAP                   "Enable/Disable building of matlab/cython wrap utility (necessary for matlab/cython interface)"  ON ) 
 
							 
						 
					
						
							
								
									
										
										
										
											2019-02-14 17:45:48 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								set ( GTSAM_PYTHON_VERSION  "Default"  CACHE  STRING  "The version of python to build the cython wrapper or python module for (or Default)" ) 
 
							 
						 
					
						
							
								
									
										
										
										
											2013-10-04 03:51:56 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								# Check / set dependent variables for MATLAB wrapper
 
							 
						 
					
						
							
								
									
										
										
										
											2016-11-25 15:27:12 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								if ( ( GTSAM_INSTALL_MATLAB_TOOLBOX  OR  GTSAM_INSTALL_CYTHON_TOOLBOX )  AND  NOT  GTSAM_BUILD_WRAP ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									message ( FATAL_ERROR  "GTSAM_INSTALL_MATLAB_TOOLBOX or GTSAM_INSTALL_CYTHON_TOOLBOX is enabled, please also enable GTSAM_BUILD_WRAP" ) 
 
							 
						 
					
						
							
								
									
										
										
										
											2013-10-04 03:51:56 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								endif ( ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								if ( GTSAM_INSTALL_WRAP  AND  NOT  GTSAM_BUILD_WRAP ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									message ( FATAL_ERROR  "GTSAM_INSTALL_WRAP is enabled, please also enable GTSAM_BUILD_WRAP" ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								endif ( ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2018-12-21 20:04:15 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								if ( GTSAM_INSTALL_MATLAB_TOOLBOX  AND  NOT  BUILD_SHARED_LIBS ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									message ( FATAL_ERROR  "GTSAM_INSTALL_MATLAB_TOOLBOX and BUILD_SHARED_LIBS=OFF. The MATLAB wrapper cannot be compiled with a static GTSAM library because mex modules are themselves shared libraries.  If you want a self-contained mex module, enable GTSAM_MEX_BUILD_STATIC_MODULE instead of BUILD_SHARED_LIBS=OFF." ) 
 
							 
						 
					
						
							
								
									
										
										
										
											2014-01-31 03:41:25 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								endif ( ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2016-02-02 14:34:13 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								if ( GTSAM_BUILD_PYTHON  AND  GTSAM_ALLOW_DEPRECATED_SINCE_V4 ) 
 
							 
						 
					
						
							
								
									
										
										
										
											2016-02-18 04:19:03 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    message ( FATAL_ERROR  "GTSAM_BUILD_PYTHON and GTSAM_ALLOW_DEPRECATED_SINCE_V4 are both enabled. The python module cannot be compiled with deprecated functions turned on. Turn one of the two options off." ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								endif ( ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2016-06-07 09:31:10 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								if ( GTSAM_INSTALL_MATLAB_TOOLBOX  AND  GTSAM_TYPEDEF_POINTS_TO_VECTORS ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    message ( FATAL_ERROR  "GTSAM_INSTALL_MATLAB_TOOLBOX and GTSAM_TYPEDEF_POINTS_TO_VECTORS are both enabled. For now, the MATLAB toolbox cannot deal with this yet.  Please turn one of the two options off." ) 
 
							 
						 
					
						
							
								
									
										
										
										
											2016-02-02 14:34:13 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								endif ( ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2017-08-17 19:03:35 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								if ( GTSAM_INSTALL_CYTHON_TOOLBOX  AND  GTSAM_TYPEDEF_POINTS_TO_VECTORS ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    message ( FATAL_ERROR  "GTSAM_INSTALL_CYTHON_TOOLBOX and GTSAM_TYPEDEF_POINTS_TO_VECTORS are both enabled. For now, the CYTHON toolbox cannot deal with this yet.  Please turn one of the two options off." ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								endif ( ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2013-10-04 03:51:56 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								# Flags for choosing default packaging tools
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								set ( CPACK_SOURCE_GENERATOR  "TGZ"  CACHE  STRING  "CPack Default Source Generator" ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								set ( CPACK_GENERATOR         "TGZ"  CACHE  STRING  "CPack Default Binary Generator" ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								###############################################################################
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								# Find boost
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								# To change the path for boost, you will need to set:
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								# BOOST_ROOT: path to install prefix for boost
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								# Boost_NO_SYSTEM_PATHS: set to true to keep the find script from ignoring BOOST_ROOT
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								if ( MSVC ) 
 
							 
						 
					
						
							
								
									
										
										
										
											2018-11-08 22:52:12 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									# By default, boost only builds static libraries on windows
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									set ( Boost_USE_STATIC_LIBS  ON )   # only find static libs
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									# If we ever reset above on windows and, ...
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									# If we use Boost shared libs, disable auto linking.
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									# Some libraries, at least Boost Program Options, rely on this to export DLL symbols.
 
							 
						 
					
						
							
								
									
										
										
										
											2013-10-04 03:51:56 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									if ( NOT  Boost_USE_STATIC_LIBS ) 
 
							 
						 
					
						
							
								
									
										
										
										
											2019-02-09 05:18:21 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										list ( APPEND  GTSAM_COMPILE_DEFINITIONS_PUBLIC  BOOST_ALL_NO_LIB  BOOST_ALL_DYN_LINK ) 
 
							 
						 
					
						
							
								
									
										
										
										
											2013-10-04 03:51:56 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									endif ( ) 
 
							 
						 
					
						
							
								
									
										
										
										
											2018-12-01 04:48:16 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									# Virtual memory range for PCH exceeded on VS2015
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									if ( MSVC_VERSION  LESS  1910 )  # older than VS2017
 
							 
						 
					
						
							
								
									
										
										
										
											2019-02-09 05:18:21 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									  list ( APPEND  GTSAM_COMPILE_OPTIONS_PRIVATE  -Zm295 ) 
 
							 
						 
					
						
							
								
									
										
										
										
											2018-12-01 04:48:16 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									endif ( ) 
 
							 
						 
					
						
							
								
									
										
										
										
											2013-10-04 03:51:56 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								endif ( ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2019-02-09 05:18:21 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								# Store these in variables so they are automatically replicated in GTSAMConfig.cmake and such.
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								set ( BOOST_FIND_MINIMUM_VERSION  1.43 ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								set ( BOOST_FIND_MINIMUM_COMPONENTS  serialization  system  filesystem  thread  program_options  date_time  timer  chrono  regex ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								find_package ( Boost  ${ BOOST_FIND_MINIMUM_VERSION }  COMPONENTS  ${ BOOST_FIND_MINIMUM_COMPONENTS } ) 
 
							 
						 
					
						
							
								
									
										
										
										
											2013-10-04 03:51:56 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								# Required components
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								if ( NOT  Boost_SERIALIZATION_LIBRARY  OR  NOT  Boost_SYSTEM_LIBRARY  OR  NOT  Boost_FILESYSTEM_LIBRARY  OR 
							 
						 
					
						
							
								
									
										
										
										
											2016-08-29 05:07:03 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    N O T  B o o s t _ T H R E A D _ L I B R A R Y  O R  N O T  B o o s t _ D A T E _ T I M E _ L I B R A R Y ) 
 
							 
						 
					
						
							
								
									
										
										
										
											2013-10-04 03:51:56 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								  message ( FATAL_ERROR  "Missing required Boost components >= v1.43, please install/upgrade Boost or configure your search paths." ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								endif ( ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								option ( GTSAM_DISABLE_NEW_TIMERS  "Disables using Boost.chrono for timing"  OFF ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								# Allow for not using the timer libraries on boost < 1.48 (GTSAM timing code falls back to old timer library)
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								set ( GTSAM_BOOST_LIBRARIES 
							 
						 
					
						
							
								
									
										
										
										
											2019-01-15 07:38:14 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								  B o o s t : : s e r i a l i z a t i o n 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								  B o o s t : : s y s t e m 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								  B o o s t : : f i l e s y s t e m 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								  B o o s t : : t h r e a d 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								  B o o s t : : d a t e _ t i m e 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								  B o o s t : : r e g e x 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								) 
 
							 
						 
					
						
							
								
									
										
										
										
											2013-10-04 03:51:56 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								if  ( GTSAM_DISABLE_NEW_TIMERS ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    message ( "WARNING:  GTSAM timing instrumentation manually disabled" ) 
 
							 
						 
					
						
							
								
									
										
										
										
											2019-02-09 05:18:21 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    list ( APPEND  GTSAM_COMPILE_DEFINITIONS_PUBLIC  DGTSAM_DISABLE_NEW_TIMERS ) 
 
							 
						 
					
						
							
								
									
										
										
										
											2013-10-04 03:51:56 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								else ( ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    if ( Boost_TIMER_LIBRARY ) 
 
							 
						 
					
						
							
								
									
										
										
										
											2019-01-15 07:38:14 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								      list ( APPEND  GTSAM_BOOST_LIBRARIES  Boost::timer  Boost::chrono ) 
 
							 
						 
					
						
							
								
									
										
										
										
											2013-10-04 03:51:56 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    else ( ) 
 
							 
						 
					
						
							
								
									
										
										
										
											2014-02-14 03:20:25 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								      list ( APPEND  GTSAM_BOOST_LIBRARIES  rt )  # When using the header-only boost timer library, need -lrt
 
							 
						 
					
						
							
								
									
										
										
										
											2013-10-04 03:51:56 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								      message ( "WARNING:  GTSAM timing instrumentation will use the older, less accurate, Boost timer library because boost older than 1.48 was found." ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    endif ( ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								endif ( ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2014-11-24 08:50:16 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								if ( NOT  ( ${ Boost_VERSION }  LESS  105600 ) ) 
 
							 
						 
					
						
							
								
									
										
										
										
											2014-09-09 03:19:54 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									message ( "Ignoring Boost restriction on optional lvalue assignment from rvalues" ) 
 
							 
						 
					
						
							
								
									
										
										
										
											2019-02-09 05:18:21 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									list ( APPEND  GTSAM_COMPILE_DEFINITIONS_PUBLIC  BOOST_OPTIONAL_ALLOW_BINDING_TO_RVALUES  BOOST_OPTIONAL_CONFIG_ALLOW_BINDING_TO_RVALUES ) 
 
							 
						 
					
						
							
								
									
										
										
										
											2014-09-09 03:19:54 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								endif ( ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2013-10-04 03:51:56 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								###############################################################################
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								# Find TBB
 
							 
						 
					
						
							
								
									
										
										
										
											2019-01-08 07:11:08 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								find_package ( TBB  COMPONENTS  tbb  tbbmalloc ) 
 
							 
						 
					
						
							
								
									
										
										
										
											2013-10-04 03:51:56 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								# Set up variables if we're using TBB
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								if ( TBB_FOUND  AND  GTSAM_WITH_TBB ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									set ( GTSAM_USE_TBB  1 )   # This will go into config.h
 
							 
						 
					
						
							
								
									
										
										
										
											2019-01-08 07:11:08 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								  # all definitions and link requisites will go via imported targets:
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								  # tbb & tbbmalloc
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								  list ( APPEND  GTSAM_ADDITIONAL_LIBRARIES  tbb  tbbmalloc ) 
 
							 
						 
					
						
							
								
									
										
										
										
											2013-10-14 06:21:07 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								else ( ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									set ( GTSAM_USE_TBB  0 )   # This will go into config.h
 
							 
						 
					
						
							
								
									
										
										
										
											2013-10-04 03:51:56 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								endif ( ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2015-06-18 04:23:27 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								###############################################################################
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								# Prohibit Timing build mode in combination with TBB
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								if ( GTSAM_USE_TBB  AND  ( CMAKE_BUILD_TYPE   STREQUAL  "Timing" ) ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								      message ( FATAL_ERROR  "Timing build mode cannot be used together with TBB. Use a sampling profiler such as Instruments or Intel VTune Amplifier instead." ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								endif ( ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2013-10-04 03:51:56 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2013-10-14 06:21:07 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								###############################################################################
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								# Find Google perftools
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								find_package ( GooglePerfTools ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2018-11-09 11:09:05 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								###############################################################################
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								# Support ccache, if installed
 
							 
						 
					
						
							
								
									
										
										
										
											2018-12-19 07:03:33 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								if ( NOT  MSVC  AND  NOT  XCODE_VERSION ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									find_program ( CCACHE_FOUND  ccache ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									if ( CCACHE_FOUND ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										if ( GTSAM_BUILD_WITH_CCACHE ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											set_property ( GLOBAL  PROPERTY  RULE_LAUNCH_COMPILE  ccache ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											set_property ( GLOBAL  PROPERTY  RULE_LAUNCH_LINK  ccache ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										else ( ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											set_property ( GLOBAL  PROPERTY  RULE_LAUNCH_COMPILE  "" ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											set_property ( GLOBAL  PROPERTY  RULE_LAUNCH_LINK  "" ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										endif ( ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									endif ( CCACHE_FOUND ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								endif ( ) 
 
							 
						 
					
						
							
								
									
										
										
										
											2013-10-14 06:21:07 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2013-11-19 03:23:23 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								###############################################################################
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								# Find MKL
 
							 
						 
					
						
							
								
									
										
										
										
											2014-06-05 02:08:24 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								find_package ( MKL ) 
 
							 
						 
					
						
							
								
									
										
										
										
											2013-11-19 03:23:23 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2014-06-05 02:08:24 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								if ( MKL_FOUND  AND  GTSAM_WITH_EIGEN_MKL ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    set ( GTSAM_USE_EIGEN_MKL  1 )  # This will go into config.h
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    set ( EIGEN_USE_MKL_ALL  1 )  # This will go into config.h - it makes Eigen use MKL
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    list ( APPEND  GTSAM_ADDITIONAL_LIBRARIES  ${ MKL_LIBRARIES } ) 
 
							 
						 
					
						
							
								
									
										
										
										
											2016-02-25 03:01:19 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2015-06-22 23:43:30 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    # --no-as-needed is required with gcc according to the MKL link advisor
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    if ( CMAKE_CXX_COMPILER_ID  STREQUAL  "GNU" ) 
 
							 
						 
					
						
							
								
									
										
										
										
											2016-02-25 03:01:19 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								        set ( CMAKE_EXE_LINKER_FLAGS  "${CMAKE_EXE_LINKER_FLAGS} -Wl,--no-as-needed" ) 
 
							 
						 
					
						
							
								
									
										
										
										
											2015-06-22 23:43:30 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    endif ( ) 
 
							 
						 
					
						
							
								
									
										
										
										
											2014-06-05 02:08:24 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								else ( ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    set ( GTSAM_USE_EIGEN_MKL  0 ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    set ( EIGEN_USE_MKL_ALL  0 ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								endif ( ) 
 
							 
						 
					
						
							
								
									
										
										
										
											2013-11-19 03:23:23 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								###############################################################################
 
							 
						 
					
						
							
								
									
										
										
										
											2014-02-09 03:09:50 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								# Find OpenMP (if we're also using MKL)
 
							 
						 
					
						
							
								
									
										
										
										
											2014-10-01 04:13:15 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								find_package ( OpenMP )   # do this here to generate correct message if disabled
 
							 
						 
					
						
							
								
									
										
										
										
											2013-11-19 03:23:23 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2014-10-01 04:13:15 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								if ( GTSAM_WITH_EIGEN_MKL  AND  GTSAM_WITH_EIGEN_MKL_OPENMP  AND  GTSAM_USE_EIGEN_MKL ) 
 
							 
						 
					
						
							
								
									
										
										
										
											2014-02-08 23:37:24 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    if ( OPENMP_FOUND  AND  GTSAM_USE_EIGEN_MKL  AND  GTSAM_WITH_EIGEN_MKL_OPENMP ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								        set ( GTSAM_USE_EIGEN_MKL_OPENMP  1 )  # This will go into config.h
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								        set ( CMAKE_CXX_FLAGS  "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}" ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    endif ( ) 
 
							 
						 
					
						
							
								
									
										
										
										
											2013-11-19 03:23:23 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								endif ( ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2013-10-04 03:51:56 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								###############################################################################
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								# Option for using system Eigen or GTSAM-bundled Eigen
 
							 
						 
					
						
							
								
									
										
										
										
											2015-05-21 01:58:58 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								### These patches only affect usage of MKL. If you want to enable MKL, you *must*
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								### use our patched version of Eigen
 
							 
						 
					
						
							
								
									
										
										
										
											2013-12-23 02:21:08 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								### See:  http://eigen.tuxfamily.org/bz/show_bug.cgi?id=704 (Householder QR MKL selection)
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								###       http://eigen.tuxfamily.org/bz/show_bug.cgi?id=705 (Fix MKL LLT return code)
 
							 
						 
					
						
							
								
									
										
										
										
											2015-03-10 08:01:47 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								option ( GTSAM_USE_SYSTEM_EIGEN  "Find and use system-installed Eigen. If 'off', use the one bundled with GTSAM"  OFF ) 
 
							 
						 
					
						
							
								
									
										
										
										
											2013-10-04 03:51:56 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								# Switch for using system Eigen or GTSAM-bundled Eigen
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								if ( GTSAM_USE_SYSTEM_EIGEN ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									find_package ( Eigen3  REQUIRED ) 
 
							 
						 
					
						
							
								
									
										
										
										
											2016-02-25 03:01:19 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2015-03-19 02:20:45 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									# Use generic Eigen include paths e.g. <Eigen/Core>
 
							 
						 
					
						
							
								
									
										
										
										
											2019-02-17 07:58:35 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									set ( GTSAM_EIGEN_INCLUDE_FOR_INSTALL  "${EIGEN3_INCLUDE_DIR}" ) 
 
							 
						 
					
						
							
								
									
										
										
										
											2016-02-25 03:01:19 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2015-03-11 01:00:28 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									# check if MKL is also enabled - can have one or the other, but not both!
 
							 
						 
					
						
							
								
									
										
										
										
											2016-02-14 04:08:54 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									# Note: Eigen >= v3.2.5 includes our patches
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									if ( EIGEN_USE_MKL_ALL  AND  ( EIGEN3_VERSION  VERSION_LESS  3.2.5 ) ) 
 
							 
						 
					
						
							
								
									
										
										
										
											2016-02-14 05:34:27 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									  message ( FATAL_ERROR  "MKL requires at least Eigen 3.2.5, and your system appears to have an older version. Disable GTSAM_USE_SYSTEM_EIGEN to use GTSAM's copy of Eigen, or disable GTSAM_WITH_EIGEN_MKL" ) 
 
							 
						 
					
						
							
								
									
										
										
										
											2015-03-11 01:00:28 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									endif ( ) 
 
							 
						 
					
						
							
								
									
										
										
										
											2018-12-12 02:56:56 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									# Check for Eigen version which doesn't work with MKL
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									# See http://eigen.tuxfamily.org/bz/show_bug.cgi?id=1527 for details.
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									if ( EIGEN_USE_MKL_ALL  AND  ( EIGEN3_VERSION  VERSION_EQUAL  3.3.4 ) ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										message ( FATAL_ERROR  "MKL does not work with Eigen 3.3.4 because of a bug in Eigen. See http://eigen.tuxfamily.org/bz/show_bug.cgi?id=1527. Disable GTSAM_USE_SYSTEM_EIGEN to use GTSAM's copy of Eigen, disable GTSAM_WITH_EIGEN_MKL, or upgrade/patch your installation of Eigen." ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									endif ( ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2019-02-17 07:58:35 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									# The actual include directory (for BUILD cmake target interface):
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									set ( GTSAM_EIGEN_INCLUDE_FOR_BUILD  "${EIGEN3_INCLUDE_DIR}" ) 
 
							 
						 
					
						
							
								
									
										
										
										
											2013-10-04 03:51:56 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								else ( ) 
 
							 
						 
					
						
							
								
									
										
										
										
											2016-02-25 03:01:19 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									# Use bundled Eigen include path.
 
							 
						 
					
						
							
								
									
										
										
										
											2013-10-04 03:51:56 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									# Clear any variables set by FindEigen3
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									if ( EIGEN3_INCLUDE_DIR ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										set ( EIGEN3_INCLUDE_DIR  NOTFOUND  CACHE  STRING  ""  FORCE ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									endif ( ) 
 
							 
						 
					
						
							
								
									
										
										
										
											2016-02-25 03:01:19 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2015-03-19 09:46:12 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									# set full path to be used by external projects
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									# this will be added to GTSAM_INCLUDE_DIR by gtsam_extra.cmake.in
 
							 
						 
					
						
							
								
									
										
										
										
											2019-02-17 07:58:35 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									set ( GTSAM_EIGEN_INCLUDE_FOR_INSTALL  "include/gtsam/3rdparty/Eigen/" ) 
 
							 
						 
					
						
							
								
									
										
										
										
											2016-02-25 03:01:19 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2019-02-17 07:58:35 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									# The actual include directory (for BUILD cmake target interface):
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									set ( GTSAM_EIGEN_INCLUDE_FOR_BUILD  "${CMAKE_SOURCE_DIR}/gtsam/3rdparty/Eigen/" ) 
 
							 
						 
					
						
							
								
									
										
										
										
											2013-10-04 03:51:56 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								endif ( ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2018-11-08 22:52:12 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								if  ( MSVC ) 
 
							 
						 
					
						
							
								
									
										
										
										
											2018-12-21 20:04:15 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									if  ( BUILD_SHARED_LIBS ) 
 
							 
						 
					
						
							
								
									
										
										
										
											2018-11-08 22:52:12 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										# mute eigen static assert to avoid errors in shared lib
 
							 
						 
					
						
							
								
									
										
										
										
											2019-02-09 05:18:21 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										list ( APPEND  GTSAM_COMPILE_DEFINITIONS_PUBLIC  DEIGEN_NO_STATIC_ASSERT ) 
 
							 
						 
					
						
							
								
									
										
										
										
											2018-11-08 22:52:12 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									endif ( ) 
 
							 
						 
					
						
							
								
									
										
										
										
											2019-02-09 05:18:21 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									list ( APPEND  GTSAM_COMPILE_OPTIONS_PRIVATE  "/wd4244" )  # Disable loss of precision which is thrown all over our Eigen
 
							 
						 
					
						
							
								
									
										
										
										
											2018-11-08 22:52:12 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								endif ( ) 
 
							 
						 
					
						
							
								
									
										
										
										
											2017-05-18 05:30:17 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2013-10-04 03:51:56 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								###############################################################################
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								# Global compile options
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2013-10-14 06:21:07 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								# Build list of possible allocators
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								set ( possible_allocators  "" ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								if ( GTSAM_USE_TBB ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									list ( APPEND  possible_allocators  TBB ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									set ( preferred_allocator  TBB ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								else ( ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									list ( APPEND  possible_allocators  BoostPool  STL ) 
 
							 
						 
					
						
							
								
									
										
										
										
											2013-11-19 03:23:23 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									set ( preferred_allocator  STL ) 
 
							 
						 
					
						
							
								
									
										
										
										
											2013-10-14 06:55:59 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								endif ( ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								if ( GOOGLE_PERFTOOLS_FOUND ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									list ( APPEND  possible_allocators  tcmalloc ) 
 
							 
						 
					
						
							
								
									
										
										
										
											2013-10-14 06:21:07 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								endif ( ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2013-10-14 06:55:59 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								# Check if current allocator choice is valid and set cache option
 
							 
						 
					
						
							
								
									
										
										
										
											2013-10-14 06:21:07 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								list ( FIND  possible_allocators  "${GTSAM_DEFAULT_ALLOCATOR}"  allocator_valid ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								if ( allocator_valid  EQUAL  -1 ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									set ( GTSAM_DEFAULT_ALLOCATOR  ${ preferred_allocator }  CACHE  STRING  "Default allocator"  FORCE ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								else ( ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									set ( GTSAM_DEFAULT_ALLOCATOR  ${ preferred_allocator }  CACHE  STRING  "Default allocator" ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								endif ( ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								set_property ( CACHE  GTSAM_DEFAULT_ALLOCATOR  PROPERTY  STRINGS  ${ possible_allocators } ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								mark_as_advanced ( GTSAM_DEFAULT_ALLOCATOR ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								# Define compile flags depending on allocator
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								if ( "${GTSAM_DEFAULT_ALLOCATOR}"  STREQUAL  "BoostPool" ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									set ( GTSAM_ALLOCATOR_BOOSTPOOL  1 ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								elseif ( "${GTSAM_DEFAULT_ALLOCATOR}"  STREQUAL  "STL" ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									set ( GTSAM_ALLOCATOR_STL  1 ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								elseif ( "${GTSAM_DEFAULT_ALLOCATOR}"  STREQUAL  "TBB" ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									set ( GTSAM_ALLOCATOR_TBB  1 ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								elseif ( "${GTSAM_DEFAULT_ALLOCATOR}"  STREQUAL  "tcmalloc" ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									set ( GTSAM_ALLOCATOR_STL  1 )  # tcmalloc replaces malloc, so to use it we use the STL allocator
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									list ( APPEND  GTSAM_ADDITIONAL_LIBRARIES  "tcmalloc" ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								endif ( ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2013-10-04 03:51:56 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								if ( MSVC ) 
 
							 
						 
					
						
							
								
									
										
										
										
											2019-02-09 05:18:21 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									list ( APPEND  GTSAM_COMPILE_DEFINITIONS_PRIVATE  _CRT_SECURE_NO_WARNINGS  _SCL_SECURE_NO_WARNINGS ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									list ( APPEND  GTSAM_COMPILE_OPTIONS_PRIVATE  /wd4251  /wd4275  /wd4251  /wd4661  /wd4344  /wd4503 )  # Disable non-DLL-exported base class and other warnings
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									list ( APPEND  GTSAM_COMPILE_OPTIONS_PRIVATE  /bigobj )  # Allow large object files for template-based code
 
							 
						 
					
						
							
								
									
										
										
										
											2013-10-04 03:51:56 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								endif ( ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2014-05-31 05:07:09 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								# GCC 4.8+ complains about local typedefs which we use for shared_ptr etc.
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								if ( CMAKE_CXX_COMPILER_ID  STREQUAL  "GNU" ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								  if  ( NOT  CMAKE_CXX_COMPILER_VERSION  VERSION_LESS  4.8 ) 
 
							 
						 
					
						
							
								
									
										
										
										
											2019-02-09 05:18:21 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    list ( APPEND  GTSAM_COMPILE_OPTIONS_PRIVATE  -Wno-unused-local-typedefs ) 
 
							 
						 
					
						
							
								
									
										
										
										
											2014-05-31 05:07:09 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								  endif ( ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								endif ( ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2015-10-09 03:35:12 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								# As of XCode 7, clang also complains about this
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								if ( CMAKE_CXX_COMPILER_ID  STREQUAL  "Clang" ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								  if  ( NOT  CMAKE_CXX_COMPILER_VERSION  VERSION_LESS  7.0 ) 
 
							 
						 
					
						
							
								
									
										
										
										
											2019-02-09 05:18:21 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    list ( APPEND  GTSAM_COMPILE_OPTIONS_PRIVATE  -Wno-unused-local-typedefs ) 
 
							 
						 
					
						
							
								
									
										
										
										
											2015-10-09 03:35:12 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								  endif ( ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								endif ( ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2013-10-04 03:51:56 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								if ( GTSAM_ENABLE_CONSISTENCY_CHECKS ) 
 
							 
						 
					
						
							
								
									
										
										
										
											2019-02-09 05:18:21 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								  # This should be made PUBLIC if GTSAM_EXTRA_CONSISTENCY_CHECKS is someday used in a public .h
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								  list ( APPEND  GTSAM_COMPILE_DEFINITIONS_PRIVATE  GTSAM_EXTRA_CONSISTENCY_CHECKS ) 
 
							 
						 
					
						
							
								
									
										
										
										
											2014-01-31 03:41:25 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								endif ( ) 
 
							 
						 
					
						
							
								
									
										
										
										
											2013-10-04 03:51:56 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								###############################################################################
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								# Add components
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								# Build CppUnitLite
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								add_subdirectory ( CppUnitLite ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								# Build wrap
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								if  ( GTSAM_BUILD_WRAP ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    add_subdirectory ( wrap ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								endif ( GTSAM_BUILD_WRAP ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								# Build GTSAM library
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								add_subdirectory ( gtsam ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								# Build Tests
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								add_subdirectory ( tests ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								# Build examples
 
							 
						 
					
						
							
								
									
										
										
										
											2014-02-23 06:13:13 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								add_subdirectory ( examples ) 
 
							 
						 
					
						
							
								
									
										
										
										
											2013-10-04 03:51:56 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2014-06-08 10:02:11 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								# Build timing
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								add_subdirectory ( timing ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2017-07-24 02:55:23 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								# Build gtsam_unstable
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								if  ( GTSAM_BUILD_UNSTABLE ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    add_subdirectory ( gtsam_unstable ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								endif ( GTSAM_BUILD_UNSTABLE ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2013-10-04 03:51:56 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								# Matlab toolbox
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								if  ( GTSAM_INSTALL_MATLAB_TOOLBOX ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									add_subdirectory ( matlab ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								endif ( ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2015-11-12 04:39:08 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								# Python wrap
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								if  ( GTSAM_BUILD_PYTHON ) 
 
							 
						 
					
						
							
								
									
										
										
										
											2015-11-26 01:21:10 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									include ( GtsamPythonWrap ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2015-11-19 21:59:30 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									# NOTE: The automatic generation of python wrapper from the gtsampy.h interface is
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									#       not working yet, so we're using a handwritten wrapper files on python/handwritten.
 
							 
						 
					
						
							
								
									
										
										
										
											2016-02-25 03:01:19 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									#       Once the python wrapping from the interface file is working, you can _swap_ the
 
							 
						 
					
						
							
								
									
										
										
										
											2015-11-19 21:59:30 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									#       comments on the next lines
 
							 
						 
					
						
							
								
									
										
										
										
											2016-02-25 03:01:19 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2015-11-17 23:19:57 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									# wrap_and_install_python(gtsampy.h "${GTSAM_ADDITIONAL_LIBRARIES}" "")
 
							 
						 
					
						
							
								
									
										
										
										
											2015-11-19 21:59:30 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									add_subdirectory ( python ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2013-11-15 14:59:02 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								endif ( ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2016-11-25 15:27:12 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								# Cython wrap
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								if  ( GTSAM_INSTALL_CYTHON_TOOLBOX ) 
 
							 
						 
					
						
							
								
									
										
										
										
											2017-07-29 03:24:30 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								  set ( GTSAM_INSTALL_CYTHON_TOOLBOX  1 ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								  # Set up cache options
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								  set ( GTSAM_CYTHON_INSTALL_PATH  ""  CACHE  PATH  "Cython toolbox destination, blank defaults to CMAKE_INSTALL_PREFIX/cython" ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								  if ( NOT  GTSAM_CYTHON_INSTALL_PATH ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    set ( GTSAM_CYTHON_INSTALL_PATH  "${CMAKE_INSTALL_PREFIX}/cython" ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								  endif ( ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								  set ( GTSAM_EIGENCY_INSTALL_PATH  ${ GTSAM_CYTHON_INSTALL_PATH } /gtsam_eigency ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								  add_subdirectory ( cython ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								else ( ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								  set ( GTSAM_INSTALL_CYTHON_TOOLBOX  0 )  # This will go into config.h
 
							 
						 
					
						
							
								
									
										
										
										
											2016-11-25 15:27:12 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								endif ( ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2013-10-04 03:51:56 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								# Install config and export files
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								GtsamMakeConfigFile ( GTSAM  "${CMAKE_CURRENT_SOURCE_DIR}/gtsam_extra.cmake.in" ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								export ( TARGETS  ${ GTSAM_EXPORTED_TARGETS }  FILE  GTSAM-exports.cmake ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2014-10-15 07:14:59 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2013-10-04 03:51:56 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								# Check for doxygen availability - optional dependency
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								find_package ( Doxygen ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								# Doxygen documentation - enabling options in subfolder
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								if  ( DOXYGEN_FOUND ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    add_subdirectory ( doc ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								endif ( ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2014-02-20 02:10:37 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								# CMake Tools
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								add_subdirectory ( cmake ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2013-10-04 03:51:56 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								###############################################################################
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								# Set up CPack
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								set ( CPACK_PACKAGE_DESCRIPTION_SUMMARY  "GTSAM" ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								set ( CPACK_PACKAGE_VENDOR  "Frank Dellaert, Georgia Institute of Technology" ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								set ( CPACK_PACKAGE_CONTACT  "Frank Dellaert, dellaert@cc.gatech.edu" ) 
 
							 
						 
					
						
							
								
									
										
										
										
											2014-01-31 03:42:23 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								set ( CPACK_PACKAGE_DESCRIPTION_FILE  "${CMAKE_CURRENT_SOURCE_DIR}/README.md" ) 
 
							 
						 
					
						
							
								
									
										
										
										
											2013-10-04 03:51:56 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								set ( CPACK_RESOURCE_FILE_LICENSE  "${CMAKE_CURRENT_SOURCE_DIR}/LICENSE" ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								set ( CPACK_PACKAGE_VERSION_MAJOR  ${ GTSAM_VERSION_MAJOR } ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								set ( CPACK_PACKAGE_VERSION_MINOR  ${ GTSAM_VERSION_MINOR } ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								set ( CPACK_PACKAGE_VERSION_PATCH  ${ GTSAM_VERSION_PATCH } ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								set ( CPACK_PACKAGE_INSTALL_DIRECTORY  "CMake ${CMake_VERSION_MAJOR}.${CMake_VERSION_MINOR}" ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								#set(CPACK_INSTALLED_DIRECTORIES "doc;.") # Include doc directory
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								#set(CPACK_INSTALLED_DIRECTORIES ".") # FIXME: throws error
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								set ( CPACK_SOURCE_IGNORE_FILES  "/build*;/\\\\.;/makestats.sh$" ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								set ( CPACK_SOURCE_IGNORE_FILES  "${CPACK_SOURCE_IGNORE_FILES}"  "/gtsam_unstable/" ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								set ( CPACK_SOURCE_IGNORE_FILES  "${CPACK_SOURCE_IGNORE_FILES}"  "/package_scripts/" ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								set ( CPACK_SOURCE_PACKAGE_FILE_NAME  "gtsam-${GTSAM_VERSION_MAJOR}.${GTSAM_VERSION_MINOR}.${GTSAM_VERSION_PATCH}" ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								#set(CPACK_SOURCE_PACKAGE_FILE_NAME "gtsam-aspn${GTSAM_VERSION_PATCH}") # Used for creating ASPN tarballs
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								# Deb-package specific cpack
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								set ( CPACK_DEBIAN_PACKAGE_NAME  "libgtsam-dev" ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								set ( CPACK_DEBIAN_PACKAGE_DEPENDS  "libboost-dev (>= 1.43)" )  #Example: "libc6 (>= 2.3.1-6), libgcc1 (>= 1:3.4.2-12)")
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								###############################################################################
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								# Print configuration variables
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								message ( STATUS  "===============================================================" ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								message ( STATUS  "================  Configuration Options  ======================" ) 
 
							 
						 
					
						
							
								
									
										
										
										
											2015-10-09 03:35:12 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								message ( STATUS  "  CMAKE_CXX_COMPILER_ID type     : ${CMAKE_CXX_COMPILER_ID}" ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								message ( STATUS  "  CMAKE_CXX_COMPILER_VERSION     : ${CMAKE_CXX_COMPILER_VERSION}" ) 
 
							 
						 
					
						
							
								
									
										
										
										
											2013-10-04 03:51:56 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								message ( STATUS  "Build flags                                               " ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								print_config_flag ( ${ GTSAM_BUILD_TESTS }                  "Build Tests                    " ) 
 
							 
						 
					
						
							
								
									
										
										
										
											2014-02-14 02:22:56 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								print_config_flag ( ${ GTSAM_BUILD_EXAMPLES_ALWAYS }        "Build examples with 'make all' " ) 
 
							 
						 
					
						
							
								
									
										
										
										
											2014-06-22 07:26:48 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								print_config_flag ( ${ GTSAM_BUILD_TIMING_ALWAYS }          "Build timing scripts with 'make all'" ) 
 
							 
						 
					
						
							
								
									
										
										
										
											2013-10-04 03:51:56 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								if  ( DOXYGEN_FOUND ) 
 
							 
						 
					
						
							
								
									
										
										
										
											2014-02-14 02:22:56 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    print_config_flag ( ${ GTSAM_BUILD_DOCS }               "Build Docs                     " ) 
 
							 
						 
					
						
							
								
									
										
										
										
											2013-10-04 03:51:56 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								endif ( ) 
 
							 
						 
					
						
							
								
									
										
										
										
											2018-12-21 20:04:15 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								print_config_flag ( ${ BUILD_SHARED_LIBS }                  "Build shared GTSAM libraries   " ) 
 
							 
						 
					
						
							
								
									
										
										
										
											2013-10-04 03:51:56 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								print_config_flag ( ${ GTSAM_BUILD_TYPE_POSTFIXES }         "Put build type in library name " ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								if ( GTSAM_UNSTABLE_AVAILABLE ) 
 
							 
						 
					
						
							
								
									
										
										
										
											2014-02-14 02:22:56 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    print_config_flag ( ${ GTSAM_BUILD_UNSTABLE }           "Build libgtsam_unstable        " ) 
 
							 
						 
					
						
							
								
									
										
										
										
											2013-10-04 03:51:56 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								endif ( ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								string ( TOUPPER  "${CMAKE_BUILD_TYPE}"  cmake_build_type_toupper ) 
 
							 
						 
					
						
							
								
									
										
										
										
											2014-02-09 00:14:43 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								if ( NOT  MSVC  AND  NOT  XCODE_VERSION ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    message ( STATUS  "  Build type                     : ${CMAKE_BUILD_TYPE}" ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    message ( STATUS  "  C compilation flags            : ${CMAKE_C_FLAGS} ${CMAKE_C_FLAGS_${cmake_build_type_toupper}}" ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    message ( STATUS  "  C++ compilation flags          : ${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_${cmake_build_type_toupper}}" ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								endif ( ) 
 
							 
						 
					
						
							
								
									
										
										
										
											2015-03-10 08:01:47 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								if ( GTSAM_USE_SYSTEM_EIGEN ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    message ( STATUS  "  Use System Eigen               : Yes" ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								else ( ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    message ( STATUS  "  Use System Eigen               : No" ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								endif ( ) 
 
							 
						 
					
						
							
								
									
										
										
										
											2013-10-04 03:51:56 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								if ( GTSAM_USE_TBB ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									message ( STATUS  "  Use Intel TBB                  : Yes" ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								elseif ( TBB_FOUND ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									message ( STATUS  "  Use Intel TBB                  : TBB found but GTSAM_WITH_TBB is disabled" ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								else ( ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									message ( STATUS  "  Use Intel TBB                  : TBB not found" ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								endif ( ) 
 
							 
						 
					
						
							
								
									
										
										
										
											2013-11-19 03:23:23 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								if ( GTSAM_USE_EIGEN_MKL ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									message ( STATUS  "  Eigen will use MKL             : Yes" ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								elseif ( MKL_FOUND ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									message ( STATUS  "  Eigen will use MKL             : MKL found but GTSAM_WITH_EIGEN_MKL is disabled" ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								else ( ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									message ( STATUS  "  Eigen will use MKL             : MKL not found" ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								endif ( ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								if ( GTSAM_USE_EIGEN_MKL_OPENMP ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									message ( STATUS  "  Eigen will use MKL and OpenMP  : Yes" ) 
 
							 
						 
					
						
							
								
									
										
										
										
											2013-11-28 03:04:11 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								elseif ( OPENMP_FOUND  AND  NOT  GTSAM_WITH_EIGEN_MKL ) 
 
							 
						 
					
						
							
								
									
										
										
										
											2013-11-19 08:26:14 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									message ( STATUS  "  Eigen will use MKL and OpenMP  : OpenMP found but GTSAM_WITH_EIGEN_MKL is disabled" ) 
 
							 
						 
					
						
							
								
									
										
										
										
											2013-11-28 03:04:11 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								elseif ( OPENMP_FOUND  AND  NOT  MKL_FOUND ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									message ( STATUS  "  Eigen will use MKL and OpenMP  : OpenMP found but MKL not found" ) 
 
							 
						 
					
						
							
								
									
										
										
										
											2013-11-19 03:23:23 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								elseif ( OPENMP_FOUND ) 
 
							 
						 
					
						
							
								
									
										
										
										
											2013-11-19 08:26:14 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									message ( STATUS  "  Eigen will use MKL and OpenMP  : OpenMP found but GTSAM_WITH_EIGEN_MKL_OPENMP is disabled" ) 
 
							 
						 
					
						
							
								
									
										
										
										
											2013-11-19 03:23:23 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								else ( ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									message ( STATUS  "  Eigen will use MKL and OpenMP  : OpenMP not found" ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								endif ( ) 
 
							 
						 
					
						
							
								
									
										
										
										
											2013-10-14 06:21:07 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								message ( STATUS  "  Default allocator              : ${GTSAM_DEFAULT_ALLOCATOR}" ) 
 
							 
						 
					
						
							
								
									
										
										
										
											2013-10-04 03:51:56 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2018-12-19 07:03:33 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								if ( NOT  MSVC  AND  NOT  XCODE_VERSION ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									if ( CCACHE_FOUND  AND  GTSAM_BUILD_WITH_CCACHE ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										message ( STATUS  "  Build with ccache              : Yes" ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									elseif ( CCACHE_FOUND ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										message ( STATUS  "  Build with ccache              : ccache found but GTSAM_BUILD_WITH_CCACHE is disabled" ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									else ( ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										message ( STATUS  "  Build with ccache              : No" ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									endif ( ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								endif ( ) 
 
							 
						 
					
						
							
								
									
										
										
										
											2013-10-04 03:51:56 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								message ( STATUS  "Packaging flags                                               " ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								message ( STATUS  "  CPack Source Generator         : ${CPACK_SOURCE_GENERATOR}" ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								message ( STATUS  "  CPack Generator                : ${CPACK_GENERATOR}" ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								message ( STATUS  "GTSAM flags                                               " ) 
 
							 
						 
					
						
							
								
									
										
										
										
											2016-05-16 04:15:37 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								print_config_flag ( ${ GTSAM_USE_QUATERNIONS }              "Quaternions as default Rot3     " ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								print_config_flag ( ${ GTSAM_ENABLE_CONSISTENCY_CHECKS }    "Runtime consistency checking    " ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								print_config_flag ( ${ GTSAM_ROT3_EXPMAP }                  "Rot3 retract is full ExpMap     " ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								print_config_flag ( ${ GTSAM_POSE3_EXPMAP }                 "Pose3 retract is full ExpMap    " ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								print_config_flag ( ${ GTSAM_ALLOW_DEPRECATED_SINCE_V4 }    "Deprecated in GTSAM 4 allowed   " ) 
 
							 
						 
					
						
							
								
									
										
										
										
											2016-06-07 09:31:10 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								print_config_flag ( ${ GTSAM_TYPEDEF_POINTS_TO_VECTORS }           "Point3 is typedef to Vector3    " ) 
 
							 
						 
					
						
							
								
									
										
										
										
											2016-05-16 04:15:37 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								print_config_flag ( ${ GTSAM_SUPPORT_NESTED_DISSECTION }    "Metis-based Nested Dissection   " ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								print_config_flag ( ${ GTSAM_TANGENT_PREINTEGRATION }       "Use tangent-space preintegration" ) 
 
							 
						 
					
						
							
								
									
										
										
										
											2013-10-04 03:51:56 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								message ( STATUS  "MATLAB toolbox flags                                      " ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								print_config_flag ( ${ GTSAM_INSTALL_MATLAB_TOOLBOX }       "Install matlab toolbox         " ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								print_config_flag ( ${ GTSAM_BUILD_WRAP }                   "Build Wrap                     " ) 
 
							 
						 
					
						
							
								
									
										
										
										
											2015-11-30 22:47:16 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								message ( STATUS  "Python module flags                                       " ) 
 
							 
						 
					
						
							
								
									
										
										
										
											2016-01-21 14:13:22 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								if ( GTSAM_PYTHON_WARNINGS ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									message ( STATUS  "  Build python module            : No - dependencies missing" ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								else ( ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									print_config_flag ( ${ GTSAM_BUILD_PYTHON }                 "Build python module            " ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								endif ( ) 
 
							 
						 
					
						
							
								
									
										
										
										
											2015-11-30 22:47:16 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								if ( GTSAM_BUILD_PYTHON ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									message ( STATUS  "  Python version                 : ${GTSAM_PYTHON_VERSION}" ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								endif ( ) 
 
							 
						 
					
						
							
								
									
										
										
										
											2016-11-25 15:27:12 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								message ( STATUS  "Cython toolbox flags                                      " ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								print_config_flag ( ${ GTSAM_INSTALL_CYTHON_TOOLBOX }       "Install Cython toolbox         " ) 
 
							 
						 
					
						
							
								
									
										
										
										
											2019-02-14 17:45:48 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								message ( STATUS  "  Python version                 : ${GTSAM_PYTHON_VERSION}" ) 
 
							 
						 
					
						
							
								
									
										
										
										
											2016-11-25 15:27:12 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								print_config_flag ( ${ GTSAM_BUILD_WRAP }                   "Build Wrap                     " ) 
 
							 
						 
					
						
							
								
									
										
										
										
											2013-10-04 03:51:56 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								message ( STATUS  "===============================================================" ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2013-11-19 03:23:23 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								# Print warnings at the end
 
							 
						 
					
						
							
								
									
										
										
										
											2013-10-04 03:51:56 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								if ( GTSAM_WITH_TBB  AND  NOT  TBB_FOUND ) 
 
							 
						 
					
						
							
								
									
										
										
										
											2013-11-19 03:46:28 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									message ( WARNING  "TBB was not found - this is ok, but note that GTSAM parallelization will be disabled.  Set GTSAM_WITH_TBB to 'Off' to avoid this warning." ) 
 
							 
						 
					
						
							
								
									
										
										
										
											2013-11-19 03:23:23 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								endif ( ) 
 
							 
						 
					
						
							
								
									
										
										
										
											2019-03-13 02:16:32 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								if ( GTSAM_WITH_EIGEN_MKL  AND  NOT  MKL_FOUND ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									message ( WARNING  "MKL was not found - this is ok, but note that MKL will be disabled.  Set GTSAM_WITH_EIGEN_MKL to 'Off' to disable this warning.  See INSTALL.md for notes on performance." ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								endif ( ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								if ( GTSAM_WITH_EIGEN_MKL_OPENMP  AND  NOT  OPENMP_FOUND  AND  MKL_FOUND ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									message ( WARNING  "Your compiler does not support OpenMP.  Set GTSAM_WITH_EIGEN_MKL_OPENMP to 'Off' to avoid this warning. See INSTALL.md for notes on performance." ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								endif ( ) 
 
							 
						 
					
						
							
								
									
										
										
										
											2016-01-21 14:13:22 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								if ( GTSAM_BUILD_PYTHON  AND  GTSAM_PYTHON_WARNINGS ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									message ( WARNING  "${GTSAM_PYTHON_WARNINGS}" ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								endif ( ) 
 
							 
						 
					
						
							
								
									
										
										
										
											2013-10-04 03:51:56 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								# Include CPack *after* all flags
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								include ( CPack )