{"action":"created","comment":{"url":"https://api.github.com/repos/OpenTTD/OpenTTD/pulls/comments/275125935","pull_request_review_id":226361988,"id":275125935,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDI3NTEyNTkzNQ==","diff_hunk":"@@ -0,0 +1,237 @@\n+cmake_minimum_required(VERSION 3.5)\n+\n+project(OpenTTD)\n+\n+if (${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_BINARY_DIR})\n+    message(FATAL_ERROR \"In-source builds not allowed. Please run \\\"cmake ..\\\" from the bin directory\")\n+endif (${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_BINARY_DIR})\n+\n+set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} \"${CMAKE_SOURCE_DIR}/cmake\")\n+\n+include(Options REQUIRED)\n+set_options()\n+set_directory_options()\n+\n+# Make sure we have Threads available. We don't use autodetect_library here,\n+# as the CMake 'FindThreads' is a lot more clever, always available, and\n+# gives us a Threads::Threads dependency to link to our application.\n+find_package(Threads REQUIRED)\n+\n+include(AutodetectLibrary REQUIRED)\n+autodetect_library(\"zlib\" ZLIB ZLIB zlib \"\" zlib.h z)","path":"CMakeLists.txt","position":23,"original_position":21,"commit_id":"2440a6ee2ab20747280aec03a22463a4d71a2e0e","original_commit_id":"7de32d3f31c0be4e6cb3d346c8ea4014cc104681","user":{"login":"DerDakon","id":10909049,"node_id":"MDQ6VXNlcjEwOTA5MDQ5","avatar_url":"https://avatars1.githubusercontent.com/u/10909049?v=4","gravatar_id":"","url":"https://api.github.com/users/DerDakon","html_url":"https://github.com/DerDakon","followers_url":"https://api.github.com/users/DerDakon/followers","following_url":"https://api.github.com/users/DerDakon/following{/other_user}","gists_url":"https://api.github.com/users/DerDakon/gists{/gist_id}","starred_url":"https://api.github.com/users/DerDakon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DerDakon/subscriptions","organizations_url":"https://api.github.com/users/DerDakon/orgs","repos_url":"https://api.github.com/users/DerDakon/repos","events_url":"https://api.github.com/users/DerDakon/events{/privacy}","received_events_url":"https://api.github.com/users/DerDakon/received_events","type":"User","site_admin":false},"body":"I would go this route, too. This is easier to follow for everyone used to CMake, and you still can call your custom detect function in your own Find*.cmake if that really makes things easier.","created_at":"2019-04-13T17:31:15Z","updated_at":"2019-04-13T17:31:15Z","html_url":"https://github.com/OpenTTD/OpenTTD/pull/7270#discussion_r275125935","pull_request_url":"https://api.github.com/repos/OpenTTD/OpenTTD/pulls/7270","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/OpenTTD/OpenTTD/pulls/comments/275125935"},"html":{"href":"https://github.com/OpenTTD/OpenTTD/pull/7270#discussion_r275125935"},"pull_request":{"href":"https://api.github.com/repos/OpenTTD/OpenTTD/pulls/7270"}},"in_reply_to_id":273324677},"pull_request":{"url":"https://api.github.com/repos/OpenTTD/OpenTTD/pulls/7270","id":255640610,"node_id":"MDExOlB1bGxSZXF1ZXN0MjU1NjQwNjEw","html_url":"https://github.com/OpenTTD/OpenTTD/pull/7270","diff_url":"https://github.com/OpenTTD/OpenTTD/pull/7270.diff","patch_url":"https://github.com/OpenTTD/OpenTTD/pull/7270.patch","issue_url":"https://api.github.com/repos/OpenTTD/OpenTTD/issues/7270","number":7270,"state":"open","locked":false,"title":"Introduce CMake (and removing all other project-related code)","user":{"login":"TrueBrain","id":1663690,"node_id":"MDQ6VXNlcjE2NjM2OTA=","avatar_url":"https://avatars3.githubusercontent.com/u/1663690?v=4","gravatar_id":"","url":"https://api.github.com/users/TrueBrain","html_url":"https://github.com/TrueBrain","followers_url":"https://api.github.com/users/TrueBrain/followers","following_url":"https://api.github.com/users/TrueBrain/following{/other_user}","gists_url":"https://api.github.com/users/TrueBrain/gists{/gist_id}","starred_url":"https://api.github.com/users/TrueBrain/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TrueBrain/subscriptions","organizations_url":"https://api.github.com/users/TrueBrain/orgs","repos_url":"https://api.github.com/users/TrueBrain/repos","events_url":"https://api.github.com/users/TrueBrain/events{/privacy}","received_events_url":"https://api.github.com/users/TrueBrain/received_events","type":"User","site_admin":false},"body":"Fixes #6884\r\nFixes #7470\r\n\r\n[Stable release build](https://dev.azure.com/truebrain/OpenTTD/_build/results?buildId=293)\r\n[Nightly release build](https://dev.azure.com/truebrain/OpenTTD/_build/results?buildId=294)\r\n\r\nThis removes:\r\n- MSVC project files\r\n- Kdevelop generation files\r\n- configure / Makefile\r\n\r\nIt replaces them all with a single method: cmake. This should also remove any awk/vbs scripts we have around, meaning we will get a single method of doing stuff.\r\n\r\nCurrently tested with these 'IDEs':\r\n\r\n- VS2017 (yes, VS supports CMake)\r\n- VS2019 (yes, VS2019 supports CMake even better)\r\n- CMake, WSL Ubuntu 18.04\r\n\r\nThis is pretty much a Work In Progress, but I wanted to show others how it would look etc, so they can also test already a bit. Any feedback is welcome.\r\n\r\nTo test it out:\r\n\r\n```\r\nmkdir build\r\ncd build\r\ncmake ..\r\nmake\r\n```\r\n\r\nOr open the CMakeLists.txt in VS2017 / VS2019.\r\n\r\nThings still to do:\r\n\r\n- [ ] Debian dependencies\r\n- [ ] rpm support\r\n- [ ] Linux install: menu entries\r\n- [x] check if we are autodetecting everything\r\n- [x] check all TODOs, and make sure they are fixed\r\n- [x] validate this works on all current machines of all people that can compile OpenTTD now\r\n- [x] validate this works on things like CLion, Visual Code Studio, Kdevelop, ..\r\n- [x] rewrite Squirrel generation in CMake (done in a branch)\r\n- [x] add the ability to make stable builds (NO_ASSERT, see MSVC changes for stable releases) via parameters\r\n- [x] autodetect nforenum\r\n- [x] autodetect grfcodec\r\n- [x] add ICC support\r\n- [x] add all the warning flags etc\r\n- [x] add debug options\r\n- [x] rewrite bundling code in CMake\r\n- [x] rewrite baseset generation in CMake\r\n- [x] rewrite regression in CMake\r\n- [x] rewrite source.list in CMake\r\n- [x] autodetect ICU\r\n- [x] ~~autodetect TiMiditity~~ (libtimidity is no longer available on most OSes)\r\n- [x] autodetect xdg-basedir\r\n- [x] autodetect iconv\r\n- [x] autodetect OSX stuff (Cocoa QuickDraw, Quartz, libraries, etc)\r\n- [x] rewrite findversion in CMake (partially done here: https://github.com/LordAro/OpenTTD/commit/1ea407bfa16025fd29edbedc8c50fc27dd93d9eb)\r\nCurrently it is calling `findversion.sh`, which only works on non-Windows. Porting it to CMake makes more sense (one single way of doing stuff).\r\n- [x] ~~add static builds~~ (no static builds for now; we might reconsider later)\r\n- [x] add CMake support for all CI targets\r\n- [x] revisit dependencies for Dedicated Server (does it need SDL, Cocoa, ..)\r\n- [x] fix CI for Linux targets\r\n- [x] fix CI for Windows\r\n- [x] fix CI for OSX\r\n- [x] fix mingw\r\n- [x] fix dedicated doesn't need a video driver\r\n- [x] split CMakeLists.txt inside several files to increase readability\r\n- [x] remove all old project files (including configure, Makefile, projects/, etc)\r\n- [x] restore projects\\os_versions.manifest usage in VS builds\r\n\r\n(I am sure I am missing stuff .. but this is something to work on at least :D)","created_at":"2019-02-23T21:22:56Z","updated_at":"2019-04-13T17:31:15Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a7fdd6325231393e13403d6d2fa2ca611edfda11","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/OpenTTD/OpenTTD/pulls/7270/commits","review_comments_url":"https://api.github.com/repos/OpenTTD/OpenTTD/pulls/7270/comments","review_comment_url":"https://api.github.com/repos/OpenTTD/OpenTTD/pulls/comments{/number}","comments_url":"https://api.github.com/repos/OpenTTD/OpenTTD/issues/7270/comments","statuses_url":"https://api.github.com/repos/OpenTTD/OpenTTD/statuses/2440a6ee2ab20747280aec03a22463a4d71a2e0e","head":{"label":"TrueBrain:cmake","ref":"cmake","sha":"2440a6ee2ab20747280aec03a22463a4d71a2e0e","user":{"login":"TrueBrain","id":1663690,"node_id":"MDQ6VXNlcjE2NjM2OTA=","avatar_url":"https://avatars3.githubusercontent.com/u/1663690?v=4","gravatar_id":"","url":"https://api.github.com/users/TrueBrain","html_url":"https://github.com/TrueBrain","followers_url":"https://api.github.com/users/TrueBrain/followers","following_url":"https://api.github.com/users/TrueBrain/following{/other_user}","gists_url":"https://api.github.com/users/TrueBrain/gists{/gist_id}","starred_url":"https://api.github.com/users/TrueBrain/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TrueBrain/subscriptions","organizations_url":"https://api.github.com/users/TrueBrain/orgs","repos_url":"https://api.github.com/users/TrueBrain/repos","events_url":"https://api.github.com/users/TrueBrain/events{/privacy}","received_events_url":"https://api.github.com/users/TrueBrain/received_events","type":"User","site_admin":false},"repo":{"id":128560288,"node_id":"MDEwOlJlcG9zaXRvcnkxMjg1NjAyODg=","name":"OpenTTD","full_name":"TrueBrain/OpenTTD","private":false,"owner":{"login":"TrueBrain","id":1663690,"node_id":"MDQ6VXNlcjE2NjM2OTA=","avatar_url":"https://avatars3.githubusercontent.com/u/1663690?v=4","gravatar_id":"","url":"https://api.github.com/users/TrueBrain","html_url":"https://github.com/TrueBrain","followers_url":"https://api.github.com/users/TrueBrain/followers","following_url":"https://api.github.com/users/TrueBrain/following{/other_user}","gists_url":"https://api.github.com/users/TrueBrain/gists{/gist_id}","starred_url":"https://api.github.com/users/TrueBrain/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TrueBrain/subscriptions","organizations_url":"https://api.github.com/users/TrueBrain/orgs","repos_url":"https://api.github.com/users/TrueBrain/repos","events_url":"https://api.github.com/users/TrueBrain/events{/privacy}","received_events_url":"https://api.github.com/users/TrueBrain/received_events","type":"User","site_admin":false},"html_url":"https://github.com/TrueBrain/OpenTTD","description":"OpenTTD is an open source simulation game based upon Transport Tycoon Deluxe","fork":true,"url":"https://api.github.com/repos/TrueBrain/OpenTTD","forks_url":"https://api.github.com/repos/TrueBrain/OpenTTD/forks","keys_url":"https://api.github.com/repos/TrueBrain/OpenTTD/keys{/key_id}","collaborators_url":"https://api.github.com/repos/TrueBrain/OpenTTD/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/TrueBrain/OpenTTD/teams","hooks_url":"https://api.github.com/repos/TrueBrain/OpenTTD/hooks","issue_events_url":"https://api.github.com/repos/TrueBrain/OpenTTD/issues/events{/number}","events_url":"https://api.github.com/repos/TrueBrain/OpenTTD/events","assignees_url":"https://api.github.com/repos/TrueBrain/OpenTTD/assignees{/user}","branches_url":"https://api.github.com/repos/TrueBrain/OpenTTD/branches{/branch}","tags_url":"https://api.github.com/repos/TrueBrain/OpenTTD/tags","blobs_url":"https://api.github.com/repos/TrueBrain/OpenTTD/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/TrueBrain/OpenTTD/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/TrueBrain/OpenTTD/git/refs{/sha}","trees_url":"https://api.github.com/repos/TrueBrain/OpenTTD/git/trees{/sha}","statuses_url":"https://api.github.com/repos/TrueBrain/OpenTTD/statuses/{sha}","languages_url":"https://api.github.com/repos/TrueBrain/OpenTTD/languages","stargazers_url":"https://api.github.com/repos/TrueBrain/OpenTTD/stargazers","contributors_url":"https://api.github.com/repos/TrueBrain/OpenTTD/contributors","subscribers_url":"https://api.github.com/repos/TrueBrain/OpenTTD/subscribers","subscription_url":"https://api.github.com/repos/TrueBrain/OpenTTD/subscription","commits_url":"https://api.github.com/repos/TrueBrain/OpenTTD/commits{/sha}","git_commits_url":"https://api.github.com/repos/TrueBrain/OpenTTD/git/commits{/sha}","comments_url":"https://api.github.com/repos/TrueBrain/OpenTTD/comments{/number}","issue_comment_url":"https://api.github.com/repos/TrueBrain/OpenTTD/issues/comments{/number}","contents_url":"https://api.github.com/repos/TrueBrain/OpenTTD/contents/{+path}","compare_url":"https://api.github.com/repos/TrueBrain/OpenTTD/compare/{base}...{head}","merges_url":"https://api.github.com/repos/TrueBrain/OpenTTD/merges","archive_url":"https://api.github.com/repos/TrueBrain/OpenTTD/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/TrueBrain/OpenTTD/downloads","issues_url":"https://api.github.com/repos/TrueBrain/OpenTTD/issues{/number}","pulls_url":"https://api.github.com/repos/TrueBrain/OpenTTD/pulls{/number}","milestones_url":"https://api.github.com/repos/TrueBrain/OpenTTD/milestones{/number}","notifications_url":"https://api.github.com/repos/TrueBrain/OpenTTD/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/TrueBrain/OpenTTD/labels{/name}","releases_url":"https://api.github.com/repos/TrueBrain/OpenTTD/releases{/id}","deployments_url":"https://api.github.com/repos/TrueBrain/OpenTTD/deployments","created_at":"2018-04-07T19:16:44Z","updated_at":"2019-01-13T11:34:35Z","pushed_at":"2019-04-13T13:35:24Z","git_url":"git://github.com/TrueBrain/OpenTTD.git","ssh_url":"git@github.com:TrueBrain/OpenTTD.git","clone_url":"https://github.com/TrueBrain/OpenTTD.git","svn_url":"https://github.com/TrueBrain/OpenTTD","homepage":"https://www.openttd.org/","size":130532,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":0,"license":{"key":"gpl-2.0","name":"GNU General Public License v2.0","spdx_id":"GPL-2.0","url":"https://api.github.com/licenses/gpl-2.0","node_id":"MDc6TGljZW5zZTg="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"OpenTTD:master","ref":"master","sha":"3bbd7ea2c1a7f3631362805da76848112f7a606d","user":{"login":"OpenTTD","id":5037546,"node_id":"MDEyOk9yZ2FuaXphdGlvbjUwMzc1NDY=","avatar_url":"https://avatars0.githubusercontent.com/u/5037546?v=4","gravatar_id":"","url":"https://api.github.com/users/OpenTTD","html_url":"https://github.com/OpenTTD","followers_url":"https://api.github.com/users/OpenTTD/followers","following_url":"https://api.github.com/users/OpenTTD/following{/other_user}","gists_url":"https://api.github.com/users/OpenTTD/gists{/gist_id}","starred_url":"https://api.github.com/users/OpenTTD/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/OpenTTD/subscriptions","organizations_url":"https://api.github.com/users/OpenTTD/orgs","repos_url":"https://api.github.com/users/OpenTTD/repos","events_url":"https://api.github.com/users/OpenTTD/events{/privacy}","received_events_url":"https://api.github.com/users/OpenTTD/received_events","type":"Organization","site_admin":false},"repo":{"id":128430621,"node_id":"MDEwOlJlcG9zaXRvcnkxMjg0MzA2MjE=","name":"OpenTTD","full_name":"OpenTTD/OpenTTD","private":false,"owner":{"login":"OpenTTD","id":5037546,"node_id":"MDEyOk9yZ2FuaXphdGlvbjUwMzc1NDY=","avatar_url":"https://avatars0.githubusercontent.com/u/5037546?v=4","gravatar_id":"","url":"https://api.github.com/users/OpenTTD","html_url":"https://github.com/OpenTTD","followers_url":"https://api.github.com/users/OpenTTD/followers","following_url":"https://api.github.com/users/OpenTTD/following{/other_user}","gists_url":"https://api.github.com/users/OpenTTD/gists{/gist_id}","starred_url":"https://api.github.com/users/OpenTTD/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/OpenTTD/subscriptions","organizations_url":"https://api.github.com/users/OpenTTD/orgs","repos_url":"https://api.github.com/users/OpenTTD/repos","events_url":"https://api.github.com/users/OpenTTD/events{/privacy}","received_events_url":"https://api.github.com/users/OpenTTD/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/OpenTTD/OpenTTD","description":"OpenTTD is an open source simulation game based upon Transport Tycoon Deluxe","fork":false,"url":"https://api.github.com/repos/OpenTTD/OpenTTD","forks_url":"https://api.github.com/repos/OpenTTD/OpenTTD/forks","keys_url":"https://api.github.com/repos/OpenTTD/OpenTTD/keys{/key_id}","collaborators_url":"https://api.github.com/repos/OpenTTD/OpenTTD/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/OpenTTD/OpenTTD/teams","hooks_url":"https://api.github.com/repos/OpenTTD/OpenTTD/hooks","issue_events_url":"https://api.github.com/repos/OpenTTD/OpenTTD/issues/events{/number}","events_url":"https://api.github.com/repos/OpenTTD/OpenTTD/events","assignees_url":"https://api.github.com/repos/OpenTTD/OpenTTD/assignees{/user}","branches_url":"https://api.github.com/repos/OpenTTD/OpenTTD/branches{/branch}","tags_url":"https://api.github.com/repos/OpenTTD/OpenTTD/tags","blobs_url":"https://api.github.com/repos/OpenTTD/OpenTTD/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/OpenTTD/OpenTTD/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/OpenTTD/OpenTTD/git/refs{/sha}","trees_url":"https://api.github.com/repos/OpenTTD/OpenTTD/git/trees{/sha}","statuses_url":"https://api.github.com/repos/OpenTTD/OpenTTD/statuses/{sha}","languages_url":"https://api.github.com/repos/OpenTTD/OpenTTD/languages","stargazers_url":"https://api.github.com/repos/OpenTTD/OpenTTD/stargazers","contributors_url":"https://api.github.com/repos/OpenTTD/OpenTTD/contributors","subscribers_url":"https://api.github.com/repos/OpenTTD/OpenTTD/subscribers","subscription_url":"https://api.github.com/repos/OpenTTD/OpenTTD/subscription","commits_url":"https://api.github.com/repos/OpenTTD/OpenTTD/commits{/sha}","git_commits_url":"https://api.github.com/repos/OpenTTD/OpenTTD/git/commits{/sha}","comments_url":"https://api.github.com/repos/OpenTTD/OpenTTD/comments{/number}","issue_comment_url":"https://api.github.com/repos/OpenTTD/OpenTTD/issues/comments{/number}","contents_url":"https://api.github.com/repos/OpenTTD/OpenTTD/contents/{+path}","compare_url":"https://api.github.com/repos/OpenTTD/OpenTTD/compare/{base}...{head}","merges_url":"https://api.github.com/repos/OpenTTD/OpenTTD/merges","archive_url":"https://api.github.com/repos/OpenTTD/OpenTTD/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/OpenTTD/OpenTTD/downloads","issues_url":"https://api.github.com/repos/OpenTTD/OpenTTD/issues{/number}","pulls_url":"https://api.github.com/repos/OpenTTD/OpenTTD/pulls{/number}","milestones_url":"https://api.github.com/repos/OpenTTD/OpenTTD/milestones{/number}","notifications_url":"https://api.github.com/repos/OpenTTD/OpenTTD/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/OpenTTD/OpenTTD/labels{/name}","releases_url":"https://api.github.com/repos/OpenTTD/OpenTTD/releases{/id}","deployments_url":"https://api.github.com/repos/OpenTTD/OpenTTD/deployments","created_at":"2018-04-06T18:06:22Z","updated_at":"2019-04-13T16:52:40Z","pushed_at":"2019-04-13T13:35:26Z","git_url":"git://github.com/OpenTTD/OpenTTD.git","ssh_url":"git@github.com:OpenTTD/OpenTTD.git","clone_url":"https://github.com/OpenTTD/OpenTTD.git","svn_url":"https://github.com/OpenTTD/OpenTTD","homepage":"https://www.openttd.org/","size":130239,"stargazers_count":1538,"watchers_count":1538,"language":"C++","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":189,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":96,"license":{"key":"gpl-2.0","name":"GNU General Public License v2.0","spdx_id":"GPL-2.0","url":"https://api.github.com/licenses/gpl-2.0","node_id":"MDc6TGljZW5zZTg="},"forks":189,"open_issues":96,"watchers":1538,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/OpenTTD/OpenTTD/pulls/7270"},"html":{"href":"https://github.com/OpenTTD/OpenTTD/pull/7270"},"issue":{"href":"https://api.github.com/repos/OpenTTD/OpenTTD/issues/7270"},"comments":{"href":"https://api.github.com/repos/OpenTTD/OpenTTD/issues/7270/comments"},"review_comments":{"href":"https://api.github.com/repos/OpenTTD/OpenTTD/pulls/7270/comments"},"review_comment":{"href":"https://api.github.com/repos/OpenTTD/OpenTTD/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/OpenTTD/OpenTTD/pulls/7270/commits"},"statuses":{"href":"https://api.github.com/repos/OpenTTD/OpenTTD/statuses/2440a6ee2ab20747280aec03a22463a4d71a2e0e"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"DerDakon"}}