Now builds full gtsam library
parent
a454d0cdf6
commit
927ac34014
|
|
@ -1770,6 +1770,14 @@
|
||||||
<useDefaultCommand>false</useDefaultCommand>
|
<useDefaultCommand>false</useDefaultCommand>
|
||||||
<runAllBuilders>true</runAllBuilders>
|
<runAllBuilders>true</runAllBuilders>
|
||||||
</target>
|
</target>
|
||||||
|
<target name="gtsam-static" path="build_cmake" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
|
||||||
|
<buildCommand>make</buildCommand>
|
||||||
|
<buildArguments>-j2</buildArguments>
|
||||||
|
<buildTarget>gtsam-static</buildTarget>
|
||||||
|
<stopOnError>true</stopOnError>
|
||||||
|
<useDefaultCommand>true</useDefaultCommand>
|
||||||
|
<runAllBuilders>true</runAllBuilders>
|
||||||
|
</target>
|
||||||
<target name="tests/testDSFVector.run" path="build/gtsam/base" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
|
<target name="tests/testDSFVector.run" path="build/gtsam/base" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
|
||||||
<buildCommand>make</buildCommand>
|
<buildCommand>make</buildCommand>
|
||||||
<buildArguments>-j2</buildArguments>
|
<buildArguments>-j2</buildArguments>
|
||||||
|
|
|
||||||
|
|
@ -16,10 +16,9 @@ foreach(eigen_dir ${eigen_dir_headers_all})
|
||||||
endif()
|
endif()
|
||||||
endforeach(eigen_dir)
|
endforeach(eigen_dir)
|
||||||
|
|
||||||
# build convenience library
|
## build convenience library
|
||||||
set (ccolamd_srcs
|
#set (3rdparty_srcs
|
||||||
CCOLAMD/Source/ccolamd.c
|
# CCOLAMD/Source/ccolamd.c
|
||||||
CCOLAMD/Source/ccolamd_global.c
|
# CCOLAMD/Source/ccolamd_global.c
|
||||||
UFconfig/UFconfig.c)
|
# UFconfig/UFconfig.c)
|
||||||
|
#add_library(ccolamd STATIC ${3rdparty_srcs})
|
||||||
add_library(ccolamd STATIC ${ccolamd_srcs})
|
|
||||||
|
|
@ -1,88 +1,69 @@
|
||||||
# Build full gtsam library as a single library
|
# Build full gtsam library as a single library
|
||||||
# and also build tests
|
# and also build tests
|
||||||
set (gtsam_subdirs
|
set (gtsam_subdirs
|
||||||
3rdparty
|
|
||||||
base
|
base
|
||||||
geometry
|
geometry
|
||||||
inference
|
inference
|
||||||
linear
|
linear
|
||||||
nonlinear
|
nonlinear
|
||||||
slam
|
slam
|
||||||
)
|
)
|
||||||
|
|
||||||
|
set(gtsam_srcs)
|
||||||
|
|
||||||
|
# Build 3rdparty separately
|
||||||
|
message(STATUS "Building 3rdparty")
|
||||||
|
add_subdirectory(3rdparty)
|
||||||
|
|
||||||
|
# build convenience library
|
||||||
|
set (3rdparty_srcs
|
||||||
|
3rdparty/CCOLAMD/Source/ccolamd.c
|
||||||
|
3rdparty/CCOLAMD/Source/ccolamd_global.c
|
||||||
|
3rdparty/UFconfig/UFconfig.c)
|
||||||
|
add_library(ccolamd STATIC ${3rdparty_srcs})
|
||||||
|
|
||||||
|
# assemble core libaries
|
||||||
foreach(subdir ${gtsam_subdirs})
|
foreach(subdir ${gtsam_subdirs})
|
||||||
|
# Build convenience libraries
|
||||||
|
file(GLOB subdir_srcs "${subdir}/*.cpp")
|
||||||
|
add_library(${subdir} STATIC ${subdir_srcs})
|
||||||
|
set(${subdir}_srcs ${subdir_srcs})
|
||||||
|
|
||||||
# Build local library and tests
|
# Build local library and tests
|
||||||
message(STATUS "Building ${subdir}")
|
message(STATUS "Building ${subdir}")
|
||||||
add_subdirectory(${subdir})
|
add_subdirectory(${subdir})
|
||||||
endforeach(subdir)
|
endforeach(subdir)
|
||||||
|
|
||||||
#set (ccolamd_srcs
|
# assemble gtsam components
|
||||||
# 3rdparty/CCOLAMD/Source/ccolamd.c
|
set(gtsam_srcs
|
||||||
# 3rdparty/CCOLAMD/Source/ccolamd_global.c
|
${3rdparty_srcs}
|
||||||
# 3rdparty/UFconfig/UFconfig.c)
|
${base_srcs}
|
||||||
#
|
${geometry_srcs}
|
||||||
## install headers from 3rdparty libraries
|
${inference_srcs}
|
||||||
#add_subdirectory(3rdparty)
|
${linear_srcs}
|
||||||
#
|
${nonlinear_srcs}
|
||||||
## Accumulate gtsam_srcs
|
${slam_srcs}
|
||||||
#set(gtsam_srcs ${ccolamd_srcs})
|
)
|
||||||
#
|
|
||||||
## Get all sources and headers from each subdirectory
|
# build shared and static versions of the library
|
||||||
#foreach(subdir ${gtsam_subdirs})
|
message(STATUS "Building GTSAM - static")
|
||||||
# message(STATUS "Building ${subdir}")
|
message(STATUS "GTSAM library sources ${gtsam_srcs}")
|
||||||
# file(GLOB sub_gtsam_srcs "${subdir}/*.cpp")
|
add_library(gtsam-static STATIC ${gtsam_srcs})
|
||||||
# list(APPEND gtsam_srcs ${sub_gtsam_srcs})
|
set_target_properties(gtsam-static PROPERTIES OUTPUT_NAME gtsam)
|
||||||
#
|
set_target_properties(gtsam-static PROPERTIES CLEAN_DIRECT_OUTPUT 1)
|
||||||
# # install headers
|
set_target_properties(gtsam-static PROPERTIES
|
||||||
# file(GLOB sub_gtsam_headers "${subdir}/*.h")
|
VERSION "${GTSAM_VERSION_MAJOR}.${GTSAM_VERSION_MINOR}.${GTSAM_VERSION_PATCH}"
|
||||||
# install(FILES ${sub_gtsam_headers} DESTINATION include/gtsam/${subdir})
|
SOVERSION "${GTSAM_VERSION_MAJOR}.${GTSAM_VERSION_MINOR}.${GTSAM_VERSION_PATCH}"
|
||||||
#endforeach(subdir)
|
)
|
||||||
#
|
install(TARGETS gtsam-static ARCHIVE DESTINATION lib)
|
||||||
## build shared and static versions of the library
|
|
||||||
#add_library(${PROJECT_NAME}-static STATIC ${gtsam_srcs})
|
message(STATUS "Building GTSAM - shared")
|
||||||
#set_target_properties(${PROJECT_NAME}-static PROPERTIES OUTPUT_NAME "${PROJECT_NAME}")
|
add_library(gtsam-shared SHARED ${gtsam_srcs})
|
||||||
#set_target_properties(${PROJECT_NAME}-static PROPERTIES CLEAN_DIRECT_OUTPUT 1)
|
set_target_properties(gtsam-shared PROPERTIES OUTPUT_NAME gtsam)
|
||||||
#set_target_properties(${PROJECT_NAME}-static PROPERTIES
|
set_target_properties(gtsam-shared PROPERTIES CLEAN_DIRECT_OUTPUT 1)
|
||||||
# VERSION "${GTSAM_VERSION_MAJOR}.${GTSAM_VERSION_MINOR}.${GTSAM_VERSION_PATCH}"
|
set_target_properties(gtsam-shared PROPERTIES
|
||||||
# SOVERSION "${GTSAM_VERSION_MAJOR}.${GTSAM_VERSION_MINOR}.${GTSAM_VERSION_PATCH}"
|
VERSION "${GTSAM_VERSION_MAJOR}.${GTSAM_VERSION_MINOR}.${GTSAM_VERSION_PATCH}"
|
||||||
# )
|
SOVERSION "${GTSAM_VERSION_MAJOR}.${GTSAM_VERSION_MINOR}.${GTSAM_VERSION_PATCH}"
|
||||||
#install(TARGETS ${PROJECT_NAME}-static ARCHIVE DESTINATION lib)
|
)
|
||||||
#
|
install(TARGETS gtsam-shared LIBRARY DESTINATION lib )
|
||||||
#add_library(${PROJECT_NAME}-shared SHARED ${gtsam_srcs})
|
|
||||||
#set_target_properties(${PROJECT_NAME}-shared PROPERTIES OUTPUT_NAME "${PROJECT_NAME}")
|
|
||||||
#set_target_properties(${PROJECT_NAME}-shared PROPERTIES CLEAN_DIRECT_OUTPUT 1)
|
|
||||||
#set_target_properties(${PROJECT_NAME}-shared PROPERTIES
|
|
||||||
# VERSION "${GTSAM_VERSION_MAJOR}.${GTSAM_VERSION_MINOR}.${GTSAM_VERSION_PATCH}"
|
|
||||||
# SOVERSION "${GTSAM_VERSION_MAJOR}.${GTSAM_VERSION_MINOR}.${GTSAM_VERSION_PATCH}"
|
|
||||||
# )
|
|
||||||
#
|
|
||||||
#install(TARGETS ${PROJECT_NAME}-shared LIBRARY DESTINATION lib )
|
|
||||||
#
|
|
||||||
## Get all sources and headers from each
|
|
||||||
#foreach(subdir ${gtsam_subdirs})
|
|
||||||
# # Build tests
|
|
||||||
# file(GLOB tests_srcs "${subdir}/tests/test*.cpp")
|
|
||||||
# foreach(test_src ${tests_srcs})
|
|
||||||
# get_filename_component(test_base ${test_src} NAME_WE)
|
|
||||||
# set( test_bin ${subdir}_${test_base} )
|
|
||||||
# add_executable(${test_bin} EXCLUDE_FROM_ALL ${test_src})
|
|
||||||
# add_dependencies(${test_bin} ${PROJECT_NAME}-static)
|
|
||||||
# add_dependencies(check ${test_bin})
|
|
||||||
# add_test(${subdir}/${test_base} ${EXECUTABLE_OUTPUT_PATH}${test_bin})
|
|
||||||
# target_link_libraries(${test_bin} CppUnitLite gtsam-static)
|
|
||||||
# add_custom_target(${test_bin}.run ${EXECUTABLE_OUTPUT_PATH}${test_bin} ${ARGN})
|
|
||||||
# endforeach(test_src)
|
|
||||||
#
|
|
||||||
# # Build timing scripts
|
|
||||||
# file(GLOB time_srcs "${subdir}/tests/time*.cpp")
|
|
||||||
# foreach(time_src ${time_srcs})
|
|
||||||
# get_filename_component(time_base ${time_src} NAME_WE)
|
|
||||||
# set( time_bin ${time_base} )
|
|
||||||
# add_executable(${time_bin} EXCLUDE_FROM_ALL ${time_src})
|
|
||||||
# add_dependencies(${test_bin} ${PROJECT_NAME}-static)
|
|
||||||
# add_dependencies(timing ${time_bin})
|
|
||||||
# target_link_libraries(${time_bin} CppUnitLite gtsam-static)
|
|
||||||
# add_custom_target(${time_base}.run ${EXECUTABLE_OUTPUT_PATH}${time_bin} ${ARGN})
|
|
||||||
# endforeach(time_src)
|
|
||||||
#endforeach(subdir)
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,3 @@
|
||||||
# Build convenience libraries
|
|
||||||
file(GLOB base_srcs "*.cpp")
|
|
||||||
add_library(base STATIC ${base_srcs})
|
|
||||||
|
|
||||||
# Install headers
|
# Install headers
|
||||||
file(GLOB base_headers "*.h")
|
file(GLOB base_headers "*.h")
|
||||||
install(FILES ${base_headers} DESTINATION include/gtsam/base)
|
install(FILES ${base_headers} DESTINATION include/gtsam/base)
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,3 @@
|
||||||
# Build convenience libraries
|
|
||||||
file(GLOB geometry_srcs "*.cpp")
|
|
||||||
add_library(geometry STATIC ${geometry_srcs})
|
|
||||||
|
|
||||||
# link back to base
|
# link back to base
|
||||||
add_dependencies(geometry base)
|
add_dependencies(geometry base)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,3 @@
|
||||||
# Build convenience libraries
|
|
||||||
file(GLOB inference_srcs "*.cpp")
|
|
||||||
add_library(inference STATIC ${inference_srcs})
|
|
||||||
|
|
||||||
# link back to previous convenience library
|
# link back to previous convenience library
|
||||||
add_dependencies(inference base)
|
add_dependencies(inference base)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,3 @@
|
||||||
# Build convenience libraries
|
|
||||||
file(GLOB linear_srcs "*.cpp")
|
|
||||||
add_library(linear STATIC ${linear_srcs})
|
|
||||||
|
|
||||||
# link back to base
|
# link back to base
|
||||||
add_dependencies(linear inference)
|
add_dependencies(linear inference)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,3 @@
|
||||||
# Build convenience libraries
|
|
||||||
file(GLOB nonlinear_srcs "*.cpp")
|
|
||||||
add_library(nonlinear STATIC ${nonlinear_srcs})
|
|
||||||
|
|
||||||
# link back to base
|
# link back to base
|
||||||
add_dependencies(nonlinear linear)
|
add_dependencies(nonlinear linear)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,3 @@
|
||||||
# Build convenience libraries
|
|
||||||
file(GLOB slam_srcs "*.cpp")
|
|
||||||
add_library(slam STATIC ${slam_srcs})
|
|
||||||
|
|
||||||
# link back to base
|
# link back to base
|
||||||
add_dependencies(slam nonlinear)
|
add_dependencies(slam nonlinear)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue