Commit Graph

16 Commits

Author SHA1 Message Date
Sameer Agarwal 60811dffe1 Fix a bug introduced in fa39fae0b7
The FindSuiteSparse.cmake refactor had a typo where CCOLAMD
and COLAMD were conflated.

Thanks to @jasjuang for reporting this issue and finding the exact
commit where this bug was introduced.

Change-Id: If8ef6624df3b8b2fd7f0861eafc4700173401435
2017-07-02 00:09:21 -07:00
Alex Stewart fa39fae0b7 Pass user-specified search hints as HINTS not PATHS.
- 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
2017-06-05 08:35:02 +00:00
Alex Stewart 8a2da98ac2 Clear XXX_FOUND in Find<XXX>.cmake prior to searching.
- 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
2016-12-01 18:20:11 +00:00
Alex Stewart 562a72ea2b Fix missing early return() in xxx_not_found() dependency macros.
- 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
2016-02-06 15:58:10 +00:00
Alex Stewart cc8d47aabb Update all CMake to lowercase function name style.
- 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
2015-08-09 15:18:42 +01:00
Alex Stewart 58ee9f7d9b Handle possible presence of library prefixes in MSVC.
- 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
2015-03-31 00:47:44 +00:00
Keir Mierle 7492b0d8de Update copyright headers with new year and URL
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
2015-03-18 05:43:23 +00:00
Alex Stewart f4f753ab68 Fix empty Cache HELPSTRING parsing error on OS X 10.10 Yosemite.
- Without quotations, on Yosemite, CMake will fail on first configure,
  but will then work fine subsequently.  This is because if the
  HELPSTRING property is empty, without "" quotes, it is removed from
  the arguments list for set().

Change-Id: Ia60444695e9770b947f145a54e949c9eeae67fbb
2014-10-24 10:38:13 +01:00
Andreas Franek 6cb82b609a METIS_FOUND is never set.
Changed the commit to fit the setting of the other *_FOUND definitions.

Change-Id: I3f0d11a9a65a0decd1a6a6b28a4a4823eb74c9c3
2014-02-20 17:52:51 +01:00
Alex Stewart b5be6b9c06 Cleaning up messages output when SuiteSparse is not found.
- Automatically generated failure message now provides more
  information as to which sub-modules are missing.

Change-Id: I6eed94af49263540b8f87917b75c41b8f49658a0
2013-11-05 21:12:48 +00:00
Alex Stewart 69bd65ff43 Downgrading warning messages when optional deps are not found.
- 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
2013-11-04 23:01:14 +00:00
Alex Stewart b0a8731fcd Removing duplicate SuiteSparse found message.
- Also flipping ordering of variables in
  find_package_handle_standard_args() so that the automatically
  generated message prints the include directories, not TRUE.

Change-Id: I2bf62eacd5c96f27152e9542b9a74651243a584e
2013-11-04 20:32:40 +00:00
Alex Stewart 6fed9fe0de Fix FindPackage scripts to emit warnings, not errors if not found.
- 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
2013-11-04 19:08:17 +00:00
Alex Stewart 78cc2c4719 Cleaning up exported CeresConfig.cmake.
- 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
2013-10-17 19:13:08 +00:00
Alex Stewart 003a1624f4 Fixing issue with CMake >= 2.8.10.2 FindPackageHandleStandardArgs.
- Prior to CMake 2.8.10.2 FindPackageHandleStandardArgs was safe if
  passed <LIBRARY>_FOUND as a variable to validate, this is no longer
  true for newer CMake releases.
- Also adding missing SUITESPARSEQR_FOUND requirement for
  SUITESPARSE_FOUND.

Change-Id: I0fdde56585fc736bdfbf433901ad17ee9f1cc216
2013-10-09 18:39:43 +00:00
Alex Stewart 0b07d3e9f9 Making all config options in CMake & SuiteSparse cleanup.
- Also marking all library and include directories found via
  find_library/path advanced (not directly visible in CMake GUI unless
  toggled to show advanced options).
- Updating documentation to reflect SuiteSparse requirements on Ubuntu
  and ability to control build options in CMake GUI.
- Splitting out all SuiteSparse related find_XX directives into a
  FindSuiteSparse script.

Change-Id: I0d69e02392ec547a7c365ba3e06f2ebc61cacf16
2013-10-07 19:50:24 +01:00