specifying bindir and datadir with CMAKE

Questions, problems and discussion about compiling FreeOrion.

Moderator: Oberlus

Post Reply
Message
Author
q1w2e3r4
Space Floater
Posts: 22
Joined: Sun Sep 26, 2010 11:05 pm

specifying bindir and datadir with CMAKE

#1 Post by q1w2e3r4 »

Hi,

I have been studying the CMAKE system, and I cannot seem to find where to specify the datadir for cmake. Right now it goes to /usr/default/default. I wish to make it something like /usr/share/freeorion.

Thanks,
q

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

Re: specifying bindir and datadir with CMAKE

#2 Post by Geoff the Medio »

I'm not sure what you mean by specifying the bindir and datadir... Do you mean where are these files placed when building or installing freeorion? Or where the game would look for binaries or the data files when it is run? Or something else?

q1w2e3r4
Space Floater
Posts: 22
Joined: Sun Sep 26, 2010 11:05 pm

Re: specifying bindir and datadir with CMAKE

#3 Post by q1w2e3r4 »

Sorry, I should have been more clear.

After running 'cmake' with '-DCMAKE_INSTALL_PREFIX=/usr', I run make install and it puts the data files into:

/usr/default/default

I wish to change this to:

/usr/share/freeorion (or something similiar).

Thanks,
q

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

Re: specifying bindir and datadir with CMAKE

#4 Post by Geoff the Medio »

That may not be possible, as the CMake system possibly wasn't designed to support it. See this post: viewtopic.php?p=42618#p42618

Apparently it could be modified to do so, though...

q1w2e3r4
Space Floater
Posts: 22
Joined: Sun Sep 26, 2010 11:05 pm

Re: specifying bindir and datadir with CMAKE

#5 Post by q1w2e3r4 »

I will take a look into implementing this feature.

I am curious, how does freeorion know where to grab the data? i.e. Is it hard-coded in a .cpp file somewhere right now?

Thanks,
q

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

Re: specifying bindir and datadir with CMAKE

#6 Post by Geoff the Medio »

q1w2e3r4 wrote:I am curious, how does freeorion know where to grab the data? i.e. Is it hard-coded in a .cpp file somewhere right now?
Sort of. Directories.cpp has the relevant code. It's not exactly hard-coded, but depending on the OS-specific code, has a few places it tries looking. The resources directory (where game content files are gotten) is also defaulted to the root data directory, but this can be changed in the options screen directories tab. Some places still look for a specific file within the root data dire / default directory, though, even if the resource dir is changed.

Post Reply