Skip to content
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

cmake support for windows #4411

Merged
merged 9 commits into from
Dec 2, 2013
Merged

cmake support for windows #4411

merged 9 commits into from
Dec 2, 2013

Conversation

martell
Copy link
Contributor

@martell martell commented Nov 30, 2013

Quickly added cmake support for windows

Tested on Visual Studio 2013

Instructions for Windows

  1. install cmake and include in PATH variable.
  2. go to build folder
  3. run .cmd file corresponding to your visual studio version
    eg. win32-msvc-2013-x86 for visual studio 2013
  4. Open solution in created folder build/win32-msvc-2013-x86/cocos2dx
  5. Set HelloCpp as the active project and try to run it :)
    Have fun

Can I get some feedback please?
I only hacked it together quickly so I want to know does it work for others.

Martell

@dumganhar
Copy link

There is an error on travis-ci, could you check that? https://travis-ci.org/cocos2d/cocos2d-x/jobs/14729723

@martell
Copy link
Contributor Author

martell commented Dec 2, 2013

Which Platform is that for?

EDIT: I realised its linux

I'll fix it soon

@martell
Copy link
Contributor Author

martell commented Dec 2, 2013

@dumganhar fixed ;)

@dumganhar
Copy link

Thank you.

option(BUILD_EXTENSIONS "Build extension library" OFF)
option(BUILD_EDITOR_SPINE "Build editor support for spine" OFF)
option(BUILD_EDITOR_COCOSTUDIO "Build editor support for cocostudio" OFF)
option(BUILD_EDITOR_COCOSBUILDER "Build editor support for cocosbuilder" OFF)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why to set these switch to OFF by default?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be best to get the minimal version working on Win Mac and Linux and then enable them as we go.

I can enable them for Linux by default?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But the top level CMakeLists.txt is designed for building all libraries and projects.
All binaries will be placed in cocos2d_root/bin and all libraries will be placed in cocos2d_root/lib.
Template will uses the libraries in lib folder.
Could the template in cocos2d_root/template/multi-platform-cpp/HelloCpp use the CMakeLists.txt in the top level folder?

Now we only static link the libraries in lib folder. As I know, add_subdirectory can't do this, right?
If it could, I think minimal version you did will make sense.:)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No I wouldn't use that one, I would create one from scratch in template/multi-platform-cpp/HelloCpp
Only variable it would need is COCOS_HOME directory
That then could be used by project_creator.py
that way the project could be put anywhere in the filesystem not just in the projects folder and still compile

I've reverted the Options for Linux :)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds great. :)

@dumganhar
Copy link

@martell
Unfortunately, It still failed. Please check https://travis-ci.org/cocos2d/cocos2d-x/jobs/14792731 .

@dumganhar
Copy link

If you have a Ubuntu VM, you could test on it.

@martell
Copy link
Contributor Author

martell commented Dec 2, 2013

Sorry I don't atm.
Travis is quite handy :)

Just fix HelloCPP and that should do it

@martell
Copy link
Contributor Author

martell commented Dec 2, 2013

@dumganhar It passed Travis Linux build now

dumganhar pushed a commit that referenced this pull request Dec 2, 2013
closed #3328: cmake support for windows
@dumganhar dumganhar merged commit c784bc9 into cocos2d:develop Dec 2, 2013
@dumganhar
Copy link

merged. thx.

@dumganhar
Copy link

@martell
TestCpp also works now by using cmake on windows.
Please refer to #5016 .

angeltown pushed a commit to angeltown/cocos2d-x that referenced this pull request Apr 28, 2014
angeltown pushed a commit to angeltown/cocos2d-x that referenced this pull request Apr 29, 2014
angeltown pushed a commit to angeltown/cocos2d-x that referenced this pull request Apr 30, 2014
angeltown pushed a commit to angeltown/cocos2d-x that referenced this pull request Apr 30, 2014
gelldur pushed a commit to gelldur/cocos2d-x that referenced this pull request Aug 16, 2016
…tive code.

Former-commit-id: 3f62369e1d721ad659e91077e0842b9a7858655a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants