mirror of
https://github.com/ceres-solver/ceres-solver.git
synced 2026-08-29 08:34:37 +08:00
Link against threading library only if necessary
1. The platform specific threads library is only needed if we actually use threads. In this case, the library is not optional opposed to previous logic. 2. Do not hide the find module output to allow the user to understand what happens in case of a CMake failure to locate Threads. 3. Finally, Threads is private dependency that does need to be propagated to consumers unless Ceres was compiled as a static library. Change-Id: I8d9d9cd42930e1ed234f69a2dba70d0ee2755b4e
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
# Ceres Solver - A fast non-linear least squares minimizer
|
||||
# Copyright 2015 Google Inc. All rights reserved.
|
||||
# Copyright 2022 Google Inc. All rights reserved.
|
||||
# http://ceres-solver.org/
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
@@ -176,11 +176,10 @@ endif(CERES_WAS_INSTALLED)
|
||||
set(CERES_VERSION @CERES_VERSION@)
|
||||
|
||||
include(CMakeFindDependencyMacro)
|
||||
find_dependency(Threads)
|
||||
|
||||
# Optional dependencies
|
||||
@SuiteSparse_DEPENDENCY@
|
||||
@OpenMP_DEPENDENCY@
|
||||
@SuiteSparse_DEPENDENCY@
|
||||
@Threads_DEPENDENCY@
|
||||
|
||||
# As imported CMake targets are not re-exported when a dependent target is
|
||||
# exported, we must invoke find_package(XXX) here to reload the definition
|
||||
|
||||
Reference in New Issue
Block a user