{"action":"created","issue":{"url":"https://api.github.com/repos/ruslo/hunter/issues/623","repository_url":"https://api.github.com/repos/ruslo/hunter","labels_url":"https://api.github.com/repos/ruslo/hunter/issues/623/labels{/name}","comments_url":"https://api.github.com/repos/ruslo/hunter/issues/623/comments","events_url":"https://api.github.com/repos/ruslo/hunter/issues/623/events","html_url":"https://github.com/ruslo/hunter/issues/623","id":196352879,"number":623,"title":"Understanding the Eigen Package","user":{"login":"NeroBurner","id":9076163,"avatar_url":"https://avatars.githubusercontent.com/u/9076163?v=3","gravatar_id":"","url":"https://api.github.com/users/NeroBurner","html_url":"https://github.com/NeroBurner","followers_url":"https://api.github.com/users/NeroBurner/followers","following_url":"https://api.github.com/users/NeroBurner/following{/other_user}","gists_url":"https://api.github.com/users/NeroBurner/gists{/gist_id}","starred_url":"https://api.github.com/users/NeroBurner/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NeroBurner/subscriptions","organizations_url":"https://api.github.com/users/NeroBurner/orgs","repos_url":"https://api.github.com/users/NeroBurner/repos","events_url":"https://api.github.com/users/NeroBurner/events{/privacy}","received_events_url":"https://api.github.com/users/NeroBurner/received_events","type":"User","site_admin":false},"labels":[{"id":135659151,"url":"https://api.github.com/repos/ruslo/hunter/labels/discussion","name":"discussion","color":"009800","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":7,"created_at":"2016-12-19T08:05:23Z","updated_at":"2016-12-21T04:16:55Z","closed_at":null,"body":"I'm working on Ubuntu 16.04. When installing `libeigen3-dev` the file `/usr/lib/cmake/eigen3/Eigen3Config.cmake` is installed. Therefore the eigen package can be found with `find_package(Eigen3 REQUIRED)` and the include dir is saved in `EIGEN3_INCLUDE_DIRS`.\r\n\r\nBut with hunter one needs the lines\r\n```\r\nhunter_add_package(Eigen)\r\nfind_package(Eigen)\r\n```\r\nbut neither `Eigen3_INCLUDE_DIRS` nor `Eigen_INCLUDE_DIRS` is set\r\n\r\nOn both Hunter and Ubuntu a file `share/pkgconfig/eigen3.pc` is installed. With the only difference of the variable `prefix` being set to either `/usr` or  the hunter build directory.\r\n\r\nAfter some more digging I've found the file `${HUNTER_ROOT}/cmake/find/FindEigen.cmake`. There a target `Eigen::eigen` is defined\r\n\r\nTo support both Hunter and Ubuntu a CMakeLists file would need to look as follows:\r\n```\r\nhunter_add_package(Eigen)\r\nadd_executable(eigen_test main.cpp)\r\nif (HUNTER_ENABLED)\r\n\tfind_package(Eigen REQUIRED)\r\n\ttarget_link_libraries(eigen_test PRIVATE Eigen::eigen)\r\nelse()\r\n\tfind_package(Eigen3 REQUIRED)\r\n\tmessage(\"target_include_directories(eigen_test PRIVATE ${EIGEN3_INCLUDE_DIRS})\")\r\n\ttarget_include_directories(eigen_test PRIVATE ${EIGEN3_INCLUDE_DIRS})\r\nendif()\r\n```\r\n\r\nI'd like to unify the the approach of finding and adding the Eigen header files. A few approaches I could think of:\r\n- supply the Upstream Eigen package with a `FindEigen3.cmake` file, which is installed just like the `eigen3.pc` file\r\n- Rename the Hunter package to `Eigen3` (`project/Eigen` and `find/FindEigen.cmake`) and provide the `EIGEN3_INCLUDE_DIRS` variable\r\n- somehow use the already generated `eigen3.pc`-file as hints\r\n\r\nWhat do you guys think?\r\n\r\n---\r\n\r\n<bountysource-plugin>\r\n---\r\nWant to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/40198897-understanding-the-eigen-package?utm_campaign=plugin&utm_content=tracker%2F1032790&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F1032790&utm_medium=issues&utm_source=github).\r\n</bountysource-plugin>"},"comment":{"url":"https://api.github.com/repos/ruslo/hunter/issues/comments/268431652","html_url":"https://github.com/ruslo/hunter/issues/623#issuecomment-268431652","issue_url":"https://api.github.com/repos/ruslo/hunter/issues/623","id":268431652,"user":{"login":"ruslo","id":4346993,"avatar_url":"https://avatars.githubusercontent.com/u/4346993?v=3","gravatar_id":"","url":"https://api.github.com/users/ruslo","html_url":"https://github.com/ruslo","followers_url":"https://api.github.com/users/ruslo/followers","following_url":"https://api.github.com/users/ruslo/following{/other_user}","gists_url":"https://api.github.com/users/ruslo/gists{/gist_id}","starred_url":"https://api.github.com/users/ruslo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ruslo/subscriptions","organizations_url":"https://api.github.com/users/ruslo/orgs","repos_url":"https://api.github.com/users/ruslo/repos","events_url":"https://api.github.com/users/ruslo/events{/privacy}","received_events_url":"https://api.github.com/users/ruslo/received_events","type":"User","site_admin":false},"created_at":"2016-12-21T04:16:54Z","updated_at":"2016-12-21T04:16:54Z","body":"> How do we deal with those?\r\n\r\nRemove old \"bad\" versions and keep only good. In wiki page we can save the last Hunter version with old interface."}}
{"actor":{"display_login":"ruslo"}}