2013-12-23 02:01:39 +08:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								# This file should be used as a template for creating new projects using the CMake tools
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								# This project has the following features
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								#    - GTSAM linking
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								#    - Unit tests via CppUnitLite
							 | 
						
					
						
							
								
									
										
										
										
											2014-05-07 10:05:59 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								#    - Scripts
							 | 
						
					
						
							
								
									
										
										
										
											2014-05-07 10:12:59 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								#    - Automatic MATLAB wrapper generation
							 | 
						
					
						
							
								
									
										
										
										
											2013-12-23 02:01:39 +08:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								###################################################################################
							 | 
						
					
						
							
								
									
										
										
										
											2014-05-07 10:05:59 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								# To create your own project, replace "example" with the actual name of your project
							 | 
						
					
						
							
								
									
										
										
										
											2013-12-23 02:01:39 +08:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								cmake_minimum_required(VERSION 2.6)
							 | 
						
					
						
							
								
									
										
										
										
											2014-05-07 10:05:59 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								project(example CXX C)
							 | 
						
					
						
							
								
									
										
										
										
											2013-12-23 02:01:39 +08:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2014-05-07 10:05:59 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								# Include GTSAM CMake tools
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								find_package(GTSAMCMakeTools)
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								include(GtsamBuildTypes) # Load build type flags and default to Debug mode
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								include(GtsamTesting)    # Easy functions for creating unit tests and scripts
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								include(GtsamMatlabWrap) # Automatic MATLAB wrapper generation
							 | 
						
					
						
							
								
									
										
										
										
											2013-12-23 02:01:39 +08:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								# Ensure that local folder is searched before library folders
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								include_directories(BEFORE "${PROJECT_SOURCE_DIR}")
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								###################################################################################
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								# Find GTSAM components
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								find_package(GTSAM REQUIRED) # Uses installed package
							 | 
						
					
						
							
								
									
										
										
										
											2014-05-07 10:05:59 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								include_directories(${GTSAM_INCLUDE_DIR})
							 | 
						
					
						
							
								
									
										
										
										
											2013-12-23 02:01:39 +08:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								###################################################################################
							 | 
						
					
						
							
								
									
										
										
										
											2014-05-07 10:05:59 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								# Build static library from common sources
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								set(CONVENIENCE_LIB_NAME ${PROJECT_NAME})
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								add_library(${CONVENIENCE_LIB_NAME} STATIC example/PrintExamples.h example/PrintExamples.cpp)
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								target_link_libraries(${CONVENIENCE_LIB_NAME} gtsam)
							 | 
						
					
						
							
								
									
										
										
										
											2013-12-23 02:01:39 +08:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								###################################################################################
							 | 
						
					
						
							
								
									
										
										
										
											2014-05-07 10:05:59 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								# Build tests (CMake tracks the dependecy to link with GTSAM through our project's static library)
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								gtsamAddTestsGlob("example" "tests/test*.cpp" "" "${CONVENIENCE_LIB_NAME}")
							 | 
						
					
						
							
								
									
										
										
										
											2013-12-23 02:01:39 +08:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								###################################################################################
							 | 
						
					
						
							
								
									
										
										
										
											2014-05-07 10:05:59 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								# Build scripts (CMake tracks the dependecy to link with GTSAM through our project's static library)
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								gtsamAddExamplesGlob("*.cpp" "" "${CONVENIENCE_LIB_NAME}")
							 | 
						
					
						
							
								
									
										
										
										
											2013-12-23 02:01:39 +08:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								###################################################################################
							 | 
						
					
						
							
								
									
										
										
										
											2014-05-07 10:14:03 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								# Build MATLAB wrapper (CMake tracks the dependecy to link with GTSAM through our project's static library)
							 | 
						
					
						
							
								
									
										
										
										
											2014-05-07 10:05:59 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								wrap_and_install_library("example.h" "${CONVENIENCE_LIB_NAME}" "" "")
							 |