2013-12-23 02:01:39 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								# Add install prefix to search path
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								list ( APPEND  CMAKE_PREFIX_PATH  "${CMAKE_INSTALL_PREFIX}" ) 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								# Default to Release mode
  
						 
					
						
							
								
									
										
										
										
											2016-02-25 03:01:19 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								if ( NOT  CMAKE_BUILD_TYPE  AND  NOT  MSVC  AND  NOT  XCODE_VERSION ) 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    set ( GTSAM_CMAKE_BUILD_TYPE  "Release"  CACHE  STRING 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      " C h o o s e  t h e  t y p e  o f  b u i l d ,  o p t i o n s  a r e :  N o n e  D e b u g  R e l e a s e  T i m i n g  P r o f i l i n g  R e l W i t h D e b I n f o . " ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    set ( CMAKE_BUILD_TYPE  ${ GTSAM_CMAKE_BUILD_TYPE } ) 
 
							 
						 
					
						
							
								
									
										
										
										
											2013-12-23 02:01:39 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								endif ( ) 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								# Add option for using build type postfixes to allow installing multiple build modes
  
						 
					
						
							
								
									
										
										
										
											2014-01-31 03:41:25 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								option ( GTSAM_BUILD_TYPE_POSTFIXES         "Enable/Disable appending the build type to the name of compiled libraries"  ON ) 
  
						 
					
						
							
								
									
										
										
										
											2013-12-23 02:01:39 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2016-02-25 03:01:19 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								# Set custom compilation flags.
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								# NOTE: We set all the CACHE variables with a GTSAM prefix, and then set a normal local variable below
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								# so that we don't "pollute" the global variable namespace in the cmake cache.
  
						 
					
						
							
								
									
										
										
										
											2016-02-25 05:55:22 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								  # Set all CMAKE_BUILD_TYPE flags:
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  # (see https://cmake.org/Wiki/CMake_Useful_Variables#Compilers_and_Tools)
 
							 
						 
					
						
							
								
									
										
										
										
											2016-02-25 03:01:19 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								if ( MSVC ) 
  
						 
					
						
							
								
									
										
										
										
											2016-02-26 09:06:31 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    set ( GTSAM_CMAKE_C_FLAGS                   "/W3 /GR /EHsc /MP /DWINDOWS_LEAN_AND_MEAN"  CACHE  STRING  "Flags used by the compiler for all builds." ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    set ( GTSAM_CMAKE_CXX_FLAGS                 "/W3 /GR /EHsc /MP /DWINDOWS_LEAN_AND_MEAN"  CACHE  STRING  "Flags used by the compiler for all builds." ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    set ( GTSAM_CMAKE_C_FLAGS_DEBUG             "/D_DEBUG /MDd /Zi /Ob0 /Od /RTC1 /DEIGEN_INITIALIZE_MATRICES_BY_NAN"  CACHE  STRING  "Extra flags used by the compiler during debug builds." ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    set ( GTSAM_CMAKE_CXX_FLAGS_DEBUG           "/D_DEBUG /MDd /Zi /Ob0 /Od /RTC1 /DEIGEN_INITIALIZE_MATRICES_BY_NAN"  CACHE  STRING  "Extra flags used by the compiler during debug builds." ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    set ( GTSAM_CMAKE_C_FLAGS_RELWITHDEBINFO    "/MD /O2 /DNDEBUG /Zi /d2Zi+"  CACHE  STRING  "Extra flags used by the compiler during relwithdebinfo builds." ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    set ( GTSAM_CMAKE_CXX_FLAGS_RELWITHDEBINFO  "/MD /O2 /DNDEBUG /Zi /d2Zi+"  CACHE  STRING  "Extra flags used by the compiler during relwithdebinfo builds." ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    set ( GTSAM_CMAKE_C_FLAGS_RELEASE           "/MD /O2 /DNDEBUG"  CACHE  STRING  "Extra flags used by the compiler during release builds." ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    set ( GTSAM_CMAKE_CXX_FLAGS_RELEASE         "/MD /O2 /DNDEBUG"  CACHE  STRING  "Extra flags used by the compiler during release builds." ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    set ( GTSAM_CMAKE_C_FLAGS_PROFILING         "${GTSAM_CMAKE_C_FLAGS_RELEASE}   /Zi"  CACHE  STRING  "Extra flags used by the compiler during profiling builds." ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    set ( GTSAM_CMAKE_CXX_FLAGS_PROFILING       "${GTSAM_CMAKE_CXX_FLAGS_RELEASE} /Zi"  CACHE  STRING  "Extra flags used by the compiler during profiling builds." ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    set ( GTSAM_CMAKE_C_FLAGS_TIMING            "${GTSAM_CMAKE_C_FLAGS_RELEASE}   /DENABLE_TIMING"  CACHE  STRING  "Extra flags used by the compiler during timing builds." ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    set ( GTSAM_CMAKE_CXX_FLAGS_TIMING          "${GTSAM_CMAKE_CXX_FLAGS_RELEASE} /DENABLE_TIMING"  CACHE  STRING  "Extra flags used by the compiler during timing builds." ) 
 
							 
						 
					
						
							
								
									
										
										
										
											2016-02-25 03:01:19 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								else ( ) 
  
						 
					
						
							
								
									
										
										
										
											2016-02-26 09:06:31 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    set ( GTSAM_CMAKE_C_FLAGS                   "-std=c11   -Wall"  CACHE  STRING  "Flags used by the compiler for all builds." ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    set ( GTSAM_CMAKE_CXX_FLAGS                 "-std=c++11 -Wall"  CACHE  STRING  "Flags used by the compiler for all builds." ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    set ( GTSAM_CMAKE_C_FLAGS_DEBUG             "-g -fno-inline -DEIGEN_INITIALIZE_MATRICES_BY_NAN"  CACHE  STRING  "Extra flags used by the compiler during debug builds." ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    set ( GTSAM_CMAKE_CXX_FLAGS_DEBUG           "-g -fno-inline -DEIGEN_INITIALIZE_MATRICES_BY_NAN"  CACHE  STRING  "Extra flags used by the compiler during debug builds." ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    set ( GTSAM_CMAKE_C_FLAGS_RELWITHDEBINFO    "-g -O3 -DNDEBUG"  CACHE  STRING  "Extra flags used by the compiler during relwithdebinfo builds." ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    set ( GTSAM_CMAKE_CXX_FLAGS_RELWITHDEBINFO  "-g -O3 -DNDEBUG"  CACHE  STRING  "Extra flags used by the compiler during relwithdebinfo builds." ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    set ( GTSAM_CMAKE_C_FLAGS_RELEASE           "   -O3 -DNDEBUG"  CACHE  STRING  "Extra flags used by the compiler during release builds." ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    set ( GTSAM_CMAKE_CXX_FLAGS_RELEASE         "   -O3 -DNDEBUG"  CACHE  STRING  "Extra flags used by the compiler during release builds." ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    set ( GTSAM_CMAKE_C_FLAGS_PROFILING         "${GTSAM_CMAKE_C_FLAGS_RELEASE}"  CACHE  STRING  "Extra flags used by the compiler during profiling builds." ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    set ( GTSAM_CMAKE_CXX_FLAGS_PROFILING       "${GTSAM_CMAKE_CXX_FLAGS_RELEASE}"  CACHE  STRING  "Extra flags used by the compiler during profiling builds." ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    set ( GTSAM_CMAKE_C_FLAGS_TIMING            "${GTSAM_CMAKE_C_FLAGS_RELEASE} -DENABLE_TIMING"  CACHE  STRING  "Extra flags used by the compiler during timing builds." ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    set ( GTSAM_CMAKE_CXX_FLAGS_TIMING          "${GTSAM_CMAKE_CXX_FLAGS_RELEASE} -DENABLE_TIMING"  CACHE  STRING  "Extra flags used by the compiler during timing builds." ) 
 
							 
						 
					
						
							
								
									
										
										
										
											2013-12-23 02:01:39 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								endif ( ) 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2016-02-25 03:01:19 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								set ( GTSAM_CMAKE_SHARED_LINKER_FLAGS_TIMING   "${CMAKE_SHARED_LINKER_FLAGS_RELEASE}"  CACHE  STRING  "Linker flags during timing builds." ) 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								set ( GTSAM_CMAKE_MODULE_LINKER_FLAGS_TIMING   "${CMAKE_MODULE_LINKER_FLAGS_RELEASE}"  CACHE  STRING  "Linker flags during timing builds." ) 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								set ( GTSAM_CMAKE_EXE_LINKER_FLAGS_TIMING      "${CMAKE_EXE_LINKER_FLAGS_RELEASE}"  CACHE  STRING  "Linker flags during timing builds." ) 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								set ( GTSAM_CMAKE_SHARED_LINKER_FLAGS_PROFILING  "${CMAKE_SHARED_LINKER_FLAGS_RELEASE}"  CACHE  STRING  "Linker flags during profiling builds." ) 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								set ( GTSAM_CMAKE_MODULE_LINKER_FLAGS_PROFILING  "${CMAKE_MODULE_LINKER_FLAGS_RELEASE}"  CACHE  STRING  "Linker flags during profiling builds." ) 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								set ( GTSAM_CMAKE_EXE_LINKER_FLAGS_PROFILING     "${CMAKE_EXE_LINKER_FLAGS_RELEASE}"  CACHE  STRING  "Linker flags during profiling builds." ) 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								mark_as_advanced ( GTSAM_CMAKE_C_FLAGS_TIMING  GTSAM_CMAKE_CXX_FLAGS_TIMING  GTSAM_CMAKE_EXE_LINKER_FLAGS_TIMING   
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                 G T S A M _ C M A K E _ S H A R E D _ L I N K E R _ F L A G S _ T I M I N G  G T S A M _ C M A K E _ M O D U L E _ L I N K E R _ F L A G S _ T I M I N G 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                 G T S A M _ C M A K E _ C _ F L A G S _ P R O F I L I N G  G T S A M _ C M A K E _ C X X _ F L A G S _ P R O F I L I N G  G T S A M _ C M A K E _ E X E _ L I N K E R _ F L A G S _ P R O F I L I N G  
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                 G T S A M _ C M A K E _ S H A R E D _ L I N K E R _ F L A G S _ P R O F I L I N G  G T S A M _ C M A K E _ M O D U L E _ L I N K E R _ F L A G S _ P R O F I L I N G ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								# Apply the gtsam specific build flags as normal variables. This makes it so that they only
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								# apply to the gtsam part of the build if gtsam is built as a subproject
  
						 
					
						
							
								
									
										
										
										
											2016-02-26 12:46:21 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								set ( CMAKE_C_FLAGS    ${ GTSAM_CMAKE_C_FLAGS } ) 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								set ( CMAKE_CXX_FLAGS  ${ GTSAM_CMAKE_CXX_FLAGS } ) 
  
						 
					
						
							
								
									
										
										
										
											2016-02-25 03:01:19 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								set ( CMAKE_C_FLAGS_DEBUG  ${ GTSAM_CMAKE_C_FLAGS_DEBUG } ) 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								set ( CMAKE_CXX_FLAGS_DEBUG  ${ GTSAM_CMAKE_CXX_FLAGS_DEBUG } ) 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								set ( CMAKE_C_FLAGS_RELWITHDEBINFO  ${ GTSAM_CMAKE_C_FLAGS_RELWITHDEBINFO } ) 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								set ( CMAKE_CXX_FLAGS_RELWITHDEBINFO  ${ GTSAM_CMAKE_CXX_FLAGS_RELWITHDEBINFO } ) 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								set ( CMAKE_C_FLAGS_RELEASE  ${ GTSAM_CMAKE_C_FLAGS_RELEASE } ) 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								set ( CMAKE_CXX_FLAGS_RELEASE  ${ GTSAM_CMAKE_CXX_FLAGS_RELEASE } ) 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								set ( CMAKE_C_FLAGS_PROFILING  ${ GTSAM_CMAKE_C_FLAGS_PROFILING } ) 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								set ( CMAKE_CXX_FLAGS_PROFILING  ${ GTSAM_CMAKE_CXX_FLAGS_PROFILING } ) 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								set ( CMAKE_C_FLAGS_TIMING  ${ GTSAM_CMAKE_C_FLAGS_TIMING } ) 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								set ( CMAKE_CXX_FLAGS_TIMING  ${ GTSAM_CMAKE_CXX_FLAGS_TIMING } ) 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								set ( CMAKE_SHARED_LINKER_FLAGS_TIMING  ${ GTSAM_CMAKE_SHARED_LINKER_FLAGS_TIMING } ) 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								set ( CMAKE_MODULE_LINKER_FLAGS_TIMING  ${ GTSAM_CMAKE_MODULE_LINKER_FLAGS_TIMING } ) 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								set ( CMAKE_EXE_LINKER_FLAGS_TIMING  ${ GTSAM_CMAKE_EXE_LINKER_FLAGS_TIMING } ) 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								set ( CMAKE_SHARED_LINKER_FLAGS_PROFILING  ${ GTSAM_CMAKE_SHARED_LINKER_FLAGS_PROFILING } ) 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								set ( CMAKE_MODULE_LINKER_FLAGS_PROFILING  ${ GTSAM_CMAKE_MODULE_LINKER_FLAGS_PROFILING } ) 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								set ( CMAKE_EXE_LINKER_FLAGS_PROFILING  ${ GTSAM_CMAKE_EXE_LINKER_FLAGS_PROFILING } ) 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2015-04-09 20:01:16 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								# Clang uses a template depth that is less than standard and is too small
  
						 
					
						
							
								
									
										
										
										
											2015-01-16 22:33:02 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								if ( ${ CMAKE_CXX_COMPILER_ID }  STREQUAL  "Clang" ) 
  
						 
					
						
							
								
									
										
										
										
											2015-04-09 20:01:16 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    # Apple Clang before 5.0 does not support -ftemplate-depth.
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    if ( NOT  ( APPLE  AND  "${CMAKE_CXX_COMPILER_VERSION}"  VERSION_LESS  "5.0" ) ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        set ( CMAKE_CXX_FLAGS  "${CMAKE_CXX_FLAGS} -ftemplate-depth=1024" ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    endif ( ) 
 
							 
						 
					
						
							
								
									
										
										
										
											2013-12-23 02:01:39 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								endif ( ) 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								# Set up build type library postfixes
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								if ( GTSAM_BUILD_TYPE_POSTFIXES ) 
  
						 
					
						
							
								
									
										
										
										
											2016-02-25 03:01:19 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								  foreach ( build_type  Debug  Timing  Profiling  RelWithDebInfo  MinSizeRel ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    string ( TOUPPER  "${build_type}"  build_type_toupper ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    set ( CMAKE_ ${ build_type_toupper } _POSTFIX  ${ build_type } ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  endforeach ( ) 
 
							 
						 
					
						
							
								
									
										
										
										
											2013-12-23 02:01:39 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								endif ( ) 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								# Make common binary output directory when on Windows
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								if ( WIN32 ) 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  set ( RUNTIME_OUTPUT_PATH  "${CMAKE_BINARY_DIR}/bin" ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  set ( EXECUTABLE_OUTPUT_PATH  "${CMAKE_BINARY_DIR}/bin" ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  set ( LIBRARY_OUTPUT_PATH  "${CMAKE_BINARY_DIR}/lib" ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								endif ( ) 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								# Set up build type list for cmake-gui
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								if ( NOT  "${CMAKE_BUILD_TYPE}"  STREQUAL  "" ) 
  
						 
					
						
							
								
									
										
										
										
											2016-02-25 03:01:19 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								  if ( ${ CMAKE_MAJOR_VERSION } . ${ CMAKE_MINOR_VERSION }  VERSION_GREATER  2.8  OR  ${ CMAKE_MAJOR_VERSION } . ${ CMAKE_MINOR_VERSION }  VERSION_EQUAL  2.8 ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    set_property ( CACHE  CMAKE_BUILD_TYPE  PROPERTY  STRINGS  None  Debug  Release  Timing  Profiling  RelWithDebInfo  MinSizeRel ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  endif ( ) 
 
							 
						 
					
						
							
								
									
										
										
										
											2013-12-23 02:01:39 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								endif ( ) 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								# Set up build types for MSVC and XCode
  
						 
					
						
							
								
									
										
										
										
											2016-02-25 03:01:19 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								set ( GTSAM_CMAKE_CONFIGURATION_TYPES  Debug  Release  Timing  Profiling  RelWithDebInfo  MinSizeRel  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      C A C H E  S T R I N G  " B u i l d  t y p e s  a v a i l a b l e  t o  MSVC  a n d  X C o d e " ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								mark_as_advanced ( FORCE  GTSAM_CMAKE_CONFIGURATION_TYPES ) 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								set ( CMAKE_CONFIGURATION_TYPES  ${ GTSAM_CMAKE_CONFIGURATION_TYPES } ) 
  
						 
					
						
							
								
									
										
										
										
											2013-12-23 02:01:39 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								# Check build types
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								string ( TOLOWER  "${CMAKE_BUILD_TYPE}"  cmake_build_type_tolower ) 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								if (     NOT  cmake_build_type_tolower  STREQUAL  ""  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								   A N D  N O T  c m a k e _ b u i l d _ t y p e _ t o l o w e r  S T R E Q U A L  " n o n e " 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								   A N D  N O T  c m a k e _ b u i l d _ t y p e _ t o l o w e r  S T R E Q U A L  " d e b u g " 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								   A N D  N O T  c m a k e _ b u i l d _ t y p e _ t o l o w e r  S T R E Q U A L  " r e l e a s e " 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								   A N D  N O T  c m a k e _ b u i l d _ t y p e _ t o l o w e r  S T R E Q U A L  " t i m i n g " 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								   A N D  N O T  c m a k e _ b u i l d _ t y p e _ t o l o w e r  S T R E Q U A L  " p r o f i l i n g " 
 
							 
						 
					
						
							
								
									
										
										
										
											2015-05-14 13:26:24 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								   A N D  N O T  c m a k e _ b u i l d _ t y p e _ t o l o w e r  S T R E Q U A L  " r e l w i t h d e b i n f o " 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								   A N D  N O T  c m a k e _ b u i l d _ t y p e _ t o l o w e r  S T R E Q U A L  " m i n s i z e r e l " ) 
 
							 
						 
					
						
							
								
									
										
										
										
											2016-02-25 03:01:19 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								  message ( FATAL_ERROR  "Unknown build type \" ${ CMAKE_BUILD_TYPE } \".  Allowed  values  are  None,  Debug,  Release,  Timing,  Profiling,  RelWithDebInfo,  MinSizeRel  ( case-insensitive ) . " ) 
 
							 
						 
					
						
							
								
									
										
										
										
											2013-12-23 02:01:39 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								endif ( ) 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								# Enable Visual Studio solution folders
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								set_property ( GLOBAL  PROPERTY  USE_FOLDERS  On ) 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								# Function for automatically assigning source folders
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								function ( gtsam_assign_source_folders ) 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  set ( FILES  ${ ARGV } ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  foreach ( file  ${ FILES } ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    file ( RELATIVE_PATH  relative_file  "${CMAKE_CURRENT_SOURCE_DIR}"  "${file}" ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    get_filename_component ( relative_path  "${relative_file}"  PATH ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    file ( TO_NATIVE_PATH  "${relative_path}"  relative_path ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    source_group ( "${relative_path}"  FILES  "${file}" ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  endforeach ( ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								endfunction ( ) 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								# Find and assign all source and header files
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								function ( gtsam_assign_all_source_folders ) 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  file ( GLOB_RECURSE  all_c_srcs  "*.c" ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  file ( GLOB_RECURSE  all_cpp_srcs  "*.cpp" ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  file ( GLOB_RECURSE  all_headers  "*.h" ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  gtsam_assign_source_folders ( "${all_c_srcs};${all_cpp_srcs};${all_headers}" ) 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								endfunction ( )