News:

MegaGlests' game mods menu let's you install many new mods. Even more are available on the MegaGlest Wiki and the Mods forum.

Main Menu

[(p) fixed] r3026: cmake issues with custom install path

Started by Andrew Clark, 25 December 2011, 07:52:01

Andrew Clark

Hello again!
If i'm cmaking svn 3026 version with this variable "-D CUSTOM_DATA_INSTALL_PATH="%_datadir/games/megaglest/", i've
got an error

/usr/src/RPM/BUILD/megaglest-source-3.6.0.2/source/shared_lib/sources/util/properties.cpp: In static member function 'static std::map<std::basic_string<char>, std::basic_string<char> > Shared::Util::Properties::getTagReplacementValues(std::map<std::basic_string<char>, std::basic_string<char> >*)':
/usr/src/RPM/BUILD/megaglest-source-3.6.0.2/source/shared_lib/sources/util/properties.cpp:218:52: error: expected primary-expression before '/' token
/usr/src/RPM/BUILD/megaglest-source-3.6.0.2/source/shared_lib/sources/util/properties.cpp:218:52: error: 'usr' was not declared in this scope
/usr/src/RPM/BUILD/megaglest-source-3.6.0.2/source/shared_lib/sources/util/properties.cpp:218:52: error: 'share' was not declared in this scope
/usr/src/RPM/BUILD/megaglest-source-3.6.0.2/source/shared_lib/sources/util/properties.cpp:218:52: error: 'games' was not declared in this scope
/usr/src/RPM/BUILD/megaglest-source-3.6.0.2/source/shared_lib/sources/util/properties.cpp:218:52: error: 'megaglest' was not declared in this scope
/usr/src/RPM/BUILD/megaglest-source-3.6.0.2/source/shared_lib/sources/util/properties.cpp:218:76: error: expected primary-expression before ';' token
/usr/src/RPM/BUILD/megaglest-source-3.6.0.2/source/shared_lib/sources/util/properties.cpp:219:55: error: expected primary-expression before '/' token
/usr/src/RPM/BUILD/megaglest-source-3.6.0.2/source/shared_lib/sources/util/properties.cpp:219:79: error: expected primary-expression before ';' token
/usr/src/RPM/BUILD/megaglest-source-3.6.0.2/source/shared_lib/sources/util/properties.cpp:220:53: error: expected primary-expression before '/' token
/usr/src/RPM/BUILD/megaglest-source-3.6.0.2/source/shared_lib/sources/util/properties.cpp:220:77: error: expected primary-expression before ';' token
/usr/src/RPM/BUILD/megaglest-source-3.6.0.2/source/shared_lib/sources/util/properties.cpp: In static member function 'static bool Shared::Util::Properties::applyTagsToValue(std::string&, std::map<std::basic_string<char>, std::basic_string<char> >*)':
/usr/src/RPM/BUILD/megaglest-source-3.6.0.2/source/shared_lib/sources/util/properties.cpp:311:46: error: expected primary-expression before '/' token
/usr/src/RPM/BUILD/megaglest-source-3.6.0.2/source/shared_lib/sources/util/properties.cpp:311:46: error: 'usr' was not declared in this scope
/usr/src/RPM/BUILD/megaglest-source-3.6.0.2/source/shared_lib/sources/util/properties.cpp:311:46: error: 'share' was not declared in this scope
/usr/src/RPM/BUILD/megaglest-source-3.6.0.2/source/shared_lib/sources/util/properties.cpp:311:46: error: 'games' was not declared in this scope
/usr/src/RPM/BUILD/megaglest-source-3.6.0.2/source/shared_lib/sources/util/properties.cpp:311:46: error: 'megaglest' was not declared in this scope
/usr/src/RPM/BUILD/megaglest-source-3.6.0.2/source/shared_lib/sources/util/properties.cpp:311:70: error: expected primary-expression before ')' token
/usr/src/RPM/BUILD/megaglest-source-3.6.0.2/source/shared_lib/sources/util/properties.cpp:312:47: error: expected primary-expression before '/' token
/usr/src/RPM/BUILD/megaglest-source-3.6.0.2/source/shared_lib/sources/util/properties.cpp:312:71: error: expected primary-expression before ')' token
/usr/src/RPM/BUILD/megaglest-source-3.6.0.2/source/shared_lib/sources/util/properties.cpp:313:46: error: expected primary-expression before '/' token
/usr/src/RPM/BUILD/megaglest-source-3.6.0.2/source/shared_lib/sources/util/properties.cpp:313:70: error: expected primary-expression before ')' token
[ 52%] make[2]: *** [source/shared_lib/CMakeFiles/libmegaglest.dir/sources/util/properties.cpp.o] Error 1

when i'm remove this variable from the spec file, i can build the game, but it will search their data in /usr/loca/ directory.

softcoder

Please run cmake in verbose mode and let me see how its setting the macro:

CUSTOM_DATA_INSTALL_PATH

I suspect this has something to do with the % character. Possible escaping the % somehow (%% or \%) may help? What does

"%_datadir/games/megaglest/"

Refer to, I've never seen this syntax?

Worst case you could always pass the data folder as a commandline parameter using a startup script:

--data-path=x

For full details run:

./megalgest --help

Thanks

Andrew Clark

Quote from: softcoder on 25 December 2011, 08:02:38
Please run cmake in verbose mode and let me see how its setting the macro:
thank you. i will try.
Quote from: softcoder on 25 December 2011, 08:02:38
CUSTOM_DATA_INSTALL_PATH

I suspect this has something to do with the % character. Possible escaping the % somehow (%% or \%) may help? What does

"%_datadir/games/megaglest/"

Refer to, I've never seen this syntax?
This is rpm macros. He discloses in this:

[andy@timelock megaglest]$ rpm --eval %_datadir
/usr/share
[andy@timelock megaglest]$

Quote from: softcoder on 25 December 2011, 08:02:38
Worst case you could always pass the data folder as a commandline parameter using a startup script:

--data-path=x

For full details run:

./megalgest --help

Thanks
Yeah, if i remember correctly, you are already told me about this parameter. I'm using it in my
startup script.

#!/bin/sh
GLESTHOME=$HOME
export GLESTHOME

if [ ! -e "$GLESTHOME/glest.ini" ];  then
/bin/cp /usr/share/games/megaglest/glest.ini $GLESTHOME
fi     

if [ ! -e "$GLESTHOME/glestkeys.ini" ]; then
       /bin/cp /usr/share/games/megaglest/glestkeys.ini $GLESTHOME
fi

/usr/bin/megaglest-bin --data-path=/usr/share/games/megaglest/ --ini-path=$HOME --log-path=$HOME --enable-legacyfonts

[andy@timelock megaglest]$

Andrew Clark

Quote from: softcoder on 25 December 2011, 08:02:38
Please run cmake in verbose mode and let me see how its setting the macro:
Thanks
Here is the output:
http://dumpz.org/122558/
By the way, i've changed variable. it is look like this -D CUSTOM_DATA_INSTALL_PATH="/usr/share/games/megaglest/".
But, as we can see, error is still present.

softcoder

#4
Does escaping like this work for you?

-D CUSTOM_DATA_INSTALL_PATH="\\\"/usr/share/games/megaglest/\\\""

*NOTE: I have updated code in svn to fix this so that it is not required to escape the custom data path like this. The svn commit is in rev:3028

P.S. for miniupnpc if you have v1.6 then everything should compile ok. If you have 1.5 then you must add this to cmake:

-DMINIUPNPC_VERSION_PRE1_6=On

If you have 1.4 you need:

-DMINIUPNPC_VERSION_PRE1_6=On
-DMINIUPNPC_VERSION_PRE1_5=On


Also notice we have some rpm scripts (not updated for 3.6.0.2 but for 3.6.0) in mk/fedora.

Thanks