{"action":"created","comment":{"url":"https://api.github.com/repos/libgeos/geos/pulls/comments/229708896","pull_request_review_id":170271049,"id":229708896,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIyOTcwODg5Ng==","diff_hunk":"@@ -1,342 +1,186 @@\n-#################################################################################\n-#\n-# Main GEOS build configuration file for CMake build system\n+################################################################################\n+# Part of CMake configuration for GEOS\n #\n-# Copyright (C) 2009 Mateusz Loskot <mateusz@loskot.net>\n+# Copyright (C) 2018 Mateusz Loskot <mateusz@loskot.net>\n #\n # This is free software; you can redistribute and/or modify it under\n # the terms of the GNU Lesser General Public Licence as published\n # by the Free Software Foundation.\n # See the COPYING file for more information.\n-#\n-#################################################################################\n-cmake_minimum_required(VERSION 3.1.3)\n-\n-if(NOT CMAKE_VERSION)\n-    set(CMAKE_VERSION\n-      \"${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}.${CMAKE_PATCH_VERSION}\")\n-endif()\n+################################################################################\n+cmake_minimum_required(VERSION 3.5)\n \n-if(POLICY CMP0048)\n-    cmake_policy(SET CMP0048 NEW)\n+# TODO: Follow CMake detection of git and version tagging\n+#       https://gitlab.kitware.com/cmake/cmake/blob/master/Source/CMakeVersionSource.cmake\n+if(EXISTS ${CMAKE_SOURCE_DIR}/.git/HEAD)\n+  set(GEOS_BUILD_FROM_GIT ON)\n endif()\n-#################################################################################\n-# Set GEOS project\n-#################################################################################\n-project(GEOS VERSION 3.8.0 LANGUAGES C CXX)\n-# OPTIONS: \"\", \"dev\", \"rc1\" etc.\n-SET(GEOS_PATCH_WORD \"dev\")\n-\n-# Add custom GEOS modules for CMake\n-list(APPEND CMAKE_MODULE_PATH \"${PROJECT_SOURCE_DIR}/cmake/modules\")\n-\n-#################################################################################\n-# Set C++ standard\n-#################################################################################\n-set(CMAKE_CXX_STANDARD 11)\n-set(CMAKE_CXX_STANDARD_REQUIRED ON)\n-set(CMAKE_CXX_EXTENSIONS OFF)\n-\n-message(STATUS \"Setting C++ requirement to C++${CMAKE_CXX_STANDARD}\")\n \n-#################################################################################\n-# Setup GEOS version\n-#################################################################################\n+################################################################################\n+# Options\n+include(CMakeDependentOption)\n+## CMake global variables\n+option(BUILD_SHARED_LIBS \"Build GEOS with shared libraries\" OFF)\n+## GEOS custom variables\n+cmake_dependent_option(GEOS_BUILD_DEVELOPER\n+  \"Build with compilation flags useful for development\" ON\n+  \"GEOS_BUILD_FROM_GIT\" OFF)\n+mark_as_advanced(GEOS_BUILD_DEVELOPER)\n+#TODO: option(GEOS_BUILD_OSX_FRAMEWORK \"Build shared or static library as Framework Bundle for OSX\" OFF)\n+#mark_as_advanced(GEOS_BUILD_OSX_FRAMEWORK)\n \n-# GEOS release version\n-# GEOS C++ library SONAME will use these encoding ABI break at every release\n-set(GEOS_VERSION \"${GEOS_VERSION_MAJOR}.${GEOS_VERSION_MINOR}.${GEOS_VERSION_PATCH}${GEOS_PATCH_WORD}\")\n-set(VERSION \"${GEOS_VERSION}\")\n+################################################################################\n+# Project settings\n+if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.12)","path":"CMakeLists.txt","position":68,"original_position":73,"commit_id":"ab87322f49a6ff74cd70999143ca6e66cacd607f","original_commit_id":"5ff29513ebf00f3261b280a7be0de8225b0eaade","user":{"login":"mloskot","id":80741,"node_id":"MDQ6VXNlcjgwNzQx","avatar_url":"https://avatars2.githubusercontent.com/u/80741?v=4","gravatar_id":"","url":"https://api.github.com/users/mloskot","html_url":"https://github.com/mloskot","followers_url":"https://api.github.com/users/mloskot/followers","following_url":"https://api.github.com/users/mloskot/following{/other_user}","gists_url":"https://api.github.com/users/mloskot/gists{/gist_id}","starred_url":"https://api.github.com/users/mloskot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mloskot/subscriptions","organizations_url":"https://api.github.com/users/mloskot/orgs","repos_url":"https://api.github.com/users/mloskot/repos","events_url":"https://api.github.com/users/mloskot/events{/privacy}","received_events_url":"https://api.github.com/users/mloskot/received_events","type":"User","site_admin":false},"body":"Good catch! I'll fix it.\r\n","created_at":"2018-10-31T14:10:24Z","updated_at":"2018-10-31T14:10:24Z","html_url":"https://github.com/libgeos/geos/pull/130#discussion_r229708896","pull_request_url":"https://api.github.com/repos/libgeos/geos/pulls/130","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/libgeos/geos/pulls/comments/229708896"},"html":{"href":"https://github.com/libgeos/geos/pull/130#discussion_r229708896"},"pull_request":{"href":"https://api.github.com/repos/libgeos/geos/pulls/130"}},"in_reply_to_id":229656847},"pull_request":{"url":"https://api.github.com/repos/libgeos/geos/pulls/130","id":224465589,"node_id":"MDExOlB1bGxSZXF1ZXN0MjI0NDY1NTg5","html_url":"https://github.com/libgeos/geos/pull/130","diff_url":"https://github.com/libgeos/geos/pull/130.diff","patch_url":"https://github.com/libgeos/geos/pull/130.patch","issue_url":"https://api.github.com/repos/libgeos/geos/issues/130","number":130,"state":"open","locked":false,"title":"Modern CMake configuration refactoring","user":{"login":"mloskot","id":80741,"node_id":"MDQ6VXNlcjgwNzQx","avatar_url":"https://avatars2.githubusercontent.com/u/80741?v=4","gravatar_id":"","url":"https://api.github.com/users/mloskot","html_url":"https://github.com/mloskot","followers_url":"https://api.github.com/users/mloskot/followers","following_url":"https://api.github.com/users/mloskot/following{/other_user}","gists_url":"https://api.github.com/users/mloskot/gists{/gist_id}","starred_url":"https://api.github.com/users/mloskot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mloskot/subscriptions","organizations_url":"https://api.github.com/users/mloskot/orgs","repos_url":"https://api.github.com/users/mloskot/repos","events_url":"https://api.github.com/users/mloskot/events{/privacy}","received_events_url":"https://api.github.com/users/mloskot/received_events","type":"User","site_admin":false},"body":"Minimal build and install features implemented according to [Modern CMake](https://www.youtube.com/watch?v=bsXLMQ6WgIk) best practices for all GEOS targets, libraries and tests.\r\n\r\nRequire CMake 3.5 or later.\r\nAdd `cmake/CMakeSettings.json` sample with convenient defaults for users of [CMake integration in Visual Studio 2017]( https://go.microsoft.com//fwlink//?linkid=834763) (usage: copy to root folder).\r\n\r\n-----\r\n\r\nI tested it with CMake 3.11+ on Linux (GCC, clang) and Windows (Visual Studio).\r\n\r\n-----\r\n\r\n@robe2, @pramsey, @dbaston  - following our discussions  on IRC, here I pushed complete update of my [ml/modern-cmake](https://github.com/mloskot/geos/tree/ml/modern-cmake) branch, rebased on the latest `master` @ c81850660a323ae736e68e31daa05f8685cc375c\r\n\r\n## Tasklist\r\n\r\n- [x] Iteration of CMake script clean-ups adding missing `unset`, removing any unnecessary bits and bobs (eg. variables), etc.\r\n\r\n- [x] Add GEOS client example configured with CMake as a test to verify `geos-config.cmake` [package configuration file](https://cmake.org/cmake/help/latest/manual/cmake-packages.7.html) deployment.\r\n\r\n- [x] Update [README.md](https://github.com/mloskot/geos/blob/ml/modern-cmake/README.md) with building, testing, installation and using GEOS with CMake\r\n\r\n- [x] Update `.travis.yml` with complete workflow: configure, build, test, install, configure and build client.  Install latest CMake. Remove Autotools jobs.\r\n\r\n- [x] Update `.appveyor.yml` with workflow: configure, build, test. Install latest CMake. Remove NMake jobs.\r\n\r\n- [ ] Update `.appveyor.yml` with rest of workflow: install, configure and build client. \r\n\r\n- [ ] Tag version with git hash, tag or `-dirty` indicator for modified working copy (see [CMakeVersionSource.cmake](https://gitlab.kitware.com/cmake/cmake/blob/master/Source/CMakeVersionSource.cmake) and related scripts) in CMake's codebase)\r\n\r\n- [ ] Review compilation flags for supported compilers for both consumers, client and developer\r\n\r\n- [ ] Replace ugly old-school `if`-s setting flags per compiler with generator expressions passed to `target_compile_options` and `target_compile_definitions`, for example:\r\n\r\n    ```cmake\r\n    $<$<CXX_COMPILER_ID:GNU>:-Wall;-Wextra;-Wpedantic>\r\n    $<$<CXX_COMPILER_ID:MSVC>:NOMINMAX>\r\n    ```\r\n\r\n- [ ] Add support for OSX Framework\r\n\r\n- [ ] Deal with `tools/CMakeLists.txt` or remove alogn with `geos-config` script\r\n\r\n- [ ] Add CPack integration\r\n\r\n- [ ] ...\r\n\r\nSince I'm not sure if/when I'd be able to complete those TODOs, I'll hand the work over to you now.","created_at":"2018-10-20T10:07:06Z","updated_at":"2018-10-31T14:10:24Z","closed_at":null,"merged_at":null,"merge_commit_sha":"79c4cafb169c3ef68365dfc7ea1aad100ca98b9c","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/libgeos/geos/pulls/130/commits","review_comments_url":"https://api.github.com/repos/libgeos/geos/pulls/130/comments","review_comment_url":"https://api.github.com/repos/libgeos/geos/pulls/comments{/number}","comments_url":"https://api.github.com/repos/libgeos/geos/issues/130/comments","statuses_url":"https://api.github.com/repos/libgeos/geos/statuses/ab87322f49a6ff74cd70999143ca6e66cacd607f","head":{"label":"mloskot:ml/modern-cmake","ref":"ml/modern-cmake","sha":"ab87322f49a6ff74cd70999143ca6e66cacd607f","user":{"login":"mloskot","id":80741,"node_id":"MDQ6VXNlcjgwNzQx","avatar_url":"https://avatars2.githubusercontent.com/u/80741?v=4","gravatar_id":"","url":"https://api.github.com/users/mloskot","html_url":"https://github.com/mloskot","followers_url":"https://api.github.com/users/mloskot/followers","following_url":"https://api.github.com/users/mloskot/following{/other_user}","gists_url":"https://api.github.com/users/mloskot/gists{/gist_id}","starred_url":"https://api.github.com/users/mloskot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mloskot/subscriptions","organizations_url":"https://api.github.com/users/mloskot/orgs","repos_url":"https://api.github.com/users/mloskot/repos","events_url":"https://api.github.com/users/mloskot/events{/privacy}","received_events_url":"https://api.github.com/users/mloskot/received_events","type":"User","site_admin":false},"repo":{"id":140008631,"node_id":"MDEwOlJlcG9zaXRvcnkxNDAwMDg2MzE=","name":"geos","full_name":"mloskot/geos","private":false,"owner":{"login":"mloskot","id":80741,"node_id":"MDQ6VXNlcjgwNzQx","avatar_url":"https://avatars2.githubusercontent.com/u/80741?v=4","gravatar_id":"","url":"https://api.github.com/users/mloskot","html_url":"https://github.com/mloskot","followers_url":"https://api.github.com/users/mloskot/followers","following_url":"https://api.github.com/users/mloskot/following{/other_user}","gists_url":"https://api.github.com/users/mloskot/gists{/gist_id}","starred_url":"https://api.github.com/users/mloskot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mloskot/subscriptions","organizations_url":"https://api.github.com/users/mloskot/orgs","repos_url":"https://api.github.com/users/mloskot/repos","events_url":"https://api.github.com/users/mloskot/events{/privacy}","received_events_url":"https://api.github.com/users/mloskot/received_events","type":"User","site_admin":false},"html_url":"https://github.com/mloskot/geos","description":"Geometry Engine, Open Source [MIRROR]","fork":true,"url":"https://api.github.com/repos/mloskot/geos","forks_url":"https://api.github.com/repos/mloskot/geos/forks","keys_url":"https://api.github.com/repos/mloskot/geos/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mloskot/geos/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mloskot/geos/teams","hooks_url":"https://api.github.com/repos/mloskot/geos/hooks","issue_events_url":"https://api.github.com/repos/mloskot/geos/issues/events{/number}","events_url":"https://api.github.com/repos/mloskot/geos/events","assignees_url":"https://api.github.com/repos/mloskot/geos/assignees{/user}","branches_url":"https://api.github.com/repos/mloskot/geos/branches{/branch}","tags_url":"https://api.github.com/repos/mloskot/geos/tags","blobs_url":"https://api.github.com/repos/mloskot/geos/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mloskot/geos/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mloskot/geos/git/refs{/sha}","trees_url":"https://api.github.com/repos/mloskot/geos/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mloskot/geos/statuses/{sha}","languages_url":"https://api.github.com/repos/mloskot/geos/languages","stargazers_url":"https://api.github.com/repos/mloskot/geos/stargazers","contributors_url":"https://api.github.com/repos/mloskot/geos/contributors","subscribers_url":"https://api.github.com/repos/mloskot/geos/subscribers","subscription_url":"https://api.github.com/repos/mloskot/geos/subscription","commits_url":"https://api.github.com/repos/mloskot/geos/commits{/sha}","git_commits_url":"https://api.github.com/repos/mloskot/geos/git/commits{/sha}","comments_url":"https://api.github.com/repos/mloskot/geos/comments{/number}","issue_comment_url":"https://api.github.com/repos/mloskot/geos/issues/comments{/number}","contents_url":"https://api.github.com/repos/mloskot/geos/contents/{+path}","compare_url":"https://api.github.com/repos/mloskot/geos/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mloskot/geos/merges","archive_url":"https://api.github.com/repos/mloskot/geos/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mloskot/geos/downloads","issues_url":"https://api.github.com/repos/mloskot/geos/issues{/number}","pulls_url":"https://api.github.com/repos/mloskot/geos/pulls{/number}","milestones_url":"https://api.github.com/repos/mloskot/geos/milestones{/number}","notifications_url":"https://api.github.com/repos/mloskot/geos/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mloskot/geos/labels{/name}","releases_url":"https://api.github.com/repos/mloskot/geos/releases{/id}","deployments_url":"https://api.github.com/repos/mloskot/geos/deployments","created_at":"2018-07-06T16:38:23Z","updated_at":"2018-07-06T16:38:29Z","pushed_at":"2018-10-31T13:57:24Z","git_url":"git://github.com/mloskot/geos.git","ssh_url":"git@github.com:mloskot/geos.git","clone_url":"https://github.com/mloskot/geos.git","svn_url":"https://github.com/mloskot/geos","homepage":"http://geos.osgeo.org","size":17060,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"lgpl-2.1","name":"GNU Lesser General Public License v2.1","spdx_id":"LGPL-2.1","url":"https://api.github.com/licenses/lgpl-2.1","node_id":"MDc6TGljZW5zZTEx"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"libgeos:master","ref":"master","sha":"67d6eafd9a95fdb9890bbcdce6ce85aab0c1dce2","user":{"login":"libgeos","id":1067964,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEwNjc5NjQ=","avatar_url":"https://avatars2.githubusercontent.com/u/1067964?v=4","gravatar_id":"","url":"https://api.github.com/users/libgeos","html_url":"https://github.com/libgeos","followers_url":"https://api.github.com/users/libgeos/followers","following_url":"https://api.github.com/users/libgeos/following{/other_user}","gists_url":"https://api.github.com/users/libgeos/gists{/gist_id}","starred_url":"https://api.github.com/users/libgeos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/libgeos/subscriptions","organizations_url":"https://api.github.com/users/libgeos/orgs","repos_url":"https://api.github.com/users/libgeos/repos","events_url":"https://api.github.com/users/libgeos/events{/privacy}","received_events_url":"https://api.github.com/users/libgeos/received_events","type":"Organization","site_admin":false},"repo":{"id":2651432,"node_id":"MDEwOlJlcG9zaXRvcnkyNjUxNDMy","name":"geos","full_name":"libgeos/geos","private":false,"owner":{"login":"libgeos","id":1067964,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEwNjc5NjQ=","avatar_url":"https://avatars2.githubusercontent.com/u/1067964?v=4","gravatar_id":"","url":"https://api.github.com/users/libgeos","html_url":"https://github.com/libgeos","followers_url":"https://api.github.com/users/libgeos/followers","following_url":"https://api.github.com/users/libgeos/following{/other_user}","gists_url":"https://api.github.com/users/libgeos/gists{/gist_id}","starred_url":"https://api.github.com/users/libgeos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/libgeos/subscriptions","organizations_url":"https://api.github.com/users/libgeos/orgs","repos_url":"https://api.github.com/users/libgeos/repos","events_url":"https://api.github.com/users/libgeos/events{/privacy}","received_events_url":"https://api.github.com/users/libgeos/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/libgeos/geos","description":"Geometry Engine, Open Source [MIRROR]","fork":false,"url":"https://api.github.com/repos/libgeos/geos","forks_url":"https://api.github.com/repos/libgeos/geos/forks","keys_url":"https://api.github.com/repos/libgeos/geos/keys{/key_id}","collaborators_url":"https://api.github.com/repos/libgeos/geos/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/libgeos/geos/teams","hooks_url":"https://api.github.com/repos/libgeos/geos/hooks","issue_events_url":"https://api.github.com/repos/libgeos/geos/issues/events{/number}","events_url":"https://api.github.com/repos/libgeos/geos/events","assignees_url":"https://api.github.com/repos/libgeos/geos/assignees{/user}","branches_url":"https://api.github.com/repos/libgeos/geos/branches{/branch}","tags_url":"https://api.github.com/repos/libgeos/geos/tags","blobs_url":"https://api.github.com/repos/libgeos/geos/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/libgeos/geos/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/libgeos/geos/git/refs{/sha}","trees_url":"https://api.github.com/repos/libgeos/geos/git/trees{/sha}","statuses_url":"https://api.github.com/repos/libgeos/geos/statuses/{sha}","languages_url":"https://api.github.com/repos/libgeos/geos/languages","stargazers_url":"https://api.github.com/repos/libgeos/geos/stargazers","contributors_url":"https://api.github.com/repos/libgeos/geos/contributors","subscribers_url":"https://api.github.com/repos/libgeos/geos/subscribers","subscription_url":"https://api.github.com/repos/libgeos/geos/subscription","commits_url":"https://api.github.com/repos/libgeos/geos/commits{/sha}","git_commits_url":"https://api.github.com/repos/libgeos/geos/git/commits{/sha}","comments_url":"https://api.github.com/repos/libgeos/geos/comments{/number}","issue_comment_url":"https://api.github.com/repos/libgeos/geos/issues/comments{/number}","contents_url":"https://api.github.com/repos/libgeos/geos/contents/{+path}","compare_url":"https://api.github.com/repos/libgeos/geos/compare/{base}...{head}","merges_url":"https://api.github.com/repos/libgeos/geos/merges","archive_url":"https://api.github.com/repos/libgeos/geos/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/libgeos/geos/downloads","issues_url":"https://api.github.com/repos/libgeos/geos/issues{/number}","pulls_url":"https://api.github.com/repos/libgeos/geos/pulls{/number}","milestones_url":"https://api.github.com/repos/libgeos/geos/milestones{/number}","notifications_url":"https://api.github.com/repos/libgeos/geos/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/libgeos/geos/labels{/name}","releases_url":"https://api.github.com/repos/libgeos/geos/releases{/id}","deployments_url":"https://api.github.com/repos/libgeos/geos/deployments","created_at":"2011-10-26T14:36:13Z","updated_at":"2018-10-31T06:13:24Z","pushed_at":"2018-10-31T13:57:26Z","git_url":"git://github.com/libgeos/geos.git","ssh_url":"git@github.com:libgeos/geos.git","clone_url":"https://github.com/libgeos/geos.git","svn_url":"https://github.com/libgeos/geos","homepage":"https://geos.osgeo.org","size":17562,"stargazers_count":208,"watchers_count":208,"language":"C++","has_issues":false,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":104,"mirror_url":null,"archived":false,"open_issues_count":12,"license":{"key":"lgpl-2.1","name":"GNU Lesser General Public License v2.1","spdx_id":"LGPL-2.1","url":"https://api.github.com/licenses/lgpl-2.1","node_id":"MDc6TGljZW5zZTEx"},"forks":104,"open_issues":12,"watchers":208,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/libgeos/geos/pulls/130"},"html":{"href":"https://github.com/libgeos/geos/pull/130"},"issue":{"href":"https://api.github.com/repos/libgeos/geos/issues/130"},"comments":{"href":"https://api.github.com/repos/libgeos/geos/issues/130/comments"},"review_comments":{"href":"https://api.github.com/repos/libgeos/geos/pulls/130/comments"},"review_comment":{"href":"https://api.github.com/repos/libgeos/geos/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/libgeos/geos/pulls/130/commits"},"statuses":{"href":"https://api.github.com/repos/libgeos/geos/statuses/ab87322f49a6ff74cd70999143ca6e66cacd607f"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"mloskot"}}