Added flag to link against local convenience libraries for tests
							parent
							
								
									c3f8c791b2
								
							
						
					
					
						commit
						28f2276cc4
					
				|  | @ -39,6 +39,8 @@ option(GTSAM_BUILD_TESTS    "Enable/Disable building of tests"          ON) | |||
| option(GTSAM_BUILD_TIMING   "Enable/Disable building of timing scripts" ON) | ||||
| option(GTSAM_BUILD_EXAMPLES "Enable/Disable building of examples"       ON) | ||||
| option(GTSAM_BUILD_WRAP     "Enable/Disable building of matlab wrap utility (necessary for matlab interface)" ON) | ||||
| option(GTSAM_LINK_BINARIES_AGAINST_CONVENIENCE_LIBS     | ||||
|     "Enable/Disable linking tests against the convenince libraries for faster debugging" ON) | ||||
| 
 | ||||
| # Avoid building non-installed exes and unit tests when installing | ||||
| # FIXME: breaks generation and install of matlab toolbox | ||||
|  |  | |||
|  | @ -1,3 +1,17 @@ | |||
| if (GTSAM_LINK_BINARIES_AGAINST_CONVENIENCE_LIBS) | ||||
|     set(convenience_libs | ||||
|        slam | ||||
|        nonlinear | ||||
|        linear | ||||
|        inference | ||||
|        geometry | ||||
|        base | ||||
|        ccolamd) | ||||
| else (GTSAM_LINK_BINARIES_AGAINST_CONVENIENCE_LIBS) | ||||
|     set(convenience_libs | ||||
|        gtsam-static) | ||||
| endif (GTSAM_LINK_BINARIES_AGAINST_CONVENIENCE_LIBS) | ||||
| 
 | ||||
| # Build tests | ||||
| if (GTSAM_BUILD_TESTS) | ||||
|     add_custom_target(check.tests COMMAND ${CMAKE_CTEST_COMMAND}) | ||||
|  | @ -10,7 +24,7 @@ if (GTSAM_BUILD_TESTS) | |||
|         add_dependencies(check.tests ${test_bin}) | ||||
|         add_dependencies(check ${test_bin}) | ||||
|         add_test(${test_base} ${EXECUTABLE_OUTPUT_PATH}${test_bin}) | ||||
|         target_link_libraries(${test_bin} gtsam-static CppUnitLite ${Boost_LIBRARIES}) | ||||
|         target_link_libraries(${test_bin} ${convenience_libs} CppUnitLite ${Boost_LIBRARIES}) | ||||
|         add_custom_target(${test_bin}.run ${EXECUTABLE_OUTPUT_PATH}${test_bin} ${ARGN}) | ||||
|     endforeach(test_src) | ||||
| endif (GTSAM_BUILD_TESTS) | ||||
|  | @ -26,7 +40,7 @@ if (GTSAM_BUILD_TIMING) | |||
|         add_executable(${time_bin} ${time_src}) | ||||
|         add_dependencies(timing.tests ${time_bin}) | ||||
|         add_dependencies(timing ${time_bin}) | ||||
|         target_link_libraries(${time_bin} gtsam-static CppUnitLite ${Boost_LIBRARIES}) | ||||
|         target_link_libraries(${time_bin} ${convenience_libs} CppUnitLite ${Boost_LIBRARIES}) | ||||
|         add_custom_target(${time_bin}.run ${EXECUTABLE_OUTPUT_PATH}${time_bin} ${ARGN}) | ||||
|     endforeach(time_src) | ||||
| endif (GTSAM_BUILD_TIMING) | ||||
|  |  | |||
|  | @ -16,6 +16,20 @@ endif(GTSAM_INSTALL_WRAP) | |||
| # Install matlab header | ||||
| install(FILES matlab.h DESTINATION ${CMAKE_INSTALL_PREFIX}/include/wrap) | ||||
| 
 | ||||
| if (GTSAM_LINK_BINARIES_AGAINST_CONVENIENCE_LIBS) | ||||
|     set(convenience_libs | ||||
|        slam | ||||
|        nonlinear | ||||
|        linear | ||||
|        inference | ||||
|        geometry | ||||
|        base | ||||
|        ccolamd) | ||||
| else (GTSAM_LINK_BINARIES_AGAINST_CONVENIENCE_LIBS) | ||||
|     set(convenience_libs | ||||
|        gtsam-static) | ||||
| endif (GTSAM_LINK_BINARIES_AGAINST_CONVENIENCE_LIBS) | ||||
| 
 | ||||
| # Build tests | ||||
| if (GTSAM_BUILD_TESTS) | ||||
|     add_custom_target(check.wrap COMMAND ${CMAKE_CTEST_COMMAND}) | ||||
|  | @ -28,7 +42,7 @@ if (GTSAM_BUILD_TESTS) | |||
|         add_test(${test_base} ${EXECUTABLE_OUTPUT_PATH}${test_bin}) | ||||
|         add_dependencies(check ${test_bin}) | ||||
|         add_dependencies(check.wrap ${test_bin}) | ||||
|         target_link_libraries(${test_bin} CppUnitLite gtsam-static wrap_lib) | ||||
|         target_link_libraries(${test_bin} CppUnitLite ${convenience_libs} wrap_lib) | ||||
|         add_custom_target(${test_bin}.run ${EXECUTABLE_OUTPUT_PATH}${test_bin} ${ARGN}) | ||||
|     endforeach(test_src) | ||||
| endif(GTSAM_BUILD_TESTS) | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue