-
Notifications
You must be signed in to change notification settings - Fork 125
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add cmake support #34
Conversation
ref #21 |
82baf35
to
6d22314
Compare
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: mrgreywater@d658b8b 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. |
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' ] |
# optional: -march=native (builds with the optimizations available on the build machine (only for local use!)) | ||
endif() | ||
else() | ||
message(WARNING "Building earcut with unknown compiler.") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This message is triggered when compiling with Clang. It means that Clang won't receive any compiler flags.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
edit: I just noticed I still need to enable optimization for the C-Compiler (not just C++).
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. |
d658b8b
to
50c4c2e
Compare
@kkaefer want to take a stab at this? See #34 (comment) |
@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. |
11eae1e
to
12c5663
Compare
959db06
to
71f9938
Compare
@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. |
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:
mkdir build cd ./build cmake .. make -j4
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.