{"action":"created","issue":{"url":"https://api.github.com/repos/mapbox/earcut.hpp/issues/34","repository_url":"https://api.github.com/repos/mapbox/earcut.hpp","labels_url":"https://api.github.com/repos/mapbox/earcut.hpp/issues/34/labels{/name}","comments_url":"https://api.github.com/repos/mapbox/earcut.hpp/issues/34/comments","events_url":"https://api.github.com/repos/mapbox/earcut.hpp/issues/34/events","html_url":"https://github.com/mapbox/earcut.hpp/pull/34","id":134044430,"number":34,"title":"add cmake support","user":{"login":"mrgreywater","id":2902403,"avatar_url":"https://avatars.githubusercontent.com/u/2902403?v=3","gravatar_id":"","url":"https://api.github.com/users/mrgreywater","html_url":"https://github.com/mrgreywater","followers_url":"https://api.github.com/users/mrgreywater/followers","following_url":"https://api.github.com/users/mrgreywater/following{/other_user}","gists_url":"https://api.github.com/users/mrgreywater/gists{/gist_id}","starred_url":"https://api.github.com/users/mrgreywater/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mrgreywater/subscriptions","organizations_url":"https://api.github.com/users/mrgreywater/orgs","repos_url":"https://api.github.com/users/mrgreywater/repos","events_url":"https://api.github.com/users/mrgreywater/events{/privacy}","received_events_url":"https://api.github.com/users/mrgreywater/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":10,"created_at":"2016-02-16T17:29:53Z","updated_at":"2016-02-17T13:11:05Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/mapbox/earcut.hpp/pulls/34","html_url":"https://github.com/mapbox/earcut.hpp/pull/34","diff_url":"https://github.com/mapbox/earcut.hpp/pull/34.diff","patch_url":"https://github.com/mapbox/earcut.hpp/pull/34.patch"},"body":"This adds the CMakeLists.txt that I used to compile this project with CLion on Linux and generate the project files for Visual Studio 2013 and 2015 on Windows.\r\n\r\nTo build with Visual Studio (assuming cmake ([download](https://cmake.org/download/)) and glfw3 ([download](http://www.glfw.org/download.html)) are properly installed, navigate to the project root directory and execute these commands:\r\n```batch\r\nmkdir vs2015\r\ncd ./vs2015\r\n::in the following commands, change path-to-glfw to your glfw install dir\r\nset GLFW_INCLUDE_DIRS=path-to-glfw\\include \r\nset GLFW_LIBRARIES=path-to-glfw\\lib-vc2015\\glfw3.lib\r\ncmake .. -G \"Visual Studio 14 2015\"\r\n```\r\nand open the generated sln project file with Visual Studio (equivalent steps for VS2013)\r\n\r\nTo build it for linux, make sure to have cmake 3.2 ([ubuntu-repository](https://launchpad.net/~george-edison55/+archive/ubuntu/cmake-3.x)) and glfw3 ([how-to](https://github.com/shurcooL/reusable-commands/blob/ed33ae496f36aaea735a1d183f77e833c92a9f3d/go-gl_glfw3_install.sh#L19-L32)) installed, navigate to the project root directory in your terminal and type:\r\n```bash\r\nmkdir build\r\ncd ./build\r\ncmake .. \r\nmake -j4\r\n```\r\nOther targets were not tested, but should work aswell.\r\n\r\nIf this PR is merged, I would suggest to add cmake to Travis aswell, since otherwise it may happen quickly that someone edits the gyp or cmake configuration alone without checking the other configuration.\r\n\r\nAdditionally, in a follow-up PR, we could add a github submodule link to https://github.com/glfw/glfw, and compile against the local glfw source (e.g [like this project](https://github.com/progschj/OpenGL-Examples)), which would make it alot easier to get the project working initally. That way the manual compilation of glfw3 on linux, or setting up environment variables on windows  would not be required."},"comment":{"url":"https://api.github.com/repos/mapbox/earcut.hpp/issues/comments/185196350","html_url":"https://github.com/mapbox/earcut.hpp/pull/34#issuecomment-185196350","issue_url":"https://api.github.com/repos/mapbox/earcut.hpp/issues/34","id":185196350,"user":{"login":"mrgreywater","id":2902403,"avatar_url":"https://avatars.githubusercontent.com/u/2902403?v=3","gravatar_id":"","url":"https://api.github.com/users/mrgreywater","html_url":"https://github.com/mrgreywater","followers_url":"https://api.github.com/users/mrgreywater/followers","following_url":"https://api.github.com/users/mrgreywater/following{/other_user}","gists_url":"https://api.github.com/users/mrgreywater/gists{/gist_id}","starred_url":"https://api.github.com/users/mrgreywater/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mrgreywater/subscriptions","organizations_url":"https://api.github.com/users/mrgreywater/orgs","repos_url":"https://api.github.com/users/mrgreywater/repos","events_url":"https://api.github.com/users/mrgreywater/events{/privacy}","received_events_url":"https://api.github.com/users/mrgreywater/received_events","type":"User","site_admin":false},"created_at":"2016-02-17T13:11:05Z","updated_at":"2016-02-17T13:11:05Z","body":"@kkaefer I gave you access to https://github.com/mrgreywater/earcut.hpp/tree/cmake in case you want to make changes to this PR yourself. Otherwise I may give try to remove gyp and make the changes to Travis myself later, even though I cannot tell how difficult it will get as I don't really know how travis/gyp works."}}