{"action":"opened","issue":{"url":"https://api.github.com/repos/ARMmbed/yotta/issues/591","labels_url":"https://api.github.com/repos/ARMmbed/yotta/issues/591/labels{/name}","comments_url":"https://api.github.com/repos/ARMmbed/yotta/issues/591/comments","events_url":"https://api.github.com/repos/ARMmbed/yotta/issues/591/events","html_url":"https://github.com/ARMmbed/yotta/issues/591","id":118365054,"number":591,"title":"Add custom CMake to be included by every module","user":{"login":"bremoran","id":2636227,"avatar_url":"https://avatars.githubusercontent.com/u/2636227?v=3","gravatar_id":"","url":"https://api.github.com/users/bremoran","html_url":"https://github.com/bremoran","followers_url":"https://api.github.com/users/bremoran/followers","following_url":"https://api.github.com/users/bremoran/following{/other_user}","gists_url":"https://api.github.com/users/bremoran/gists{/gist_id}","starred_url":"https://api.github.com/users/bremoran/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bremoran/subscriptions","organizations_url":"https://api.github.com/users/bremoran/orgs","repos_url":"https://api.github.com/users/bremoran/repos","events_url":"https://api.github.com/users/bremoran/events{/privacy}","received_events_url":"https://api.github.com/users/bremoran/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-11-23T11:45:47Z","updated_at":"2015-11-23T11:45:47Z","closed_at":null,"body":"Sometimes, a target needs to define custom CMake to be included by every module. For example, to support sensible code coverage, gcov should only be enabled for files that are under test, rather than all source files.\r\n\r\nThis implies that gcov needs to know about which files are being tested. The most sensible mechanism seems to be turning on coverage based on yotta config:\r\n\r\n```JSON\r\n\"debug\" : {\r\n    \"options\" : {\r\n        \"coverage\" : {\r\n            \"modules\" : [\"sockets\", \"sal\"]\r\n        }\r\n    }\r\n}\r\n```\r\n\r\nThen, custom CMake is needed to enable the coverage flags for source files within those modules. Since this custom CMake is specific to the target, it should live within the target. Adding custom CMake to each module would permit this.\r\n\r\ncc @bogdanm @autopulated "}}