Reworking CMakeList.txt

Questions, problems and discussion about compiling FreeOrion.

Moderators: Oberlus, Oberlus

Post Reply
Message
Author
Daniel Santos
Space Floater
Posts: 28
Joined: Sun Nov 15, 2009 8:15 am

Reworking CMakeList.txt

#1 Post by Daniel Santos » Sat Oct 22, 2011 1:41 am

Hey guys, I'm re-working CMakeList.txt so that the install behaves in a canonical manner on *nix and I want to make sure that I don't break Mac (which I don't have to test on). So I have a few questions for somebody who knows FreeOrion on Mac:
  • What directories and with what structure does it install on Mac? Does it follow the Mac-ish /Applications directory stuff or does it install in /usr/bin like *nix does?
  • Does it create whatever it needs so that it shows up from the GUI? (what I mean here is, do you have to manually launch it from a shell or browse for the file, or does the install create the desktop/menu stuff for you).
Thanks

User avatar
Geoff the Medio
Programming, Design, Admin
Posts: 12474
Joined: Wed Oct 08, 2003 1:33 am
Location: Munich

Re: Reworking CMakeList.txt

#2 Post by Geoff the Medio » Sat Oct 22, 2011 2:29 am

There may not actually be anyone using CMake on OSX, and it may never have worked on OSX, so my concern about breaking it might have been unnecessary. The main thing is that the Windows version still work, as tzlaine seems to prefer that that be the case.

Daniel Santos
Space Floater
Posts: 28
Joined: Sun Nov 15, 2009 8:15 am

Re: Reworking CMakeList.txt

#3 Post by Daniel Santos » Sat Oct 22, 2011 8:01 am

Well, one of the first problems I see is that all of the standard cmake flags that are "Unused by GG" aren't getting cleared out (GG/cmake/Config.cmake). The reason appears to be that once the project is created (in the case of GG, the snippet "project(GiGi)"), all of these variables are set and appear to become immutable (until altered by the cmake caller). This causes a lot of confusion and cluster ****ing because you have these compiler flags in the CMAKE category that do nothing and then you have the real ones under the "Ungrouped Entries" category (this is in cmake-gui).

Also of note, it was my last understanding that -O3 on amd64 with gcc is not considered entirely "safe". Then again, this was some time back, so if you know all is good using -O3 (and that it really makes the code faster) than let's use it by all means. Another claim I've often heard is that it can bloat the code size and actually slow it down by reducing cache hits. I don't know how much of this applies today and to GG & FreeOrion. But seeing function calls when I know they are unnecessary almost always makes me cry (I'm thinking of some Wine code right now).

Daniel Santos
Space Floater
Posts: 28
Joined: Sun Nov 15, 2009 8:15 am

Re: Reworking CMakeList.txt

#4 Post by Daniel Santos » Sat Oct 22, 2011 10:17 am

here's the patches to CMakeList.txt for freeorion and GG, but don't commit them yet, there needs to be corresponding changes in freeorion to pick up the data & config files. Also, probably good to have the INSTALL_DATA_DIR stuck in config.h perhaps to tell freeorion where the data is installed. Let me know what you think.

[The extension patch has been deactivated and can no longer be displayed.]

[The extension patch has been deactivated and can no longer be displayed.]


User avatar
Geoff the Medio
Programming, Design, Admin
Posts: 12474
Joined: Wed Oct 08, 2003 1:33 am
Location: Munich

Re: Reworking CMakeList.txt

#5 Post by Geoff the Medio » Sat Nov 05, 2011 8:54 am

Do this patch obsolete the previous one here:
viewtopic.php?p=49897#p49897

And does it cover all / some of the issues in this thread?
viewtopic.php?p=49907#p49907

Daniel Santos
Space Floater
Posts: 28
Joined: Sun Nov 15, 2009 8:15 am

Re: Reworking CMakeList.txt

#6 Post by Daniel Santos » Sun Nov 06, 2011 3:02 am

Well, yes to both questions, but I hadn't gotten back around to modifications to the search path so that finds the files in their new locations. I'll try to get to this next week or tomorrow.

Post Reply