Results 1 to 3 of 3

Thread: how to pass a parameter to cmake using %cmake_kde4

  1. #1

    Default how to pass a parameter to cmake using %cmake_kde4


    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?

  2. #2

    Default Re: how to pass a parameter to cmake using %cmake_kde4

    ktorrent uses
    %cmake_kde4 -d build -- -DENABLE_DHT_SUPPORT=false

    Not that I understand why it works.

  3. #3

    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


    as valid while


    (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.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts