openSUSE Forums > openSUSE Build Service (OBS) » how to pass a parameter to cmake using %cmake_kde4

Go Back   openSUSE Forums > openSUSE Build Service (OBS)
Forums FAQ Members List Search Today's Posts Mark Forums Read


openSUSE Build Service (OBS) Questions about creating packages for openSUSE and using the Build Service

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 21-Sep-2009, 04:07
Puzzled Penguin
 
Join Date: Sep 2008
Posts: 2
urwald hasn't been rated much yet
Default how to pass a parameter to cmake using %cmake_kde4

Hello.

I want to build a KDE4 package in OBS. I have to pass a parameter (type: "-D DISABLE_LIB_X_SUPPORT=YES") to be able to run cmake sucessfull on older openSUSE versions who don't provide the requiered lib.

However, I want to use %cmake_kde4 (and not call cmake directly) because the additional switches are good and I don't want to hardcode the install directories etc.

It isn't possible to write simply "%cmake_kde4 -D DISABLE_LIB_X_SUPPORT=YES" because this expands to something like "cmake -SWITCH1 -SWITCH2 ./ -D DISABLE_LIB_X_SUPPORT=YES" and has the target directory in the middle of the options, which is invalid.

So, is there a possibility to make use of the parameters of %cmake_kde4 and also pass my own parameters additionally?
Reply With Quote
  #2 (permalink)  
Old 21-Sep-2009, 12:41
Busy Penguin
 
Join Date: Jun 2008
Posts: 390
RedDwarf hasn't been rated much yet
Default Re: how to pass a parameter to cmake using %cmake_kde4

ktorrent uses
Code:
%cmake_kde4 -d build -- -DENABLE_DHT_SUPPORT=false
so...

Not that I understand why it works.
Reply With Quote
  #3 (permalink)  
Old 22-Sep-2009, 03:32
Puzzled Penguin
 
Join Date: Sep 2008
Posts: 2
urwald hasn't been rated much yet
Default Re: how to pass a parameter to cmake using %cmake_kde4

Hello RedDwarf.

That helps me a lot. Thanks.

The reason why it works for KTorrent is CMake. CMake accepts a call like

cmake ./ -DENABLE_SOMETHING=YES

as valid while

cmake ./ -D ENABLE_SOMETHING=YES

(with a space after -D) is invalid. When you want to have a space after -D, you must put the option before the directory. When you don't use a space, you can put it before the directory, but also after it.

So now I use %cmake_kde4 with parameter but without a space.

Thank you a lot.

urwald
Reply With Quote
Reply

Bookmarks


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




 

Search Engine Friendly URLs by vBSEO 3.3.0 RC2