{"action":"created","comment":{"url":"https://api.github.com/repos/lcm-proj/lcm/pulls/comments/80252782","id":80252782,"diff_hunk":"@@ -0,0 +1,146 @@\n+CMake Tutorial {#tut_cmake}\n+====\n+\\brief Generating LCM type bindings with CMake\n+\n+This tutorial will walk you through a sample `CMakeLists.txt` that will\n+generate bindings for your LCM message types.\n+\n+First, of course, you will want to find LCM itself, and include it's \"use file\"\n+(a \"use file\" is a CMake script provided with some packages that adds utility\n+functions for using that package). This can be done in your root\n+`CMakeLists.txt`. If you will be generating Python and/or Java bindings, now\n+is a good time to find those also.\n+\n+    find_package(lcm REQUIRED)\n+    include(${LCM_USE_FILE})\n+\n+    find_package(PythonInterp)\n+    find_package(Java)\n+\n+    if(JAVA_FOUND)\n+      include(UseJava)\n+    endif()\n+\n+Add `REQUIRED` to the `find_package` calls if you want to enforce that Python\n+and/or Java are available. Otherwise, you can generate bindings for these\n+languages conditionally. (The rest of the logic we show, including the next\n+snippet, will go in the `CMakeLists.txt` that's located alongside your LCM\n+types.)\n+\n+    if(PYTHONINTERP_FOUND)\n+      set(python_args PYTHON_SOURCES python_install_sources)\n+    endif()\n+    if(JAVA_FOUND)\n+      set(java_args JAVA_SOURCES java_sources)\n+    endif()\n+\n+(The main reason to find Python is to obtain its version so that the generated\n+Python files can be installed into the correct directory. If you determine this\n+directory by some other means, you can skip finding Python and just generate\n+the Python bindings unconditionally.)\n+\n+Now, you'll want to generate the bindings.\n+\n+    lcm_wrap_types(\n+      C_SOURCES sources\n+      C_HEADERS c_install_headers\n+      CPP_HEADERS cpp_install_headers\n+      ${python_args}\n+      ${java_args}\n+      my_type_1.lcm\n+      my_type_2.lcm\n+      ...\n+    )\n+\n+This will create the necessary rules to run `lcm-gen`, and will set several\n+CMake variables that you will use later.","path":"docs/content/tutorial-cmake.md","position":56,"original_position":56,"commit_id":"3f1ec359098a29ea429dfd1741ca955236caac9a","original_commit_id":"3f1ec359098a29ea429dfd1741ca955236caac9a","user":{"login":"tkoolen","id":2585880,"avatar_url":"https://avatars.githubusercontent.com/u/2585880?v=3","gravatar_id":"","url":"https://api.github.com/users/tkoolen","html_url":"https://github.com/tkoolen","followers_url":"https://api.github.com/users/tkoolen/followers","following_url":"https://api.github.com/users/tkoolen/following{/other_user}","gists_url":"https://api.github.com/users/tkoolen/gists{/gist_id}","starred_url":"https://api.github.com/users/tkoolen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tkoolen/subscriptions","organizations_url":"https://api.github.com/users/tkoolen/orgs","repos_url":"https://api.github.com/users/tkoolen/repos","events_url":"https://api.github.com/users/tkoolen/events{/privacy}","received_events_url":"https://api.github.com/users/tkoolen/received_events","type":"User","site_admin":false},"body":"I would mention explicitly here which CMake variables get set (i.e. what the output variables are), since it's not immediately clear from a CMake function call what the inputs and outputs are.","created_at":"2016-09-23T14:14:15Z","updated_at":"2016-09-23T14:21:39Z","html_url":"https://github.com/lcm-proj/lcm/pull/105#discussion_r80252782","pull_request_url":"https://api.github.com/repos/lcm-proj/lcm/pulls/105","_links":{"self":{"href":"https://api.github.com/repos/lcm-proj/lcm/pulls/comments/80252782"},"html":{"href":"https://github.com/lcm-proj/lcm/pull/105#discussion_r80252782"},"pull_request":{"href":"https://api.github.com/repos/lcm-proj/lcm/pulls/105"}}},"pull_request":{"url":"https://api.github.com/repos/lcm-proj/lcm/pulls/105","id":86184238,"html_url":"https://github.com/lcm-proj/lcm/pull/105","diff_url":"https://github.com/lcm-proj/lcm/pull/105.diff","patch_url":"https://github.com/lcm-proj/lcm/pull/105.patch","issue_url":"https://api.github.com/repos/lcm-proj/lcm/issues/105","number":105,"state":"open","locked":false,"title":"Add CMake tutorial, additional CMake helper functions","user":{"login":"mwoehlke-kitware","id":6474409,"avatar_url":"https://avatars.githubusercontent.com/u/6474409?v=3","gravatar_id":"","url":"https://api.github.com/users/mwoehlke-kitware","html_url":"https://github.com/mwoehlke-kitware","followers_url":"https://api.github.com/users/mwoehlke-kitware/followers","following_url":"https://api.github.com/users/mwoehlke-kitware/following{/other_user}","gists_url":"https://api.github.com/users/mwoehlke-kitware/gists{/gist_id}","starred_url":"https://api.github.com/users/mwoehlke-kitware/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mwoehlke-kitware/subscriptions","organizations_url":"https://api.github.com/users/mwoehlke-kitware/orgs","repos_url":"https://api.github.com/users/mwoehlke-kitware/repos","events_url":"https://api.github.com/users/mwoehlke-kitware/events{/privacy}","received_events_url":"https://api.github.com/users/mwoehlke-kitware/received_events","type":"User","site_admin":false},"body":"Add a \"tutorial\" for CMake, which presents a sample `CMakeLists.txt` for binding generation and explains it step by step. Add an additional helper function for installing headers. Change ref name of C tutorial to match others, for consistency.\r\n\r\n@ashuang, I'd greatly appreciate any thoughts on wording or additional information you think would be helpful. (Also, since this is at least partly inspired by RobotLocomotion/drake#3426, I'll likewise invite @tkoolen to comment on the \"adequacy\" of this documentation.)","created_at":"2016-09-21T15:19:34Z","updated_at":"2016-09-23T14:21:39Z","closed_at":null,"merged_at":null,"merge_commit_sha":"af6e17ab3077a9a5dcfea23b5b7617df5716f2e2","assignee":{"login":"ashuang","id":1559426,"avatar_url":"https://avatars.githubusercontent.com/u/1559426?v=3","gravatar_id":"","url":"https://api.github.com/users/ashuang","html_url":"https://github.com/ashuang","followers_url":"https://api.github.com/users/ashuang/followers","following_url":"https://api.github.com/users/ashuang/following{/other_user}","gists_url":"https://api.github.com/users/ashuang/gists{/gist_id}","starred_url":"https://api.github.com/users/ashuang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ashuang/subscriptions","organizations_url":"https://api.github.com/users/ashuang/orgs","repos_url":"https://api.github.com/users/ashuang/repos","events_url":"https://api.github.com/users/ashuang/events{/privacy}","received_events_url":"https://api.github.com/users/ashuang/received_events","type":"User","site_admin":false},"assignees":[{"login":"ashuang","id":1559426,"avatar_url":"https://avatars.githubusercontent.com/u/1559426?v=3","gravatar_id":"","url":"https://api.github.com/users/ashuang","html_url":"https://github.com/ashuang","followers_url":"https://api.github.com/users/ashuang/followers","following_url":"https://api.github.com/users/ashuang/following{/other_user}","gists_url":"https://api.github.com/users/ashuang/gists{/gist_id}","starred_url":"https://api.github.com/users/ashuang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ashuang/subscriptions","organizations_url":"https://api.github.com/users/ashuang/orgs","repos_url":"https://api.github.com/users/ashuang/repos","events_url":"https://api.github.com/users/ashuang/events{/privacy}","received_events_url":"https://api.github.com/users/ashuang/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/lcm-proj/lcm/pulls/105/commits","review_comments_url":"https://api.github.com/repos/lcm-proj/lcm/pulls/105/comments","review_comment_url":"https://api.github.com/repos/lcm-proj/lcm/pulls/comments{/number}","comments_url":"https://api.github.com/repos/lcm-proj/lcm/issues/105/comments","statuses_url":"https://api.github.com/repos/lcm-proj/lcm/statuses/3f1ec359098a29ea429dfd1741ca955236caac9a","head":{"label":"mwoehlke-kitware:cmake-consumer-improvements","ref":"cmake-consumer-improvements","sha":"3f1ec359098a29ea429dfd1741ca955236caac9a","user":{"login":"mwoehlke-kitware","id":6474409,"avatar_url":"https://avatars.githubusercontent.com/u/6474409?v=3","gravatar_id":"","url":"https://api.github.com/users/mwoehlke-kitware","html_url":"https://github.com/mwoehlke-kitware","followers_url":"https://api.github.com/users/mwoehlke-kitware/followers","following_url":"https://api.github.com/users/mwoehlke-kitware/following{/other_user}","gists_url":"https://api.github.com/users/mwoehlke-kitware/gists{/gist_id}","starred_url":"https://api.github.com/users/mwoehlke-kitware/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mwoehlke-kitware/subscriptions","organizations_url":"https://api.github.com/users/mwoehlke-kitware/orgs","repos_url":"https://api.github.com/users/mwoehlke-kitware/repos","events_url":"https://api.github.com/users/mwoehlke-kitware/events{/privacy}","received_events_url":"https://api.github.com/users/mwoehlke-kitware/received_events","type":"User","site_admin":false},"repo":{"id":62328946,"name":"lcm","full_name":"mwoehlke-kitware/lcm","owner":{"login":"mwoehlke-kitware","id":6474409,"avatar_url":"https://avatars.githubusercontent.com/u/6474409?v=3","gravatar_id":"","url":"https://api.github.com/users/mwoehlke-kitware","html_url":"https://github.com/mwoehlke-kitware","followers_url":"https://api.github.com/users/mwoehlke-kitware/followers","following_url":"https://api.github.com/users/mwoehlke-kitware/following{/other_user}","gists_url":"https://api.github.com/users/mwoehlke-kitware/gists{/gist_id}","starred_url":"https://api.github.com/users/mwoehlke-kitware/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mwoehlke-kitware/subscriptions","organizations_url":"https://api.github.com/users/mwoehlke-kitware/orgs","repos_url":"https://api.github.com/users/mwoehlke-kitware/repos","events_url":"https://api.github.com/users/mwoehlke-kitware/events{/privacy}","received_events_url":"https://api.github.com/users/mwoehlke-kitware/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/mwoehlke-kitware/lcm","description":"Lightweight Communications and Marshalling","fork":true,"url":"https://api.github.com/repos/mwoehlke-kitware/lcm","forks_url":"https://api.github.com/repos/mwoehlke-kitware/lcm/forks","keys_url":"https://api.github.com/repos/mwoehlke-kitware/lcm/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mwoehlke-kitware/lcm/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mwoehlke-kitware/lcm/teams","hooks_url":"https://api.github.com/repos/mwoehlke-kitware/lcm/hooks","issue_events_url":"https://api.github.com/repos/mwoehlke-kitware/lcm/issues/events{/number}","events_url":"https://api.github.com/repos/mwoehlke-kitware/lcm/events","assignees_url":"https://api.github.com/repos/mwoehlke-kitware/lcm/assignees{/user}","branches_url":"https://api.github.com/repos/mwoehlke-kitware/lcm/branches{/branch}","tags_url":"https://api.github.com/repos/mwoehlke-kitware/lcm/tags","blobs_url":"https://api.github.com/repos/mwoehlke-kitware/lcm/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mwoehlke-kitware/lcm/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mwoehlke-kitware/lcm/git/refs{/sha}","trees_url":"https://api.github.com/repos/mwoehlke-kitware/lcm/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mwoehlke-kitware/lcm/statuses/{sha}","languages_url":"https://api.github.com/repos/mwoehlke-kitware/lcm/languages","stargazers_url":"https://api.github.com/repos/mwoehlke-kitware/lcm/stargazers","contributors_url":"https://api.github.com/repos/mwoehlke-kitware/lcm/contributors","subscribers_url":"https://api.github.com/repos/mwoehlke-kitware/lcm/subscribers","subscription_url":"https://api.github.com/repos/mwoehlke-kitware/lcm/subscription","commits_url":"https://api.github.com/repos/mwoehlke-kitware/lcm/commits{/sha}","git_commits_url":"https://api.github.com/repos/mwoehlke-kitware/lcm/git/commits{/sha}","comments_url":"https://api.github.com/repos/mwoehlke-kitware/lcm/comments{/number}","issue_comment_url":"https://api.github.com/repos/mwoehlke-kitware/lcm/issues/comments{/number}","contents_url":"https://api.github.com/repos/mwoehlke-kitware/lcm/contents/{+path}","compare_url":"https://api.github.com/repos/mwoehlke-kitware/lcm/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mwoehlke-kitware/lcm/merges","archive_url":"https://api.github.com/repos/mwoehlke-kitware/lcm/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mwoehlke-kitware/lcm/downloads","issues_url":"https://api.github.com/repos/mwoehlke-kitware/lcm/issues{/number}","pulls_url":"https://api.github.com/repos/mwoehlke-kitware/lcm/pulls{/number}","milestones_url":"https://api.github.com/repos/mwoehlke-kitware/lcm/milestones{/number}","notifications_url":"https://api.github.com/repos/mwoehlke-kitware/lcm/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mwoehlke-kitware/lcm/labels{/name}","releases_url":"https://api.github.com/repos/mwoehlke-kitware/lcm/releases{/id}","deployments_url":"https://api.github.com/repos/mwoehlke-kitware/lcm/deployments","created_at":"2016-06-30T17:11:54Z","updated_at":"2016-06-30T17:11:59Z","pushed_at":"2016-09-21T19:12:27Z","git_url":"git://github.com/mwoehlke-kitware/lcm.git","ssh_url":"git@github.com:mwoehlke-kitware/lcm.git","clone_url":"https://github.com/mwoehlke-kitware/lcm.git","svn_url":"https://github.com/mwoehlke-kitware/lcm","homepage":null,"size":8015,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"lcm-proj:master","ref":"master","sha":"a35a821393e4cc6a0bcaa25b5a836d7c62677bf7","user":{"login":"lcm-proj","id":8745664,"avatar_url":"https://avatars.githubusercontent.com/u/8745664?v=3","gravatar_id":"","url":"https://api.github.com/users/lcm-proj","html_url":"https://github.com/lcm-proj","followers_url":"https://api.github.com/users/lcm-proj/followers","following_url":"https://api.github.com/users/lcm-proj/following{/other_user}","gists_url":"https://api.github.com/users/lcm-proj/gists{/gist_id}","starred_url":"https://api.github.com/users/lcm-proj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lcm-proj/subscriptions","organizations_url":"https://api.github.com/users/lcm-proj/orgs","repos_url":"https://api.github.com/users/lcm-proj/repos","events_url":"https://api.github.com/users/lcm-proj/events{/privacy}","received_events_url":"https://api.github.com/users/lcm-proj/received_events","type":"Organization","site_admin":false},"repo":{"id":23947487,"name":"lcm","full_name":"lcm-proj/lcm","owner":{"login":"lcm-proj","id":8745664,"avatar_url":"https://avatars.githubusercontent.com/u/8745664?v=3","gravatar_id":"","url":"https://api.github.com/users/lcm-proj","html_url":"https://github.com/lcm-proj","followers_url":"https://api.github.com/users/lcm-proj/followers","following_url":"https://api.github.com/users/lcm-proj/following{/other_user}","gists_url":"https://api.github.com/users/lcm-proj/gists{/gist_id}","starred_url":"https://api.github.com/users/lcm-proj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lcm-proj/subscriptions","organizations_url":"https://api.github.com/users/lcm-proj/orgs","repos_url":"https://api.github.com/users/lcm-proj/repos","events_url":"https://api.github.com/users/lcm-proj/events{/privacy}","received_events_url":"https://api.github.com/users/lcm-proj/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/lcm-proj/lcm","description":"Lightweight Communications and Marshalling","fork":false,"url":"https://api.github.com/repos/lcm-proj/lcm","forks_url":"https://api.github.com/repos/lcm-proj/lcm/forks","keys_url":"https://api.github.com/repos/lcm-proj/lcm/keys{/key_id}","collaborators_url":"https://api.github.com/repos/lcm-proj/lcm/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/lcm-proj/lcm/teams","hooks_url":"https://api.github.com/repos/lcm-proj/lcm/hooks","issue_events_url":"https://api.github.com/repos/lcm-proj/lcm/issues/events{/number}","events_url":"https://api.github.com/repos/lcm-proj/lcm/events","assignees_url":"https://api.github.com/repos/lcm-proj/lcm/assignees{/user}","branches_url":"https://api.github.com/repos/lcm-proj/lcm/branches{/branch}","tags_url":"https://api.github.com/repos/lcm-proj/lcm/tags","blobs_url":"https://api.github.com/repos/lcm-proj/lcm/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/lcm-proj/lcm/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/lcm-proj/lcm/git/refs{/sha}","trees_url":"https://api.github.com/repos/lcm-proj/lcm/git/trees{/sha}","statuses_url":"https://api.github.com/repos/lcm-proj/lcm/statuses/{sha}","languages_url":"https://api.github.com/repos/lcm-proj/lcm/languages","stargazers_url":"https://api.github.com/repos/lcm-proj/lcm/stargazers","contributors_url":"https://api.github.com/repos/lcm-proj/lcm/contributors","subscribers_url":"https://api.github.com/repos/lcm-proj/lcm/subscribers","subscription_url":"https://api.github.com/repos/lcm-proj/lcm/subscription","commits_url":"https://api.github.com/repos/lcm-proj/lcm/commits{/sha}","git_commits_url":"https://api.github.com/repos/lcm-proj/lcm/git/commits{/sha}","comments_url":"https://api.github.com/repos/lcm-proj/lcm/comments{/number}","issue_comment_url":"https://api.github.com/repos/lcm-proj/lcm/issues/comments{/number}","contents_url":"https://api.github.com/repos/lcm-proj/lcm/contents/{+path}","compare_url":"https://api.github.com/repos/lcm-proj/lcm/compare/{base}...{head}","merges_url":"https://api.github.com/repos/lcm-proj/lcm/merges","archive_url":"https://api.github.com/repos/lcm-proj/lcm/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/lcm-proj/lcm/downloads","issues_url":"https://api.github.com/repos/lcm-proj/lcm/issues{/number}","pulls_url":"https://api.github.com/repos/lcm-proj/lcm/pulls{/number}","milestones_url":"https://api.github.com/repos/lcm-proj/lcm/milestones{/number}","notifications_url":"https://api.github.com/repos/lcm-proj/lcm/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/lcm-proj/lcm/labels{/name}","releases_url":"https://api.github.com/repos/lcm-proj/lcm/releases{/id}","deployments_url":"https://api.github.com/repos/lcm-proj/lcm/deployments","created_at":"2014-09-12T05:01:03Z","updated_at":"2016-09-19T20:16:53Z","pushed_at":"2016-09-22T21:03:29Z","git_url":"git://github.com/lcm-proj/lcm.git","ssh_url":"git@github.com:lcm-proj/lcm.git","clone_url":"https://github.com/lcm-proj/lcm.git","svn_url":"https://github.com/lcm-proj/lcm","homepage":null,"size":8521,"stargazers_count":93,"watchers_count":93,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":74,"mirror_url":null,"open_issues_count":28,"forks":74,"open_issues":28,"watchers":93,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/lcm-proj/lcm/pulls/105"},"html":{"href":"https://github.com/lcm-proj/lcm/pull/105"},"issue":{"href":"https://api.github.com/repos/lcm-proj/lcm/issues/105"},"comments":{"href":"https://api.github.com/repos/lcm-proj/lcm/issues/105/comments"},"review_comments":{"href":"https://api.github.com/repos/lcm-proj/lcm/pulls/105/comments"},"review_comment":{"href":"https://api.github.com/repos/lcm-proj/lcm/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/lcm-proj/lcm/pulls/105/commits"},"statuses":{"href":"https://api.github.com/repos/lcm-proj/lcm/statuses/3f1ec359098a29ea429dfd1741ca955236caac9a"}}}}
{"actor":{"display_login":"tkoolen"}}