{"action":"created","comment":{"url":"https://api.github.com/repos/google/protobuf/pulls/comments/65774675","id":65774675,"diff_hunk":"@@ -5,15 +5,19 @@ set(PROTOBUF_VERSION_STRING \"@protobuf_VERSION_STRING@\")\n # Imported targets\n include(\"${CMAKE_CURRENT_LIST_DIR}/protobuf-targets.cmake\")\n \n-# Compute the installation prefix relative to this file.\n-get_filename_component(_PROTOBUF_IMPORT_PREFIX\n-  \"${_PROTOBUF_PACKAGE_PREFIX}\" PATH)\n-get_filename_component(_PROTOBUF_IMPORT_PREFIX\n-  \"${_PROTOBUF_IMPORT_PREFIX}\" PATH)\n-get_filename_component(_PROTOBUF_IMPORT_PREFIX\n-  \"${_PROTOBUF_IMPORT_PREFIX}\" PATH)\n-\n # CMake FindProtobuf module compatible file\n-if(NOT DEFINED PROTOBUF_MODULE_COMPATIBLE OR \"${PROTOBUF_MODULE_COMPATIBLE}\")\n-  include(\"${_PROTOBUF_PACKAGE_PREFIX}/protobuf-module.cmake\")\n+option(protobuf_MODULE_COMPATIBLE \"Enable support for FindProtobuf.cmake style usage\" OFF)\n+if(protobuf_MODULE_COMPATIBLE)\n+\n+  # Compute the installation prefix relative to this file.","path":"cmake/protobuf-config.cmake.in","position":18,"original_position":18,"commit_id":"c018288f1320dfc79a458024a87c8202bf3188f6","original_commit_id":"c018288f1320dfc79a458024a87c8202bf3188f6","user":{"login":"podsvirov","id":8400779,"avatar_url":"https://avatars.githubusercontent.com/u/8400779?v=3","gravatar_id":"","url":"https://api.github.com/users/podsvirov","html_url":"https://github.com/podsvirov","followers_url":"https://api.github.com/users/podsvirov/followers","following_url":"https://api.github.com/users/podsvirov/following{/other_user}","gists_url":"https://api.github.com/users/podsvirov/gists{/gist_id}","starred_url":"https://api.github.com/users/podsvirov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/podsvirov/subscriptions","organizations_url":"https://api.github.com/users/podsvirov/orgs","repos_url":"https://api.github.com/users/podsvirov/repos","events_url":"https://api.github.com/users/podsvirov/events{/privacy}","received_events_url":"https://api.github.com/users/podsvirov/received_events","type":"User","site_admin":false},"body":"That is unnecessary. See code #1642.","created_at":"2016-06-03T21:00:15Z","updated_at":"2016-06-03T21:00:15Z","html_url":"https://github.com/google/protobuf/pull/1643#discussion_r65774675","pull_request_url":"https://api.github.com/repos/google/protobuf/pulls/1643","_links":{"self":{"href":"https://api.github.com/repos/google/protobuf/pulls/comments/65774675"},"html":{"href":"https://github.com/google/protobuf/pull/1643#discussion_r65774675"},"pull_request":{"href":"https://api.github.com/repos/google/protobuf/pulls/1643"}}},"pull_request":{"url":"https://api.github.com/repos/google/protobuf/pulls/1643","id":72445741,"html_url":"https://github.com/google/protobuf/pull/1643","diff_url":"https://github.com/google/protobuf/pull/1643.diff","patch_url":"https://github.com/google/protobuf/pull/1643.patch","issue_url":"https://api.github.com/repos/google/protobuf/issues/1643","number":1643,"state":"open","locked":false,"title":"Build examples in CMake","user":{"login":"yeswalrus","id":354012,"avatar_url":"https://avatars.githubusercontent.com/u/354012?v=3","gravatar_id":"","url":"https://api.github.com/users/yeswalrus","html_url":"https://github.com/yeswalrus","followers_url":"https://api.github.com/users/yeswalrus/followers","following_url":"https://api.github.com/users/yeswalrus/following{/other_user}","gists_url":"https://api.github.com/users/yeswalrus/gists{/gist_id}","starred_url":"https://api.github.com/users/yeswalrus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yeswalrus/subscriptions","organizations_url":"https://api.github.com/users/yeswalrus/orgs","repos_url":"https://api.github.com/users/yeswalrus/repos","events_url":"https://api.github.com/users/yeswalrus/events{/privacy}","received_events_url":"https://api.github.com/users/yeswalrus/received_events","type":"User","site_admin":false},"body":"Based on https://github.com/podsvirov/protobuf/tree/topic-cmake-project\r\n\r\n- Adds support for building the examples\r\n- Adds support for using the build directory as a local install directory (set protobuf_DIR to the build folder)\r\n- Fixes breaks in protobuf-module.cmake\r\n\r\nExamples may be built separately or as part of a full build of protobuf using protobuf_BUILD_EXAMPLES. This is done using ExternalProject_Add to help ensure that building the examples as part of a full build is as close as possible to building them independently.\r\n\r\n@podsvirov This addresses my comments on https://github.com/google/protobuf/pull/1642 and is much more limited in scope so should be easier to merge.\r\n  \r\n#### On using sub_directory\r\nOriginally I used sub_directory to include the examples repo, however there was a cascade of issues caused by calling find_package on a project that is currently in the configuration step, particularly with protobuf_MODULE_COMPATILBITY set.\r\n- CMP0024 disallows including the result of an export command, which forces the definition of alias targets\r\n- The protobuf-module.cmake file uses IMPORTED_LOCATION properties to determine locations, but those fields are not available for alias targets.\r\n- CMP0026 disallows reading LOCATION properties, so the best we can do is using generator expressions\r\n\r\nIf the additional complexity in protobuf-config and protobuf-module is acceptable, or if we're ok not supporting protobuf_MODULE_COMPATIBILTIY when generating in that mode, sub_directory becomes the better option.","created_at":"2016-06-03T02:28:17Z","updated_at":"2016-06-03T21:00:15Z","closed_at":null,"merged_at":null,"merge_commit_sha":"3b2c9de8bc4171175f98c829afca2e2ec03198ba","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/google/protobuf/pulls/1643/commits","review_comments_url":"https://api.github.com/repos/google/protobuf/pulls/1643/comments","review_comment_url":"https://api.github.com/repos/google/protobuf/pulls/comments{/number}","comments_url":"https://api.github.com/repos/google/protobuf/issues/1643/comments","statuses_url":"https://api.github.com/repos/google/protobuf/statuses/c018288f1320dfc79a458024a87c8202bf3188f6","head":{"label":"yeswalrus:cmake-examples","ref":"cmake-examples","sha":"c018288f1320dfc79a458024a87c8202bf3188f6","user":{"login":"yeswalrus","id":354012,"avatar_url":"https://avatars.githubusercontent.com/u/354012?v=3","gravatar_id":"","url":"https://api.github.com/users/yeswalrus","html_url":"https://github.com/yeswalrus","followers_url":"https://api.github.com/users/yeswalrus/followers","following_url":"https://api.github.com/users/yeswalrus/following{/other_user}","gists_url":"https://api.github.com/users/yeswalrus/gists{/gist_id}","starred_url":"https://api.github.com/users/yeswalrus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yeswalrus/subscriptions","organizations_url":"https://api.github.com/users/yeswalrus/orgs","repos_url":"https://api.github.com/users/yeswalrus/repos","events_url":"https://api.github.com/users/yeswalrus/events{/privacy}","received_events_url":"https://api.github.com/users/yeswalrus/received_events","type":"User","site_admin":false},"repo":{"id":58013378,"name":"protobuf","full_name":"yeswalrus/protobuf","owner":{"login":"yeswalrus","id":354012,"avatar_url":"https://avatars.githubusercontent.com/u/354012?v=3","gravatar_id":"","url":"https://api.github.com/users/yeswalrus","html_url":"https://github.com/yeswalrus","followers_url":"https://api.github.com/users/yeswalrus/followers","following_url":"https://api.github.com/users/yeswalrus/following{/other_user}","gists_url":"https://api.github.com/users/yeswalrus/gists{/gist_id}","starred_url":"https://api.github.com/users/yeswalrus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yeswalrus/subscriptions","organizations_url":"https://api.github.com/users/yeswalrus/orgs","repos_url":"https://api.github.com/users/yeswalrus/repos","events_url":"https://api.github.com/users/yeswalrus/events{/privacy}","received_events_url":"https://api.github.com/users/yeswalrus/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/yeswalrus/protobuf","description":"Protocol Buffers - Google's data interchange format","fork":true,"url":"https://api.github.com/repos/yeswalrus/protobuf","forks_url":"https://api.github.com/repos/yeswalrus/protobuf/forks","keys_url":"https://api.github.com/repos/yeswalrus/protobuf/keys{/key_id}","collaborators_url":"https://api.github.com/repos/yeswalrus/protobuf/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/yeswalrus/protobuf/teams","hooks_url":"https://api.github.com/repos/yeswalrus/protobuf/hooks","issue_events_url":"https://api.github.com/repos/yeswalrus/protobuf/issues/events{/number}","events_url":"https://api.github.com/repos/yeswalrus/protobuf/events","assignees_url":"https://api.github.com/repos/yeswalrus/protobuf/assignees{/user}","branches_url":"https://api.github.com/repos/yeswalrus/protobuf/branches{/branch}","tags_url":"https://api.github.com/repos/yeswalrus/protobuf/tags","blobs_url":"https://api.github.com/repos/yeswalrus/protobuf/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/yeswalrus/protobuf/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/yeswalrus/protobuf/git/refs{/sha}","trees_url":"https://api.github.com/repos/yeswalrus/protobuf/git/trees{/sha}","statuses_url":"https://api.github.com/repos/yeswalrus/protobuf/statuses/{sha}","languages_url":"https://api.github.com/repos/yeswalrus/protobuf/languages","stargazers_url":"https://api.github.com/repos/yeswalrus/protobuf/stargazers","contributors_url":"https://api.github.com/repos/yeswalrus/protobuf/contributors","subscribers_url":"https://api.github.com/repos/yeswalrus/protobuf/subscribers","subscription_url":"https://api.github.com/repos/yeswalrus/protobuf/subscription","commits_url":"https://api.github.com/repos/yeswalrus/protobuf/commits{/sha}","git_commits_url":"https://api.github.com/repos/yeswalrus/protobuf/git/commits{/sha}","comments_url":"https://api.github.com/repos/yeswalrus/protobuf/comments{/number}","issue_comment_url":"https://api.github.com/repos/yeswalrus/protobuf/issues/comments{/number}","contents_url":"https://api.github.com/repos/yeswalrus/protobuf/contents/{+path}","compare_url":"https://api.github.com/repos/yeswalrus/protobuf/compare/{base}...{head}","merges_url":"https://api.github.com/repos/yeswalrus/protobuf/merges","archive_url":"https://api.github.com/repos/yeswalrus/protobuf/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/yeswalrus/protobuf/downloads","issues_url":"https://api.github.com/repos/yeswalrus/protobuf/issues{/number}","pulls_url":"https://api.github.com/repos/yeswalrus/protobuf/pulls{/number}","milestones_url":"https://api.github.com/repos/yeswalrus/protobuf/milestones{/number}","notifications_url":"https://api.github.com/repos/yeswalrus/protobuf/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/yeswalrus/protobuf/labels{/name}","releases_url":"https://api.github.com/repos/yeswalrus/protobuf/releases{/id}","deployments_url":"https://api.github.com/repos/yeswalrus/protobuf/deployments","created_at":"2016-05-04T01:28:06Z","updated_at":"2016-05-04T01:28:17Z","pushed_at":"2016-06-03T18:26:05Z","git_url":"git://github.com/yeswalrus/protobuf.git","ssh_url":"git@github.com:yeswalrus/protobuf.git","clone_url":"https://github.com/yeswalrus/protobuf.git","svn_url":"https://github.com/yeswalrus/protobuf","homepage":"https://developers.google.com/protocol-buffers/","size":32793,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"google:master","ref":"master","sha":"20b532544fde1dff34429b52db95c3a96409b73c","user":{"login":"google","id":1342004,"avatar_url":"https://avatars.githubusercontent.com/u/1342004?v=3","gravatar_id":"","url":"https://api.github.com/users/google","html_url":"https://github.com/google","followers_url":"https://api.github.com/users/google/followers","following_url":"https://api.github.com/users/google/following{/other_user}","gists_url":"https://api.github.com/users/google/gists{/gist_id}","starred_url":"https://api.github.com/users/google/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/google/subscriptions","organizations_url":"https://api.github.com/users/google/orgs","repos_url":"https://api.github.com/users/google/repos","events_url":"https://api.github.com/users/google/events{/privacy}","received_events_url":"https://api.github.com/users/google/received_events","type":"Organization","site_admin":false},"repo":{"id":23357588,"name":"protobuf","full_name":"google/protobuf","owner":{"login":"google","id":1342004,"avatar_url":"https://avatars.githubusercontent.com/u/1342004?v=3","gravatar_id":"","url":"https://api.github.com/users/google","html_url":"https://github.com/google","followers_url":"https://api.github.com/users/google/followers","following_url":"https://api.github.com/users/google/following{/other_user}","gists_url":"https://api.github.com/users/google/gists{/gist_id}","starred_url":"https://api.github.com/users/google/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/google/subscriptions","organizations_url":"https://api.github.com/users/google/orgs","repos_url":"https://api.github.com/users/google/repos","events_url":"https://api.github.com/users/google/events{/privacy}","received_events_url":"https://api.github.com/users/google/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/google/protobuf","description":"Protocol Buffers - Google's data interchange format","fork":false,"url":"https://api.github.com/repos/google/protobuf","forks_url":"https://api.github.com/repos/google/protobuf/forks","keys_url":"https://api.github.com/repos/google/protobuf/keys{/key_id}","collaborators_url":"https://api.github.com/repos/google/protobuf/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/google/protobuf/teams","hooks_url":"https://api.github.com/repos/google/protobuf/hooks","issue_events_url":"https://api.github.com/repos/google/protobuf/issues/events{/number}","events_url":"https://api.github.com/repos/google/protobuf/events","assignees_url":"https://api.github.com/repos/google/protobuf/assignees{/user}","branches_url":"https://api.github.com/repos/google/protobuf/branches{/branch}","tags_url":"https://api.github.com/repos/google/protobuf/tags","blobs_url":"https://api.github.com/repos/google/protobuf/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/google/protobuf/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/google/protobuf/git/refs{/sha}","trees_url":"https://api.github.com/repos/google/protobuf/git/trees{/sha}","statuses_url":"https://api.github.com/repos/google/protobuf/statuses/{sha}","languages_url":"https://api.github.com/repos/google/protobuf/languages","stargazers_url":"https://api.github.com/repos/google/protobuf/stargazers","contributors_url":"https://api.github.com/repos/google/protobuf/contributors","subscribers_url":"https://api.github.com/repos/google/protobuf/subscribers","subscription_url":"https://api.github.com/repos/google/protobuf/subscription","commits_url":"https://api.github.com/repos/google/protobuf/commits{/sha}","git_commits_url":"https://api.github.com/repos/google/protobuf/git/commits{/sha}","comments_url":"https://api.github.com/repos/google/protobuf/comments{/number}","issue_comment_url":"https://api.github.com/repos/google/protobuf/issues/comments{/number}","contents_url":"https://api.github.com/repos/google/protobuf/contents/{+path}","compare_url":"https://api.github.com/repos/google/protobuf/compare/{base}...{head}","merges_url":"https://api.github.com/repos/google/protobuf/merges","archive_url":"https://api.github.com/repos/google/protobuf/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/google/protobuf/downloads","issues_url":"https://api.github.com/repos/google/protobuf/issues{/number}","pulls_url":"https://api.github.com/repos/google/protobuf/pulls{/number}","milestones_url":"https://api.github.com/repos/google/protobuf/milestones{/number}","notifications_url":"https://api.github.com/repos/google/protobuf/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/google/protobuf/labels{/name}","releases_url":"https://api.github.com/repos/google/protobuf/releases{/id}","deployments_url":"https://api.github.com/repos/google/protobuf/deployments","created_at":"2014-08-26T15:52:15Z","updated_at":"2016-06-03T20:34:13Z","pushed_at":"2016-06-03T18:26:08Z","git_url":"git://github.com/google/protobuf.git","ssh_url":"git@github.com:google/protobuf.git","clone_url":"https://github.com/google/protobuf.git","svn_url":"https://github.com/google/protobuf","homepage":"https://developers.google.com/protocol-buffers/","size":60097,"stargazers_count":9297,"watchers_count":9297,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":2823,"mirror_url":null,"open_issues_count":400,"forks":2823,"open_issues":400,"watchers":9297,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/google/protobuf/pulls/1643"},"html":{"href":"https://github.com/google/protobuf/pull/1643"},"issue":{"href":"https://api.github.com/repos/google/protobuf/issues/1643"},"comments":{"href":"https://api.github.com/repos/google/protobuf/issues/1643/comments"},"review_comments":{"href":"https://api.github.com/repos/google/protobuf/pulls/1643/comments"},"review_comment":{"href":"https://api.github.com/repos/google/protobuf/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/google/protobuf/pulls/1643/commits"},"statuses":{"href":"https://api.github.com/repos/google/protobuf/statuses/c018288f1320dfc79a458024a87c8202bf3188f6"}}}}
{"actor":{"display_login":"podsvirov"}}