From a454d0cdf6fe44512ad5aa9eff3e32380bb64451 Mon Sep 17 00:00:00 2001 From: Alex Cunningham Date: Tue, 31 Jan 2012 05:27:56 +0000 Subject: [PATCH] Rest of library and tests now build --- .cproject | 32 ++++++++++++++++++++ gtsam/CMakeLists.txt | 8 ++--- gtsam/inference/CMakeLists.txt | 50 ++++++++++++++++++++++++++++++++ gtsam/linear/CMakeLists.txt | 51 ++++++++++++++++++++++++++++++++ gtsam/nonlinear/CMakeLists.txt | 52 +++++++++++++++++++++++++++++++++ gtsam/slam/CMakeLists.txt | 53 ++++++++++++++++++++++++++++++++++ 6 files changed, 242 insertions(+), 4 deletions(-) create mode 100644 gtsam/inference/CMakeLists.txt create mode 100644 gtsam/linear/CMakeLists.txt create mode 100644 gtsam/nonlinear/CMakeLists.txt create mode 100644 gtsam/slam/CMakeLists.txt diff --git a/.cproject b/.cproject index e38672871..17b162e72 100644 --- a/.cproject +++ b/.cproject @@ -1738,6 +1738,38 @@ false true + + make + -j2 VERBOSE=1 + check.inference + true + false + true + + + make + -j2 VERBOSE=1 + check.linear + true + false + true + + + make + -j2 VERBOSE=1 + check.nonlinear + true + false + true + + + make + -j2 VERBOSE=1 + check.slam + true + false + true + make -j2 diff --git a/gtsam/CMakeLists.txt b/gtsam/CMakeLists.txt index 84bb3aad2..41f8f3d33 100644 --- a/gtsam/CMakeLists.txt +++ b/gtsam/CMakeLists.txt @@ -4,10 +4,10 @@ set (gtsam_subdirs 3rdparty base geometry - # inference - # linear - # nonlinear - # slam + inference + linear + nonlinear + slam ) foreach(subdir ${gtsam_subdirs}) diff --git a/gtsam/inference/CMakeLists.txt b/gtsam/inference/CMakeLists.txt new file mode 100644 index 000000000..5a458812d --- /dev/null +++ b/gtsam/inference/CMakeLists.txt @@ -0,0 +1,50 @@ +# Build convenience libraries +file(GLOB inference_srcs "*.cpp") +add_library(inference STATIC ${inference_srcs}) + +# link back to previous convenience library +add_dependencies(inference base) + +# Install headers +file(GLOB inference_headers "*.h") +install(FILES ${inference_headers} DESTINATION include/gtsam/inference) + +add_custom_target(check.inference COMMAND ${CMAKE_CTEST_COMMAND}) +add_custom_target(timing.inference) + +# Components to link tests in this subfolder against +set(inference_local_libs + inference + geometry + base + ccolamd + CppUnitLite +) + +# Build tests +file(GLOB inference_tests_srcs "tests/test*.cpp") +foreach(test_src ${inference_tests_srcs}) + get_filename_component(test_base ${test_src} NAME_WE) + set( test_bin inference.${test_base} ) + message(STATUS "Adding Test ${test_bin}") + add_executable(${test_bin} ${test_src}) + add_dependencies(check.inference ${test_bin}) + add_dependencies(check ${test_bin}) + add_test(${test_base} ${EXECUTABLE_OUTPUT_PATH}${test_bin}) + target_link_libraries(${test_bin} ${inference_local_libs}) + add_custom_target(${test_bin}.run ${EXECUTABLE_OUTPUT_PATH}${test_bin} ${ARGN}) +endforeach(test_src) + +# Build timing scripts +file(GLOB inference_timing_srcs "tests/time*.cpp") +foreach(time_src ${inference_timing_srcs}) + get_filename_component(time_base ${time_src} NAME_WE) + set( time_bin inference.${time_base} ) + message(STATUS "Adding Timing Benchmark ${time_bin}") + add_executable(${time_bin} ${time_src}) + add_dependencies(timing.inference ${time_bin}) + add_dependencies(timing ${time_bin}) + target_link_libraries(${time_bin} ${inference_local_libs}) + add_custom_target(${time_bin}.run ${EXECUTABLE_OUTPUT_PATH}${time_bin} ${ARGN}) +endforeach(time_src) + diff --git a/gtsam/linear/CMakeLists.txt b/gtsam/linear/CMakeLists.txt new file mode 100644 index 000000000..0bbfcc782 --- /dev/null +++ b/gtsam/linear/CMakeLists.txt @@ -0,0 +1,51 @@ +# Build convenience libraries +file(GLOB linear_srcs "*.cpp") +add_library(linear STATIC ${linear_srcs}) + +# link back to base +add_dependencies(linear inference) + +# Install headers +file(GLOB linear_headers "*.h") +install(FILES ${linear_headers} DESTINATION include/gtsam/linear) + +add_custom_target(check.linear COMMAND ${CMAKE_CTEST_COMMAND}) +add_custom_target(timing.linear) + +# Components to link tests in this subfolder against +set(linear_local_libs + linear + inference + geometry + base + ccolamd + CppUnitLite +) + +# Build tests +file(GLOB linear_tests_srcs "tests/test*.cpp") +foreach(test_src ${linear_tests_srcs}) + get_filename_component(test_base ${test_src} NAME_WE) + set( test_bin linear.${test_base} ) + message(STATUS "Adding Test ${test_bin}") + add_executable(${test_bin} ${test_src}) + add_dependencies(check.linear ${test_bin}) + add_dependencies(check ${test_bin}) + add_test(${test_base} ${EXECUTABLE_OUTPUT_PATH}${test_bin}) + target_link_libraries(${test_bin} ${linear_local_libs}) + add_custom_target(${test_bin}.run ${EXECUTABLE_OUTPUT_PATH}${test_bin} ${ARGN}) +endforeach(test_src) + +# Build timing scripts +file(GLOB linear_timing_srcs "tests/time*.cpp") +foreach(time_src ${linear_timing_srcs}) + get_filename_component(time_base ${time_src} NAME_WE) + set( time_bin linear.${time_base} ) + message(STATUS "Adding Timing Benchmark ${time_bin}") + add_executable(${time_bin} ${time_src}) + add_dependencies(timing.linear ${time_bin}) + add_dependencies(timing ${time_bin}) + target_link_libraries(${time_bin} ${linear_local_libs}) + add_custom_target(${time_bin}.run ${EXECUTABLE_OUTPUT_PATH}${time_bin} ${ARGN}) +endforeach(time_src) + diff --git a/gtsam/nonlinear/CMakeLists.txt b/gtsam/nonlinear/CMakeLists.txt new file mode 100644 index 000000000..211ef1810 --- /dev/null +++ b/gtsam/nonlinear/CMakeLists.txt @@ -0,0 +1,52 @@ +# Build convenience libraries +file(GLOB nonlinear_srcs "*.cpp") +add_library(nonlinear STATIC ${nonlinear_srcs}) + +# link back to base +add_dependencies(nonlinear linear) + +# Install headers +file(GLOB nonlinear_headers "*.h") +install(FILES ${nonlinear_headers} DESTINATION include/gtsam/nonlinear) + +add_custom_target(check.nonlinear COMMAND ${CMAKE_CTEST_COMMAND}) +add_custom_target(timing.nonlinear) + +# Components to link tests in this subfolder against +set(nonlinear_local_libs + nonlinear + linear + inference + geometry + base + ccolamd + CppUnitLite +) + +# Build tests +file(GLOB nonlinear_tests_srcs "tests/test*.cpp") +foreach(test_src ${nonlinear_tests_srcs}) + get_filename_component(test_base ${test_src} NAME_WE) + set( test_bin nonlinear.${test_base} ) + message(STATUS "Adding Test ${test_bin}") + add_executable(${test_bin} ${test_src}) + add_dependencies(check.nonlinear ${test_bin}) + add_dependencies(check ${test_bin}) + add_test(${test_base} ${EXECUTABLE_OUTPUT_PATH}${test_bin}) + target_link_libraries(${test_bin} ${nonlinear_local_libs}) + add_custom_target(${test_bin}.run ${EXECUTABLE_OUTPUT_PATH}${test_bin} ${ARGN}) +endforeach(test_src) + +# Build timing scripts +file(GLOB nonlinear_timing_srcs "tests/time*.cpp") +foreach(time_src ${nonlinear_timing_srcs}) + get_filename_component(time_base ${time_src} NAME_WE) + set( time_bin nonlinear.${time_base} ) + message(STATUS "Adding Timing Benchmark ${time_bin}") + add_executable(${time_bin} ${time_src}) + add_dependencies(timing.nonlinear ${time_bin}) + add_dependencies(timing ${time_bin}) + target_link_libraries(${time_bin} ${nonlinear_local_libs}) + add_custom_target(${time_bin}.run ${EXECUTABLE_OUTPUT_PATH}${time_bin} ${ARGN}) +endforeach(time_src) + diff --git a/gtsam/slam/CMakeLists.txt b/gtsam/slam/CMakeLists.txt new file mode 100644 index 000000000..08976d402 --- /dev/null +++ b/gtsam/slam/CMakeLists.txt @@ -0,0 +1,53 @@ +# Build convenience libraries +file(GLOB slam_srcs "*.cpp") +add_library(slam STATIC ${slam_srcs}) + +# link back to base +add_dependencies(slam nonlinear) + +# Install headers +file(GLOB slam_headers "*.h") +install(FILES ${slam_headers} DESTINATION include/gtsam/slam) + +add_custom_target(check.slam COMMAND ${CMAKE_CTEST_COMMAND}) +add_custom_target(timing.slam) + +# Components to link tests in this subfolder against +set(slam_local_libs + slam + nonlinear + linear + inference + geometry + base + ccolamd + CppUnitLite +) + +# Build tests +file(GLOB slam_tests_srcs "tests/test*.cpp") +foreach(test_src ${slam_tests_srcs}) + get_filename_component(test_base ${test_src} NAME_WE) + set( test_bin slam.${test_base} ) + message(STATUS "Adding Test ${test_bin}") + add_executable(${test_bin} ${test_src}) + add_dependencies(check.slam ${test_bin}) + add_dependencies(check ${test_bin}) + add_test(${test_base} ${EXECUTABLE_OUTPUT_PATH}${test_bin}) + target_link_libraries(${test_bin} ${slam_local_libs}) + add_custom_target(${test_bin}.run ${EXECUTABLE_OUTPUT_PATH}${test_bin} ${ARGN}) +endforeach(test_src) + +# Build timing scripts +file(GLOB slam_timing_srcs "tests/time*.cpp") +foreach(time_src ${slam_timing_srcs}) + get_filename_component(time_base ${time_src} NAME_WE) + set( time_bin slam.${time_base} ) + message(STATUS "Adding Timing Benchmark ${time_bin}") + add_executable(${time_bin} ${time_src}) + add_dependencies(timing.slam ${time_bin}) + add_dependencies(timing ${time_bin}) + target_link_libraries(${time_bin} ${slam_local_libs}) + add_custom_target(${time_bin}.run ${EXECUTABLE_OUTPUT_PATH}${time_bin} ${ARGN}) +endforeach(time_src) +