Export Ceres compile definitions to targets compiled against Ceres.
- Previously all Ceres compile definitions were private to Ceres, that
is they were not exported to users via the CMake export mechanism.
- Now that we use compile definitions in public (installed) Ceres
headers, we need to export the Ceres compile definitions.
- If we did not do this, then the client's code 'see's' a different
version of the Ceres headers to those which were in fact compiled,
or in the case of shared_ptr, may not find the required header.
- This patch makes use of the new, in CMake 2.8.11, function:
target_compile_definitions() to export all of the Ceres compile
definitions using CMake's export functionality.
- For CMake versions < 2.8.11, we have to use the blunter instrument of
calling add_definitions() in CeresConfig.cmake (invoked by a call to
find_package(Ceres)). This is messy because it ends up adding the
Ceres compile definitions to any target declared in the user's code
after the call to find_package(Ceres). Although this should do no
harm as all of our defines are prefaced with CERES_, so any
unintentional name clashes are unlikely.
Change-Id: I5dea80949190eaf4fb08ea4ac568ce28c32dd4e0
3 files changed