{"action":"created","issue":{"url":"https://api.github.com/repos/Sarcasm/irony-mode/issues/271","labels_url":"https://api.github.com/repos/Sarcasm/irony-mode/issues/271/labels{/name}","comments_url":"https://api.github.com/repos/Sarcasm/irony-mode/issues/271/comments","events_url":"https://api.github.com/repos/Sarcasm/irony-mode/issues/271/events","html_url":"https://github.com/Sarcasm/irony-mode/issues/271","id":125289585,"number":271,"title":"hpps files have wrong cdb with json from cmake","user":{"login":"sezaru","id":279828,"avatar_url":"https://avatars.githubusercontent.com/u/279828?v=3","gravatar_id":"","url":"https://api.github.com/users/sezaru","html_url":"https://github.com/sezaru","followers_url":"https://api.github.com/users/sezaru/followers","following_url":"https://api.github.com/users/sezaru/following{/other_user}","gists_url":"https://api.github.com/users/sezaru/gists{/gist_id}","starred_url":"https://api.github.com/users/sezaru/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sezaru/subscriptions","organizations_url":"https://api.github.com/users/sezaru/orgs","repos_url":"https://api.github.com/users/sezaru/repos","events_url":"https://api.github.com/users/sezaru/events{/privacy}","received_events_url":"https://api.github.com/users/sezaru/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":8,"created_at":"2016-01-06T23:44:31Z","updated_at":"2016-01-30T18:56:08Z","closed_at":null,"body":"I have a project which have subprojects in it (each subproject have it own CMakeLists.txt)\r\n\r\nFor example, let's say I have this scenario:\r\n    project\r\n    ....|____subproject1\r\n    ....|____subproject2\r\n\r\nproject CMakeLists.txt only have add_subdirectory to subproject1 and 2.\r\n\r\nNow, regarding irony-mode, when I open a cpp file, irony-mode will look in the json file cmake created to get the correct flags for it, and it works really great. But, when I open a hpp file, it looks like that irony-mode guesses what flags to use,.\r\n\r\nFor example, I have a file called NFSe.cpp which is part of subproject2 in directory project/subproject2/src, when I do irony-cdb-menu, the flags are right and the working directory is ../build/subproject2. But, when I open NFSe.hpp which is the header of NFSe.cpp, and is located in project/subproject2/includes, irony-mode stops working.\r\n\r\nRunning irony-cdb-mode, shows that the working directory for it is ../build/subproject1, and the flags to the compiler are wrong.\r\n\r\nSo, the problem is that the hpp files doesn't work since it thinks the project for this file is the wrong one and so gets the flags for the wrong project.\r\n "},"comment":{"url":"https://api.github.com/repos/Sarcasm/irony-mode/issues/comments/177275233","html_url":"https://github.com/Sarcasm/irony-mode/issues/271#issuecomment-177275233","issue_url":"https://api.github.com/repos/Sarcasm/irony-mode/issues/271","id":177275233,"user":{"login":"Sarcasm","id":424046,"avatar_url":"https://avatars.githubusercontent.com/u/424046?v=3","gravatar_id":"","url":"https://api.github.com/users/Sarcasm","html_url":"https://github.com/Sarcasm","followers_url":"https://api.github.com/users/Sarcasm/followers","following_url":"https://api.github.com/users/Sarcasm/following{/other_user}","gists_url":"https://api.github.com/users/Sarcasm/gists{/gist_id}","starred_url":"https://api.github.com/users/Sarcasm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Sarcasm/subscriptions","organizations_url":"https://api.github.com/users/Sarcasm/orgs","repos_url":"https://api.github.com/users/Sarcasm/repos","events_url":"https://api.github.com/users/Sarcasm/events{/privacy}","received_events_url":"https://api.github.com/users/Sarcasm/received_events","type":"User","site_admin":false},"created_at":"2016-01-30T18:56:08Z","updated_at":"2016-01-30T18:56:08Z","body":"> I will test a little more and if it works great in all the projects I have I will make a pull request.\r\n\r\nYes please do.\r\n\r\nI have neglected the compilation database for some time now even though I think it is an essential component of irony. On the other side @Hylen has made some work in this regarde that may have some kind of overlap with you (#230, #232, #270)."}}