cmake command line parsing broken
  • Priest of the Order of the Butterfly
    Priest of the Order of the Butterfly
    eliot
    Posts: 621 from 2004/4/15
    Hi,

    when I try to set some definitions with a space in cmake, cmake interprets it wrong.
    Example which works:

    Code:

    cmake -DCMAKE_C_FLAGS="-noixemul" ../


    But when I want to put some more definitions into the command line it breaks:

    Code:

    cmake -DCMAKE_C_FLAGS="-noixemul -mcpu=G4 -maltivec -mabi=altivec" ../


    Everything after -noixemul is interpreted as path.
    Maybe on MorphOS I have to escape the string value with spaces in a different way,
    but I don't know how.
    What I tried so far:

    "-noixemul -mcpu=G4 -maltivec -mabi=altivec"
    '-noixemul -mcpu=G4 -maltivec -mabi=altivec'
    -noixemul\ -mcpu=G4\ -maltivec\ -mabi=altivec

    Is that a cmake error on MorphOS or I am doing it wrong?
    regards
    eliot
  • »02.02.25 - 07:06
    Profile
  • Acolyte of the Butterfly
    Acolyte of the Butterfly
    Posts: 106 from 2020/12/24
    Quote:

    Everything after -noixemul is interpreted as path.


    Yep, it can happens even for other platforms. Maybe try "setenv" the C_FLAGS with all the parameters inside quotes as you tried.

    I have some projects that fail the same way with ".configure", and "setenv" before calling it works for me.
  • »02.02.25 - 08:15
    Profile
  • Priest of the Order of the Butterfly
    Priest of the Order of the Butterfly
    eliot
    Posts: 621 from 2004/4/15
    Hm, no, on all other platforms (Linux, Mac, Windows)
    it works like expected.

    But setenv might be a workaround

    [ Edited by eliot 02.02.2025 - 10:26 ]
    regards
    eliot
  • »02.02.25 - 10:24
    Profile
  • Priest of the Order of the Butterfly
    Priest of the Order of the Butterfly
    eliot
    Posts: 621 from 2004/4/15
    Is the cmake source of Mos sdk public?
    Maybe I can fix this and also update it to newer release?
    regards
    eliot
  • »02.02.25 - 10:30
    Profile
  • Priest of the Order of the Butterfly
    Priest of the Order of the Butterfly
    beworld
    Posts: 634 from 2010/2/10
    From: FRANCE
    You can find cmake 3.16.2 here: https://github.com/jacadcaps/webkitty/tree/morphos_2.46.5

    @Jaca possible to release it (or maybe new SDK) or it's specific to wayfarer ?
    PowerMac G5 Quad 2.5, IMac G5 2.1, PowerBook G4 1.5, MacMini 1.5
    My MOS ports
  • »02.02.25 - 11:09
    Profile Visit Website
  • Priest of the Order of the Butterfly
    Priest of the Order of the Butterfly
    eliot
    Posts: 621 from 2004/4/15
    Quote:

    beworld wrote:
    You can find cmake 3.16.2 here: https://github.com/jacadcaps/webkitty/tree/morphos_2.46.5



    That's WebKit, not cmake.

    Code:

    System:> which cmake
    System:Development/gg/bin/cmake
    System:> cmake --version
    cmake version 3.9.6
    CMake suite maintained and supported by Kitware (kitware.com/cmake).


    cmake is part of the SDK, but it's not listed on MorphOS sources: https://www.morphos-team.net/sources

    [ Edited by eliot 02.02.2025 - 12:08 ]
    regards
    eliot
  • »02.02.25 - 12:01
    Profile
  • Priest of the Order of the Butterfly
    Priest of the Order of the Butterfly
    tolkien
    Posts: 534 from 2013/5/29
    Will wait for the next SDK updates...
    MorphOS: PowerMac G5 - PowerBook G4 - MacMini.
    Classic: Amiga 1200/060 - A500 PiStorm
  • »02.02.25 - 13:57
    Profile
  • Priest of the Order of the Butterfly
    Priest of the Order of the Butterfly
    eliot
    Posts: 621 from 2004/4/15
    Quote:

    tolkien wrote:
    Will wait for the next SDK updates...


    Is there anything planned in near future?
    Will that problem be fixed?
    regards
    eliot
  • »02.02.25 - 14:42
    Profile
  • Priest of the Order of the Butterfly
    Priest of the Order of the Butterfly
    tolkien
    Posts: 534 from 2013/5/29
    Generally there is an SDK update after an OS updates.
    But dont know if this issues will be fixed.
    MorphOS: PowerMac G5 - PowerBook G4 - MacMini.
    Classic: Amiga 1200/060 - A500 PiStorm
  • »02.02.25 - 14:48
    Profile
  • Yokemate of Keyboards
    Yokemate of Keyboards
    Andreas_Wolf
    Posts: 12241 from 2003/5/22
    From: Germany
    > Generally there is an SDK update after an OS updates.

    Usually only after feature releases (= even revision number). Last SDK after bugfix release (= odd revision number) was the one released with MorphOS 3.9 a decade ago.
  • »02.02.25 - 15:36
    Profile
  • Priest of the Order of the Butterfly
    Priest of the Order of the Butterfly
    tolkien
    Posts: 534 from 2013/5/29
    Oh yes...thats precise information.
    Thanks.
    MorphOS: PowerMac G5 - PowerBook G4 - MacMini.
    Classic: Amiga 1200/060 - A500 PiStorm
  • »02.02.25 - 17:30
    Profile
  • MorphOS Developer
    jacadcaps
    Posts: 3146 from 2003/3/5
    From: Canada
    Quote:

    eliot wrote:
    when I try to set some definitions with a space in cmake, cmake interprets it wrong.


    Are you doing this in ksh or the AmigaDOS shell? Both have different ways of parsing the commandline. I'd suggest running cmake via make. That way you'll jump right into ixemul path parsing.
  • »02.02.25 - 20:31
    Profile Visit Website
  • MorphOS Developer
    jacadcaps
    Posts: 3146 from 2003/3/5
    From: Canada
    Quote:

    eliot wrote:
    Is the cmake source of Mos sdk public?
    Maybe I can fix this and also update it to newer release?


    It's part of the SDK Source archive you can find on our website.
  • »02.02.25 - 20:32
    Profile Visit Website
  • MorphOS Developer
    jacadcaps
    Posts: 3146 from 2003/3/5
    From: Canada
    Quote:

    eliot wrote:
    Quote:

    tolkien wrote:
    Will wait for the next SDK updates...


    Is there anything planned in near future?
    Will that problem be fixed?


    Next SDK will most likely be released together with MorphOS 3.20.

    I don't think this problem is actually cmake, more like sh or some interaction between ixemul and non-ixemul shells. Again, try calling it via make or run sh first.
  • »02.02.25 - 20:34
    Profile Visit Website
  • Priest of the Order of the Butterfly
    Priest of the Order of the Butterfly
    eliot
    Posts: 621 from 2004/4/15
    @ jacadcaps

    Yes, your are right. Running cmake from sh (ksh) and the problem is gone.

    Building cmark and other programs like this now works:

    Code:

    Work:workspace/cmark/build> which sh
    System:Development/gg/bin/ksh
    Work:workspace/cmark/build> sh
    $ pwd
    /Work/workspace/cmark/build
    cmake -DCMAKE_C_FLAGS="-noixemul -mcpu=G4 -maltivec -mabi=altivec" ../
    ...
    cmake --build . --target cmark_exe --config Release
    ...
    $ exit
    Work:workspace/cmark/build>


    Thanks for tip.
    So I can now do native builds of boost with cmake directly on MorphOS.
    regards
    eliot
  • »03.02.25 - 05:53
    Profile
  • Priest of the Order of the Butterfly
    Priest of the Order of the Butterfly
    eliot
    Posts: 621 from 2004/4/15
    Quote:

    jacadcaps wrote:
    Quote:

    eliot wrote:
    Is the cmake source of Mos sdk public?
    Maybe I can fix this and also update it to newer release?


    It's part of the SDK Source archive you can find on our website.


    Yes, thanks. I just looked onto the website but not into the source archive.
    I found it, thanks!
    regards
    eliot
  • »03.02.25 - 05:55
    Profile