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 and CLion #12803

Closed
i2amroy opened this issue Jun 28, 2015 · 35 comments
Closed

CMake and CLion #12803

i2amroy opened this issue Jun 28, 2015 · 35 comments
Labels
Code: Build Issues regarding different builds and build environments <Enhancement / Feature> New features, or enhancements on existing OS: Windows Issues related to Windows operating system

Comments

@i2amroy
Copy link
Contributor

i2amroy commented Jun 28, 2015

To put it simply, our CMake file isn't quite up to snuff for the level that CLion requires, and as such errors out whenever you try to run a build. Since I dearly love the IDE (and I know a few others that do as well) I'd greatly appreciate it if someone who was a bit more knowledgeable about CMake would take a shot at getting them to play nicely together. Sadly I know exactly nothing about CMake, and as such all the error messages in the world aren't going to let me solve the current problems. :/

Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

@i2amroy i2amroy added the <Enhancement / Feature> New features, or enhancements on existing label Jun 28, 2015
@DavidKeaton
Copy link
Contributor

This, this, and this. The CMake file we have is nice, but needs better CLion integration.

@forkingpath
Copy link
Contributor

I'm working on this as part of my fork, since I'm a diehard JetBrains fan. (Hi JetBrains! I assume you search Github for mentions, social media guy!)

@macrosblackd
Copy link
Contributor

Woo! Thanks for tackling this. I've been bogged down at work again and
haven't had time to do much extra.

On 7/9/15, Karl Parakenings notifications@github.com wrote:

I'm working on this as part of my fork, since I'm a diehard JetBrains fan.
(Hi JetBrains! I assume you search Github for mentions, social media guy!)


Reply to this email directly or view it on GitHub:
#12803 (comment)

@forkingpath
Copy link
Contributor

I would caution not to hold your breath - the current toolchain as represented in the repository is, as my man Roast Beef would say, mucho fuxxed. It'll take a while to unsnarl without affecting Linux/Mac devs.

@DavidKeaton
Copy link
Contributor

Hey man, if you can get cmake running for clion, I'm behind you. I've been wanting to mess with the ide for a while now, but to no avail.

@forkingpath
Copy link
Contributor

In the meantime, you can disable the auto-CMake in the settings and build it in command line - it still makes a very good code editor if you give it a little help with directory structure marking.

@DavidKeaton
Copy link
Contributor

True.

@forkingpath
Copy link
Contributor

Good news - I think I have this working. I'll break it down to minimum steps and do a PR with documentation updates.

@forkingpath
Copy link
Contributor

Sigh... scratch that. It builds successfully but it takes 20 minutes to link & then crashes. Two steps forward, one step back.

@i2amroy
Copy link
Contributor Author

i2amroy commented Jul 11, 2015

Well know that we're cheering for you. : )

@forkingpath
Copy link
Contributor

Actually, does anyone with more recent C/CPP experience have any clue why it would fail to start after compiling & linking successfully? copying the DLLs to the build directory doesn't seem to help. @kevingranade ?

And the support is very much appreciated :)

@forkingpath
Copy link
Contributor

Oh, wait, I think I might have figured it out in the shower... it's probably grabbing different versions of the libraries from elsewhere in the windows PATH, since it's not using the MSYS setup.

God damn I wish Windows didn't need this many hacks & overlays on top of its OS to make it compatible with the rest of the world.

@forkingpath
Copy link
Contributor

I am despairing about getting this working. I feel despair.

@i2amroy
Copy link
Contributor Author

i2amroy commented Jul 12, 2015

Don't be afraid to take a break if you need it. Several studies have shown that the vast majority of epiphanetic breakthroughs happen after you've set something down for a while and then come back to it, and it'll always keep till later. It's the fact that you are working on it at all that's important, not necessarily how fast it get's finished. :)

@DavidKeaton
Copy link
Contributor

I can second this! :-P

@forkingpath
Copy link
Contributor

<karlnp> WHAT
<karlnp> HOLYS HIT
<karlnp> IT MIGHT BE WORKING
<@Narc0tiq> Always nice when you finally solve a hard problem.
<karlnp> or, well, no it doesn't
<karlnp> but
<karlnp> it makes a config directory now
<karlnp> ahahaha it does work!! 
* karlnp laughs insanely

working on the docs now.

@forkingpath
Copy link
Contributor

If you want to get a head start, this is what made it work, I think (still waiting for verification builds)

<i2amroy> Good to hear , that :)
<i2amroy> looking forward to being able to use CLion properly
<karlnp> as far as i can tell, it's actually pretty simple
<karlnp> use the guide to compile with Cmake/msys2, make sure that works
<karlnp> and then copy it into the cmake settings, using the binaries installed with msys32/64 instead of the builtins, and replacing "MSYS Makefiles" with MingW Makefiles
<karlnp> and enable CMAKE_GNUTOMS in the cache and click the save button
<karlnp> i'm still waiting for this build to finish but i think that's all you need to do

@DavidKeaton
Copy link
Contributor

Good God how convoluted.

@forkingpath
Copy link
Contributor

tell me about it

@kevingranade or someone else who would know - where should I put IDE-specific information? COMPILING and COMPILERS.txt don't seem to be a good fit. DEVELOPER_FAQ?

@DavidKeaton
Copy link
Contributor

why not IDE_SUPPORT.txt (even though I prefer lowercase, but it's cool brah)

@forkingpath
Copy link
Contributor

that's an excellent idea.

@DavidKeaton
Copy link
Contributor

I try.

@macrosblackd
Copy link
Contributor

So, where do the binaries get output from this build?

On Sun, Jul 12, 2015 at 8:42 PM, Davek notifications@github.com wrote:

I try.


Reply to this email directly or view it on GitHub
#12803 (comment)
.

@forkingpath
Copy link
Contributor

To the root directory (wherever you cloned the repository), in a new directory named after the build type. So, CataclysmDDA/Debug, CataclysmDDA/RelWithDebugInfo, etc. You can change it in the Cmake settings, but I figure it'll be good for anyone likely to need an IDE to be able to compile multiple versions in the same working copy directory.

You will need to copy the exe into the root dir so that the game knows where to find the data subdirectories, but that's the only proviso.

@DavidKeaton
Copy link
Contributor

One could auto copy it from cmake, perhaps?

@forkingpath
Copy link
Contributor

One could, but like the COMPILING_CMAKE file says, it depends on your build environment anyway... but it'll be necessary for running them from the IDE. hm.

I'll check and see if I can add a conditional flag to only do it on Windows. I think that's part of one of the numerous FIXMEs in the CMakeLists.txt, so I'll probably raise a separate issue once this one is closed.

@DavidKeaton
Copy link
Contributor

actually, isn't there an override flag for letting the game know where to find the data files?

Shouldv'e known it was PREFIX, tgfu.

@drbig drbig added Code: Build Issues regarding different builds and build environments OS: Windows Issues related to Windows operating system labels Jul 13, 2015
@i2amroy
Copy link
Contributor Author

i2amroy commented Aug 14, 2015

In a further note, with just a tiny change to compatability.h I was nearly able to get the game to compile through clion using the Cygwin libraries rather than the MSYS2 ones, but I ran into the "game.o has too many sections" issue for some odd reason. Anyone have any ideas for a fix other than actually reducing the size of game.cpp?

@kevingranade
Copy link
Member

kevingranade commented Aug 14, 2015 via email

@macrosblackd
Copy link
Contributor

I've actually got a branch on my fork where I've started doing that. I
was trying to move all the UI/Menu related functionality out of
game.cpp

On 8/14/15, Kevin Granade notifications@github.com wrote:

AFAIK it's a hard limit, but reducing game.cpp size isn't a bad thing in
the first place. For a fast change to do it, you don't have to remove
things from the game class, just bud off a new cpp file with some of the
functions.


Reply to this email directly or view it on GitHub:
#12803 (comment)

@kevingranade
Copy link
Member

kevingranade commented Aug 14, 2015 via email

@macrosblackd
Copy link
Contributor

That's was my intention with regards to the refactoring. Some of the
trouble I've run into is around decoupling the game logic from the UI
logic though. Ideally I would love to see UI elements represented as a
whole control, with necessary data passed to the element. Currently we
have a lot of game logic tangled up inside the UI logic.

On 8/14/15, Kevin Granade notifications@github.com wrote:

Drawing and menus are great candidates, looking forward to it.
One request if you're refactoring rather than moving things around (though
both are valuable in this case). When you extract a method, it's better to
have game pass in whatever data the method needs rather than relying on the
method accessing it through g. We've done this the wrong way for a long
time, and it's going to take a while to reverse the trend, but it's very
much worth doing.


Reply to this email directly or view it on GitHub:
#12803 (comment)

@forkingpath
Copy link
Contributor

I was in Europe for a while and I was catching up at work - now that the fallout from that has been cleaned up, I should be able to get back to this and help with the refactoring.

@macrosblackd
Copy link
Contributor

Yay! I was wondering where you wandered off too. =)

On 8/14/15, Karl Parakenings notifications@github.com wrote:

I was in Europe for a while and I was catching up at work - now that the
fallout from that has been cleaned up, I should be able to get back to this
and help with the refactoring.


Reply to this email directly or view it on GitHub:
#12803 (comment)

@illi-kun
Copy link
Contributor

This issue was closed as it appears inactive.

Reducing open issues to those which are (or will) be actively worked upon helps us focus our efforts. This issue has not been deleted - it still appears in searches and if it contains relevant information you are encouraged to continue to link to it.

If this issue was a bug

It should be reopened if it can be reproduced in the current build. You can obtain the most recent copy here. Please check there is not a more recent report of this bug before doing so. If no more recent report exists you should continue the discussion in this issue.

If this was a feature request

If the consensus was that the idea was good you could consider submitting an implementation via a PR. If you want to comment further please do so here as opposed to opening a new issue. Before posting check nobody has already made the same point and consider whether your comments are likely to lead to an implementation. If you have doubts about either consider instead voting for the issue

If you want to work on this issue

Then either assign it to yourself or if you are unable to do so claim it via adding a comment. Please don't assign others or make a general request for action.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Code: Build Issues regarding different builds and build environments <Enhancement / Feature> New features, or enhancements on existing OS: Windows Issues related to Windows operating system
Projects
None yet
Development

No branches or pull requests

7 participants