EmbersArc / Epigraph

A C++ interface to formulate and solve linear, quadratic and second order cone problems.
MIT License
152 stars 15 forks source link

fix Eigen target name when using Conan #6

Closed BenjaminNavarro closed 4 years ago

BenjaminNavarro commented 4 years ago

I found an issue that went unnoticed because Eigen was installed on the systems where I tested the package...

Conan creates CMake targets using the PackageName::PackageName format which doesn't work for Eigen since the target name is Eigen3::Eigen

I couldn't find a way to solve the issue without making modifications to Epigraph.

The solution here is to create a "fake" target Eigen3::Eigen that publicly links to Eigen3::Eigen3 in the case Conan is used.

Conan is detected if the find_package succeeds but the Eigen3::Eigen target doesn't exist, that way no user intervention is required and it shouldn't change anything if system dependencies are used.

codecov-commenter commented 4 years ago

Codecov Report

Merging #6 into master will not change coverage. The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master       #6   +/-   ##
=======================================
  Coverage   94.69%   94.69%           
=======================================
  Files          29       29           
  Lines        1867     1867           
  Branches      156      156           
=======================================
  Hits         1768     1768           
  Misses         99       99           
BenjaminNavarro commented 4 years ago

Please wait a bit before merging, I think there is a problem with older versions of CMake (the target existence check part)

I'll take a closer look tomorrow

BenjaminNavarro commented 4 years ago

Should be ok now, the approach is more straightforward and doesn't confuse CMake anymore

EmbersArc commented 4 years ago

Much appreciated!