2011-12-14 10:24:21 +08:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								# Build/install Wrap
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								# Build the executable itself
							 | 
						
					
						
							
								
									
										
										
										
											2011-12-14 10:24:25 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								file(GLOB wrap_srcs "*.cpp")
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								list(REMOVE_ITEM wrap_srcs wrap.cpp)
							 | 
						
					
						
							
								
									
										
										
										
											2011-12-14 10:24:21 +08:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								add_library(wrapLib STATIC ${wrap_srcs})
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								add_executable(wrap wrap.cpp)
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								target_link_libraries(wrap wrapLib)
							 | 
						
					
						
							
								
									
										
										
										
											2011-12-14 10:24:25 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								install(TARGETS wrap DESTINATION ${CMAKE_INSTALL_PREFIX}/bin)
							 | 
						
					
						
							
								
									
										
										
										
											2011-12-14 10:24:21 +08:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								# Build tests
							 | 
						
					
						
							
								
									
										
										
										
											2011-12-14 10:24:25 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								file(GLOB wrap_test_srcs "tests/test*.cpp")
							 | 
						
					
						
							
								
									
										
										
										
											2011-12-14 10:24:21 +08:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								add_definitions(-DTOPSRCDIR="${CMAKE_SOURCE_DIR}")
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								foreach(test_src ${wrap_test_srcs} )
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    get_filename_component(test_base ${test_src} NAME_WE)
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    set( test_bin wrap_${test_base} )
							 | 
						
					
						
							
								
									
										
										
										
											2011-12-14 10:24:23 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    add_executable(${test_bin} EXCLUDE_FROM_ALL ${test_src})
							 | 
						
					
						
							
								
									
										
										
										
											2011-12-14 10:24:21 +08:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    add_test(${test_base} ${EXECUTABLE_OUTPUT_PATH}${test_bin})
							 | 
						
					
						
							
								
									
										
										
										
											2011-12-14 10:24:23 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    add_dependencies(check ${test_bin})
							 | 
						
					
						
							
								
									
										
										
										
											2011-12-16 00:17:58 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    target_link_libraries(${test_bin} CppUnitLite gtsam-static wrapLib)
							 | 
						
					
						
							
								
									
										
										
										
											2011-12-14 10:24:21 +08:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    add_custom_target(${test_bin}.run ${EXECUTABLE_OUTPUT_PATH}${test_bin} ${ARGN})
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								endforeach(test_src)
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2011-12-14 10:24:25 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								# Install matlab header
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								install(FILES matlab.h DESTINATION ${CMAKE_INSTALL_PREFIX}/include/wrap)
							 |