Author Topic: [(p) fixed] r3026: cmake issues with custom install path  (Read 1070 times)

Andrew Clark

  • Guest
[(p) fixed] r3026: cmake issues with custom install path
« on: 25 December 2011, 07:52:01 »
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
Code: [Select]
/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

  • MegaGlest Team
  • Battle Machine
  • ********
  • Posts: 2,239
    • View Profile
Re: r3026: cmake issues with custom install path
« Reply #1 on: 25 December 2011, 08:02:38 »
Please run cmake in verbose mode and let me see how its setting the macro:

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

Code: [Select]
"%_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:

Code: [Select]
--data-path=x
For full details run:

Code: [Select]
./megalgest --help
Thanks

Andrew Clark

  • Guest
Re: r3026: cmake issues with custom install path
« Reply #2 on: 25 December 2011, 08:09:36 »
Please run cmake in verbose mode and let me see how its setting the macro:
thank you. i will try.
Code: [Select]
CUSTOM_DATA_INSTALL_PATH
I suspect this has something to do with the % character. Possible escaping the % somehow (%% or \%) may help? What does

Code: [Select]
"%_datadir/games/megaglest/"
Refer to, I've never seen this syntax?
This is rpm macros. He discloses in this:
Code: [Select]
[andy@timelock megaglest]$ rpm --eval %_datadir
/usr/share
[andy@timelock megaglest]$
Worst case you could always pass the data folder as a commandline parameter using a startup script:

Code: [Select]
--data-path=x
For full details run:

Code: [Select]
./megalgest --help
Thanks
Yeah, if i remember correctly, you are already told me about this parameter. I'm using it in my
startup script.
Code: [Select]
#!/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

  • Guest
Re: r3026: cmake issues with custom install path
« Reply #3 on: 25 December 2011, 08:19:58 »
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

  • MegaGlest Team
  • Battle Machine
  • ********
  • Posts: 2,239
    • View Profile
Re: r3026: cmake issues with custom install path
« Reply #4 on: 25 December 2011, 16:00:52 »
Does escaping like this work for you?

Code: [Select]
-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:

Code: [Select]
-DMINIUPNPC_VERSION_PRE1_6=On
If you have 1.4 you need:

Code: [Select]
-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
« Last Edit: 25 December 2011, 16:23:26 by softcoder »

 

anything