{"action":"created","issue":{"url":"https://api.github.com/repos/BioMedIA/IRTK/issues/36","labels_url":"https://api.github.com/repos/BioMedIA/IRTK/issues/36/labels{/name}","comments_url":"https://api.github.com/repos/BioMedIA/IRTK/issues/36/comments","events_url":"https://api.github.com/repos/BioMedIA/IRTK/issues/36/events","html_url":"https://github.com/BioMedIA/IRTK/issues/36","id":122409252,"number":36,"title":"Find modules should mainly require <Pkg>_DIR to be set","user":{"login":"schuhschuh","id":975451,"avatar_url":"https://avatars.githubusercontent.com/u/975451?v=3","gravatar_id":"","url":"https://api.github.com/users/schuhschuh","html_url":"https://github.com/schuhschuh","followers_url":"https://api.github.com/users/schuhschuh/followers","following_url":"https://api.github.com/users/schuhschuh/following{/other_user}","gists_url":"https://api.github.com/users/schuhschuh/gists{/gist_id}","starred_url":"https://api.github.com/users/schuhschuh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/schuhschuh/subscriptions","organizations_url":"https://api.github.com/users/schuhschuh/orgs","repos_url":"https://api.github.com/users/schuhschuh/repos","events_url":"https://api.github.com/users/schuhschuh/events{/privacy}","received_events_url":"https://api.github.com/users/schuhschuh/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2015-12-16T01:47:59Z","updated_at":"2015-12-16T20:36:07Z","closed_at":null,"body":"When the CMake ```find_package``` command runs in CONFIG mode, it adds a cache variable named ```<Pkg>_DIR``` which points to the location of the package configuration file. This works of course only for packages that provide such CMake configuration file.\r\n\r\nSame should be the case for custom Find modules. Usually it would be sufficient if a user sets this variable to the prefix where the package is installed. All other paths should be derived from it and when cached, be declared as advanced variables unless a file/directory was not found. As soon as it is set, the variable can be hidden (again) by making it advanced. This reduces the number of non-advanced variables a user is required to set for all dependencies to be properly discovered. It also leaves a more common \"experience\" for a user, no matter if a custom Find module is used or not. All they have to do is make sure that the \"<Pkg>_DIR\" variables are set properly."},"comment":{"url":"https://api.github.com/repos/BioMedIA/IRTK/issues/comments/165237227","html_url":"https://github.com/BioMedIA/IRTK/issues/36#issuecomment-165237227","issue_url":"https://api.github.com/repos/BioMedIA/IRTK/issues/36","id":165237227,"user":{"login":"schuhschuh","id":975451,"avatar_url":"https://avatars.githubusercontent.com/u/975451?v=3","gravatar_id":"","url":"https://api.github.com/users/schuhschuh","html_url":"https://github.com/schuhschuh","followers_url":"https://api.github.com/users/schuhschuh/followers","following_url":"https://api.github.com/users/schuhschuh/following{/other_user}","gists_url":"https://api.github.com/users/schuhschuh/gists{/gist_id}","starred_url":"https://api.github.com/users/schuhschuh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/schuhschuh/subscriptions","organizations_url":"https://api.github.com/users/schuhschuh/orgs","repos_url":"https://api.github.com/users/schuhschuh/repos","events_url":"https://api.github.com/users/schuhschuh/events{/privacy}","received_events_url":"https://api.github.com/users/schuhschuh/received_events","type":"User","site_admin":false},"created_at":"2015-12-16T20:36:07Z","updated_at":"2015-12-16T20:36:07Z","body":"> Because the location is subject to interpretation. A header-only library like Eigen? header+libs like NifTICLib? header + optional libs like Boost? Plus the range of different prefixes for the header and libs locations...\r\n\r\nYou're missing the point. It is not necessary that all packages follow the same installation scheme. It is about the Find modules written specifically for a package that should encapsulate that knowledge.\r\n\r\n> The variable <Pkg>_DIR is used by config-mode and is expected to point to the location of the cmake config files.\r\n\r\nAt least for CMake <3, this definitely was not the case. Many of the Find modules used such variable themselves.\r\n\r\n> Changing its behaviour for non config-mode is counter-intuitive.\r\n\r\nI couldn't disagree more. First of all, you assume that a user knows that such variable **is only meant to be a path where a <Pkg>Config.cmake file is located**. A user shouldn't know such thing, which isn't even true. CMake has no such mechanism of requiring that a variable of such name is only used like this.\r\n\r\n> I apologize for the dry tone but I really feel we are bikeshedding here.\r\n\r\nSure, one can consider it petty details. But it's the petty details for something as a project structure and build configuration how easy and reliable it is to build it from source code for non-software developers. IMHO the important aspect of packaging (the refactored) IRTK was it's build configuration (i.e., CMake stuff). I know it's not the most exciting for a software developer, but it can make a real difference for the user.\r\n\r\nLook at the current setup. When I configure IRTK, I am overwhelmed with dozens of CMake variables in my CMake GUI, hiding all the actually relevant things. Instead of a single variable for each package that is intuitive (not counter-intuitive as you say). Why would you think as somebody not using CMake for your own development that \"IRTK_DIR\" is supposed to point to \"/usr/local/lib/cmake/IRTK\" instead of \"/usr/local\", the CMAKE_INSTALL_PREFIX I had used to install it ? Why do I, as a user that tries to install some software have to know where each dependency hides it's CMake package Config file ?"}}