From 1d7c49224a343a9b0a96be15dec12fc11690bde2 Mon Sep 17 00:00:00 2001 From: Sameer Agarwal Date: Mon, 16 Jul 2012 20:40:25 -0700 Subject: [PATCH] Add shared library targets. Fix a grammo from a previous CL. Change-Id: Icc683d3a73a542519a6ccefc0f653664f236c24b --- include/ceres/jet.h | 2 +- internal/ceres/CMakeLists.txt | 18 +++++++++++------- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/include/ceres/jet.h b/include/ceres/jet.h index 49a9098f4..1266acf98 100644 --- a/include/ceres/jet.h +++ b/include/ceres/jet.h @@ -220,7 +220,7 @@ struct Jet { // gets allocated on the stack and as part of other arrays and // structs. Forcing the right alignment there is the source of much // pain and suffering. Even if that works, passing Jets around to - // functions by value has problem because the C++ ABI does not + // functions by value has problems because the C++ ABI does not // guarantee alignment for function arguments. // // Setting the DontAlign bit prevents Eigen from using SSE for the diff --git a/internal/ceres/CMakeLists.txt b/internal/ceres/CMakeLists.txt index 0ca92fd9b..8a3917b55 100644 --- a/internal/ceres/CMakeLists.txt +++ b/internal/ceres/CMakeLists.txt @@ -102,13 +102,6 @@ ELSE (${SCHUR_SPECIALIZATIONS}) FILE(GLOB CERES_INTERNAL_SCHUR_FILES generated/schur_eliminator_d_d_d.cc) ENDIF (${SCHUR_SPECIALIZATIONS}) -ADD_LIBRARY(ceres - ${PROTO_SRCS} - ${PROTO_HDRS} - ${CERES_INTERNAL_SRC} - ${CERES_INTERNAL_HDRS} - ${CERES_INTERNAL_SCHUR_FILES}) - SET(CERES_LIBRARY_DEPENDENCIES ${GLOG_LIB}) IF (${GFLAGS}) @@ -145,8 +138,19 @@ IF (${PROTOBUF_FOUND}) LIST(APPEND CERES_LIBRARY_DEPENDENCIES ${PROTOBUF_LIBRARY}) ENDIF (${PROTOBUF_FOUND}) +SET(CERES_LIBRARY_SOURCE + ${PROTO_SRCS} + ${PROTO_HDRS} + ${CERES_INTERNAL_SRC} + ${CERES_INTERNAL_HDRS} + ${CERES_INTERNAL_SCHUR_FILES}) + +ADD_LIBRARY(ceres STATIC ${CERES_LIBRARY_SOURCE}) TARGET_LINK_LIBRARIES(ceres ${CERES_LIBRARY_DEPENDENCIES}) +ADD_LIBRARY(ceres_shared SHARED ${CERES_LIBRARY_SOURCE}) +TARGET_LINK_LIBRARIES(ceres_shared ${CERES_LIBRARY_DEPENDENCIES}) + IF (${BUILD_TESTING}) ADD_LIBRARY(gtest gmock_gtest_all.cc gmock_main.cc) ADD_LIBRARY(test_util test_util.cc)