From 6bcb8d9c304a3b218f8788018dfdfe368bb7d60c Mon Sep 17 00:00:00 2001 From: Pablo Speciale Date: Mon, 25 Mar 2013 16:40:26 -0700 Subject: [PATCH] Compiling against static or shared library Change-Id: I3fb35e9a49f90b8894f59dde49c90a7c2dd74b0a --- cmake/CeresConfig.cmake.in | 1 + docs/source/building.rst | 15 +++++++++++++++ 2 files changed, 16 insertions(+) diff --git a/cmake/CeresConfig.cmake.in b/cmake/CeresConfig.cmake.in index d000046ef..8ec5677fa 100644 --- a/cmake/CeresConfig.cmake.in +++ b/cmake/CeresConfig.cmake.in @@ -47,3 +47,4 @@ INCLUDE(${currentDir}/depend.cmake) # Set the expected library variable SET(CERES_LIBRARIES ceres) +SET(CERES_LIBRARIES_SHARED ceres_shared) diff --git a/docs/source/building.rst b/docs/source/building.rst index 75fbfa00f..48027e670 100644 --- a/docs/source/building.rst +++ b/docs/source/building.rst @@ -384,3 +384,18 @@ If Ceres was installed in a non-standard path by specifying FIND_PACKAGE(Ceres REQUIRED PATHS "/some/where/local/") Note that this can be used to have multiple versions of Ceres installed. + +Compiling against static or shared library +------------------------------------------ + +.. code-block:: cmake + + TARGET_LINK_LIBRARIES(helloworld ${CERES_LIBRARIES}) + +will result in a statically linked binary. Changing this line to + +.. code-block:: cmake + + TARGET_LINK_LIBRARIES(helloworld ${CERES_LIBRARIES_SHARED}) + +will result in a dynamically linked binary.