{"action":"created","issue":{"url":"https://api.github.com/repos/Kitware/CMake/issues/157","labels_url":"https://api.github.com/repos/Kitware/CMake/issues/157/labels{/name}","comments_url":"https://api.github.com/repos/Kitware/CMake/issues/157/comments","events_url":"https://api.github.com/repos/Kitware/CMake/issues/157/events","html_url":"https://github.com/Kitware/CMake/pull/157","id":81724102,"number":157,"title":"Add DEFINES feature for FindBISON","user":{"login":"Uni-","id":1371115,"avatar_url":"https://avatars.githubusercontent.com/u/1371115?v=3","gravatar_id":"","url":"https://api.github.com/users/Uni-","html_url":"https://github.com/Uni-","followers_url":"https://api.github.com/users/Uni-/followers","following_url":"https://api.github.com/users/Uni-/following{/other_user}","gists_url":"https://api.github.com/users/Uni-/gists{/gist_id}","starred_url":"https://api.github.com/users/Uni-/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Uni-/subscriptions","organizations_url":"https://api.github.com/users/Uni-/orgs","repos_url":"https://api.github.com/users/Uni-/repos","events_url":"https://api.github.com/users/Uni-/events{/privacy}","received_events_url":"https://api.github.com/users/Uni-/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-05-28T02:37:44Z","updated_at":"2015-05-29T13:29:55Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/Kitware/CMake/pulls/157","html_url":"https://github.com/Kitware/CMake/pull/157","diff_url":"https://github.com/Kitware/CMake/pull/157.diff","patch_url":"https://github.com/Kitware/CMake/pull/157.patch"},"body":"This changeset adds `DEFINES` parameter feature to FindBISON module (Modules/FindBISON.cmake).\r\n\r\nThe `BISON_TARGET` macro spec changes from:\r\n```plain\r\nBISON_TARGET(<Name> <YaccInput> <CodeOutput> [VERBOSE <file>]\r\n            [COMPILE_FLAGS <string>])\r\n```\r\nto:\r\n```plain\r\nBISON_TARGET(<Name> <YaccInput> <CodeOutput> [VERBOSE <file>]\r\n            [COMPILE_FLAGS <string>] [DEFINES <file>])\r\n```\r\n\r\nThe `DEFINES <file>` parameter causes the macro-defined bison command to contain `--defines=<file>` rather than `-d`, so the header file name is specified.\r\n\r\nWhile `--defines` option can be given via `COMPILE_FLAGS`, doing it messes the whole build process by running the `BISON_TARGET` macro again and again. It's becuase the header file name `BISON_${Name}_OUTPUT_HEADER` is generated independently, so the command recognizes wrong output `BISON_${Name}_OUTPUT`.\r\n\r\nIn this changeset, `DEFINES <file>` parameter not only invokes `--defines`, but also changes `BISON_${Name}_OUTPUT_HEADER` and `BISON_${Name}_OUTPUT`.\r\n\r\nUsage:\r\n```plain\r\nBISON_TARGET(MyParser myparser.y myparser.tab.cc DEFINES myparser.tab.h)\r\n```"},"comment":{"url":"https://api.github.com/repos/Kitware/CMake/issues/comments/106802881","html_url":"https://github.com/Kitware/CMake/pull/157#issuecomment-106802881","issue_url":"https://api.github.com/repos/Kitware/CMake/issues/157","id":106802881,"user":{"login":"bradking","id":87268,"avatar_url":"https://avatars.githubusercontent.com/u/87268?v=3","gravatar_id":"","url":"https://api.github.com/users/bradking","html_url":"https://github.com/bradking","followers_url":"https://api.github.com/users/bradking/followers","following_url":"https://api.github.com/users/bradking/following{/other_user}","gists_url":"https://api.github.com/users/bradking/gists{/gist_id}","starred_url":"https://api.github.com/users/bradking/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bradking/subscriptions","organizations_url":"https://api.github.com/users/bradking/orgs","repos_url":"https://api.github.com/users/bradking/repos","events_url":"https://api.github.com/users/bradking/events{/privacy}","received_events_url":"https://api.github.com/users/bradking/received_events","type":"User","site_admin":false},"created_at":"2015-05-29T13:29:55Z","updated_at":"2015-05-29T13:29:55Z","body":"Thanks for working on this.  I think the `DEFINES` parameter would be better named `DEFINES_FILE` to clarify the reason a file name follows it.\r\n\r\nThe `# Parsing parameters` block in the existing code is not our modern way to parse macro arguments.  Rather than extending it to parse the new parameter, please look at converting the parameter parsing over to use the `CMakeParseArguments` module or use a manual state machine loop (see `FortranCInterface_HEADER` for an example).\r\n\r\nPlease also read `CONTRIBUTING.rst`.\r\n"}}