LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   Passing cmake variables in a src2pkg script... (https://www.linuxquestions.org/questions/slackware-14/passing-cmake-variables-in-a-src2pkg-script-655783/)

gnashley 07-18-2008 03:11 PM

Maybe that is specific to newer versions of cmake -I see that the general pattern is shown there for all variables with :something -the something seems to be a variable type specification, BOOL, PATH, STRING. You'll just have to try it both ways till it works.

Lufbery 07-19-2008 10:26 AM

Hi Gilbert,

I think you're right. The cmake documentation shows a change in the variable syntax in the newer versions.

If I understand how src2pkg works, however, I should be able to modify the cmake portion of the 06-configure_source file to accommodate the new syntax, right?

Again, thank you very much for your help.

Regards,

-Drew

gnashley 07-20-2008 01:07 AM

Yeah, just look at lines approx 388-400 in 06-configure_source and change the two
occurrences of:
cmake .. -DCMAKE_INSTALL_PREFIX=/${PKG_DIR}/${PRE_FIX}
to:
cmake .. -DCMAKE_INSTALL_PREFIX:PATH=/${PKG_DIR}/${PRE_FIX}
and the two:
cmake . -DCMAKE_INSTALL_PREFIX=/${PKG_DIR}/${PRE_FIX}
to:
cmake . -DCMAKE_INSTALL_PREFIX:PATH=/${PKG_DIR}/${PRE_FIX}

I'll have to implement a more elegant fix for the next release and check the version of cmake and use the appropriate syntax according to the version found.
Thanks, reporting the results of your research= better src2pkg.

Lufbery 07-20-2008 03:04 PM

Gilbert,

I'm glad to help. I'm saving this thread with an eye toward getting a lot of this information in the wiki this week.

Regards,

-Drew

gnashley 07-24-2008 12:38 PM

Drew, have you been able to tell at what smake ersion those syntax changes started? I need to write a version-detection routine into src2pkg for that, but I haven't seen any direct references to the changes. Thanks for helping out on this one.

Lufbery 07-24-2008 08:44 PM

Quote:

Originally Posted by gnashley (Post 3225166)
Drew, have you been able to tell at what smake ersion those syntax changes started? I need to write a version-detection routine into src2pkg for that, but I haven't seen any direct references to the changes. Thanks for helping out on this one.

Gilbert,

I'm striking out. I've spend the past hour and a half digging through the cmake documentation to find when/if there was a change.

Here's a link to a page with documentation for the released versions of cmake. From what I can tell, this syntax:

Code:

-D<var>:<type>=<value>
...has been around since version 1.8.3. Slackware 12.1 uses cmake 2.4.8.

I hope this helps a little bit.

Regards,

-Drew

Lufbery 08-05-2008 09:58 AM

Gilbert (and others who are interested),

I finally got the Cmake information into the src2pkg wiki. Check it out here, and let me know what you think.

Regards,

-Drew

gnashley 08-05-2008 12:05 PM

Thanks, Drew. Your tip should be outdated and removed from the wiki though with the next release of src2pkg. I had waited to see if any more specific info came out about when the new style of variable was adopted, but when you pointed out that it has been around for quite awile already, I figured that cmake is able to handle the variables using either syntax -since all the stuff I had tested with src2pkg which uses cmake was able to use the old-style syntax. Since that seems to be the case, src2pkg won't even need to detect the cmake version -I'll simply make it use the newer syntax whe it adds the CMAKE_INSTALL_PREFIX by default. This will keep it consistent with the usage for other types of configuration, and when a user needs to add other EXTRA_CONFIGS, they can safely use whatever syntax is suggested by the sources they are building.

Lufbery 08-05-2008 12:09 PM

Gilbert,

I'll make a note that the 06_configure_source stuff can be taken out when you release the next version of src2pkg. :)

Meanwhile, this should help some people, anyway.

Regards,

-Drew

gnashley 08-05-2008 02:21 PM

Thank you, Drew, for following up on this.


All times are GMT -5. The time now is 07:18 PM.