Add shared library targets.
Fix a grammo from a previous CL.
Change-Id: Icc683d3a73a542519a6ccefc0f653664f236c24b
diff --git a/include/ceres/jet.h b/include/ceres/jet.h
index 49a9098..1266acf 100644
--- a/include/ceres/jet.h
+++ b/include/ceres/jet.h
@@ -220,7 +220,7 @@
// 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 0ca92fd..8a3917b 100644
--- a/internal/ceres/CMakeLists.txt
+++ b/internal/ceres/CMakeLists.txt
@@ -102,13 +102,6 @@
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 @@
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)