Closed mrgreywater closed 8 years ago
ref #21
We'll want to switch over to cmake entirely if we go this route, not maintain two build systems in parallel.
cc @kkaefer
said follow-up PR with glfw as submodule can be found here: https://github.com/mrgreywater/earcut.hpp/commit/d658b8bfc400d37da95eedcbc9962627f0a03aad
usage would be:
git submodule init
git submodule update
mkdir build
cd ./build
cmake ..
make -j4
and it would remove the requirement to install glfw manually.
edit: added it to this PR instead.
Great! @mrgreywater yeah, let's remove the old build system fully in favor of CMake.
@mrgreywater BTW, just added you as the repo collaborator. Thank you for all the awesome contributions! Now you can make branches in the upstream repo (and manage issues), but be sure to still submit PRs for any significant changes.
@mourner wow, thanks. However I would prefer if someone else could merge this PR and do the appropriate changes to travis. I am also not quite sure which files can be removed related to gyp. I guess it's the makefile, the .mason submodule, the dep folder, configure, and all the .gypi and .gyp files.
Just a heads up that using CMake 3 on Travis requires adding these sources/packages:
addons:
apt:
sources: [ 'george-edison55-precise-backports' ]
packages: [ 'cmake', 'cmake-data' ]
As part of this PR, we should also completely remove the existing build system, as we won't be maintaining two systems side-by-side.
@kkaefer want to take a stab at this? See https://github.com/mapbox/earcut.hpp/pull/34#issuecomment-184891113
@kkaefer I gave you access to https://github.com/mrgreywater/earcut.hpp/tree/cmake in case you want to push commits to this PR yourself. Or else I may try to remove gyp and make the changes to travis later myself, even though I cannot tell how difficult it will get, as I haven't configured any gyp/travis systems yet.
@kkaefer @jfirebaugh @mourner looks like it works now. Would be nice if one of you could check if I haven't missed anything/ deleted too much related to gyp.
Oh wow! Isn't this just lovely?
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.
To build with Visual Studio (assuming cmake (download) and glfw3 (download) are properly installed, navigate to the project root directory and execute these commands:
and open the generated sln project file with Visual Studio (equivalent steps for VS2013)
To build it for linux, make sure to have cmake 3.2 (ubuntu-repository) and glfw3 (how-to) installed, navigate to the project root directory in your terminal and type:
Other targets were not tested, but should work aswell.
If 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.
Additionally, 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), 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.