Ensure that Ceres does not print any log messages when somebody has
used 'find_package(Ceres QUIET)' in their CMake project.
Change-Id: Id6b68859cc8a5857f3fa78f29736cb82fd5a0943
- Adding the Homebrew install prefix to CMAKE_PREFIX_PATH, irrespective
of whether it is a standard location (e.g. /usr/local) overrides any
user-specified HINTS locations according to the search order of
CMake's find_xxx() functions.
- Now we append the relevant include/lib directory to its respective
HINTS directory variable (to the back to avoid overriding any user
specified values). This achieves the same effect, but only after
searching any user specified values.
- Also adds Homebrew install prefix to find_package() calls for
dependencies optionally exported with CMake after the possible user
specified <DEPENDENCY_NAME>_DIR prefix.
- Raised as issue #431
Change-Id: I47030f0f4fd9b96665fac57279be2285d9700b9a
- As reported as Issue #285, previously we passed user-specified hint
locations as PATHS to find_path/library which means that they are
searched after system locations. Now we pass them as HINTS, which are
searched before system locations.
- Also clean-up FindSuiteSparse to replace repeated code for finding
each component with a common macro.
Change-Id: I20a1f905d929a23037b1d0b7fb7ffe817abaa3e3
- glog has a bug in its CMakeLists.txt whereby it uses ‘google-glog’ as
its project() name in its CMakeLists.txt, but exports itself as ‘glog’
which results in an install prefix on Windows which contains
‘google-glog’ instead of ‘glog’ which breaks find_package(glog).
This has been raised as a glog issue here:
https://github.com/google/glog/issues/149.
- We now force find_package(glog) to search glog using both
‘google-glog’ (for Windows) & ‘glog’ (for all other OSs).
Change-Id: I6c0edccdec405200eaa0fea1476b574e73bd3f14
- When built with CMake on Windows, the default install prefix
will be C:/Program Files/<PROJECT_NAME> (instead of /usr/local on
Linux / OS X.
- Due to an upstream change in Eigen >= 3.3, the project name for Eigen
changed to Eigen3 from Eigen, thus changing the default install
location.
- glog, uses the project name “google-glog”, thus when it is build with
CMake, this becomes it’s default install path instead of just glog
when built with other tools.
- This patch adds both of these paths to the default search list on
Windows.
Change-Id: I987b502fed0f6e685c504fd47fd504307aad8bef
- This protects against a client project which invokes
find_package(Ceres) after having called find_package(Foo) with their
own version of FindFoo.cmake which conflicts with Ceres’ exported
version and defines FOO_FOUND, but not the other variables Ceres’
FindFoo.cmake is expecting which can break the detection logic.
Change-Id: I9fe7bfa8a34bb58b09ffe34446da973912cf5587
- If gflags was built & exported with CMake but glog was not, but both
were found then as we now make gflags a public dependency of Ceres if
both it and glog are found, the *name* of the exported gflags CMake
target (gflags-shared or similar) will appear in CERES_LIBRARIES.
- However, as imported targets are not re-exported, this results in a
linker error when compiling client code, as the name of the exported
gflags target is not known to CMake, it assumes it is a library name,
which it is not.
- Confusingly, if glog was built with CMake, this problem would not
occur, as in that case glog’s CMake target would bring in gflags’.
- Now we explicitly call find_package(Gflags) in CeresConfig.cmake if
Ceres was built with gflags as a public dependency (via glog).
Change-Id: I5cc9483a1fae50f4e9e3a8fbba491b645fd45db6
- The latest version of glog supports building with CMake, in which case
it exports itself via CMake as a target that contains important meta
information such as Windows-specific compilation definitions.
- This patch updates FindGlog.cmake such that it can optionally use
an exported glog target if one exists, if not it will fall back to
the current approach whereby the glog components are found manually.
This behaviour (and the implementation) is very similar to that of
FindGflags.cmake.
Change-Id: Idfb5f49c1b457707029bff52068f58237c0e285d
- This could result in potentially confusing output if dependencies
were found with the QUIET option: "XXX not found due to ...", followed
by "found <part of> XXX".
- If find_package() was called with REQUIRED, then a FATAL_ERROR was
triggered in the xxx_not_found() macros, resulting in early
termination.
Change-Id: Ibf59afd10067b9debd1a5e15f735a41b61bed52e
- Updated to new CMake style where function names are all lowercase,
this will be backwards compatible as CMake function names are
case insensitive.
- Updated using Emacs' M-x unscreamify-cmake-buffer.
Change-Id: If7219816f560270e59212813aeb021353a64a0e2
- On MSVC, a Ceres dependency such as glog, may be named glog.lib, or
libglog.lib. By default, CMake assumes no prefix for libraries on
MSVC when using find_library(), thus find_library(glog) would fail
if glog was named libglog.lib.
- This patch caches & updates CMAKE_FIND_LIBRARY_PREFIXES in all of
Ceres' find_package scripts to include lib & "" (no prefix) on MSVC
and then returns CMAKE_FIND_LIBRARY_PREFIXES to its original state
before returning.
Change-Id: Ic82799e3b786cfb7228a51183bc189578b072bbe
Since Ceres is moving to using GitHub for issues, and the Google
Code URL in the current copyright header will soon become invalid,
update all the headers.
Change-Id: I1fce70375d1bcf098591f07b4d8f01a5c1e0789c
- Now when find_package() is called for a dependency without the
REQUIRED or QUIET qualifiers, we emit no priority (above STATUS, but
below WARNING) messages and continue.
Change-Id: I8cdeda7a8f6c91d45fb7f24fb366244c6c9b66e1
- Previously we used message priority: SEND_ERROR when a package was
not found and find_package() was called without QUIET or REQUIRED,
which emits an error message, and prevents generation, but continues
configuration.
- The fact SEND_ERROR induces an error message was confusing for users
as it implies that something bad has happened and they cannot
continue, when in fact we were disabling the option in question
and were thus able to continue, all they had to do was re-configure.
- This commit also reorders the search lists for includes/libraries
so that we always search user installed locations (e.g. /usr/local)
before system installed locations. Thus we will now always prefer
a user install to a system install if both are available, which is
likely to be the users desired intention.
Change-Id: Ide84919f27d3373f31282f70c685720cd77a6723
- MSVC users can now choose whether to use the static or shared
C-Run Time (CRT) libraries explicitly.
- FindPackage() scripts now check that the lowercase libraries match
the expected library names, as Windows uses CamelCase for some
library names (other OSs don't).
Change-Id: Icbba5e9bf80181a5437e5009bdda1c12934bc6f3
- Adding FindPackage scripts for all of Ceres dependencies.
- Moving depend.cmake contents to CeresConfig.cmake and cleaning up
search for Ceres & required dependencies, no longer push Ceres
options into client.
- Fixing uninstall to remove ceres include root directory.
- Fixing main CMakeLists to install miniglog header if enabled.
- Making miniglog library shared/static with Ceres library.
Change-Id: If926bebd11720230c5136597ccba672394ed9777