# CMake '-s' argument - recent change in behaviour

**URL:** https://discourse.cmake.org/t/cmake-s-argument-recent-change-in-behaviour/5463
**Category:** Usage
**Tags:** os:linux
**Created:** [April 14, 2022, 9:32am UTC](https://discourse.cmake.org/t/cmake-s-argument-recent-change-in-behaviour/5463 "2022-04-14T09:32:14Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![mschorm](https://discourse.cmake.org/user_avatar/discourse.cmake.org/mschorm/32/2349_2.png) [@mschorm](https://discourse.cmake.org/u/mschorm)
#### Post date: [April 14, 2022, 9:32am UTC](https://discourse.cmake.org/t/cmake-s-argument-recent-change-in-behaviour/5463/1 "2022-04-14T09:32:15Z")

</div>

Hello,  
I am a maintainer of several packages that use CMake in the Fedora Linux.

Recently, after the following commit:  
` https://gitlab.kitware.com/cmake/cmake/-/merge_requests/7001`  
and this release:  
cmake-3.23.0-0.1.rc2  
the packages builds started to fail on CMake.

I’ve reported a Bugzilla ticket in which I gathered my observations:  
[https://bugzilla.redhat.com/show\_bug.cgi?id=2057738](https://bugzilla.redhat.com/show_bug.cgi?id=2057738)

The thing is I believe that the actual behavior differs from the intended behavior - I believe somewhere between the aforementioned commit and a CMake package release in Fedora, some bug was introduced.  
I’m looking forward clarifying the new behavior.

* * *

**Technical description:**  
The RPM packages in Fedora Linux are built with RPM macros.  
One of them is the “%cmake” macro, and we use it like this:  
[Tree - rpms/mariadb - src.fedoraproject.org](https://src.fedoraproject.org/rpms/mariadb/blob/rawhide/f/mariadb.spec#_808)  
The macro itself expands to a lot of code, and somewhere inside, there is the following:

```auto
/usr/bin/cmake \
     -S "." \
     -B "redhat-linux-build" \
      ~~lots of more CMake options omitted~~

```

In the package SPECfile, I then use “.” option right after the macro

```auto
%cmake . \
         -DBUILD_CONFIG=mysql_release \
         -DFEATURE_SET="community" \
         -DINSTALL_LAYOUT=RPM \
         ...

```

So the path to the source is specified two times.  
One in the macro, as  
` -S "."`  
Second by the maintainer as  
` .`

1/ I believe, that both options are **equivalent** - if either one would be removed, the function would not change.  
2/ I believe, per  
` https://gitlab.kitware.com/cmake/cmake/-/blob/v3.23.0-rc2/Source/cmake.h#L202`  
That it is completely irrelevant what path the maintainer specify, since it should be completely ignored, when “-S” is specified.  
3/ I believe that the update of the CMake to the mentioned new version should not have caused build issues.

* * *

The workaround exists - removing the path specified by the manintainer.  
However I worry, that it is just a workaround while the bugged behavior is not fixed.

Could you please describe to me what is the current intended behavior from your POV ?

---

<div class="post-metadata">

### Author: ![brad.king](https://discourse.cmake.org/user_avatar/discourse.cmake.org/brad.king/32/11_2.png) [@brad.king](https://discourse.cmake.org/u/brad.king)
#### Post date: [April 14, 2022, 2:36pm UTC](https://discourse.cmake.org/t/cmake-s-argument-recent-change-in-behaviour/5463/2 "2022-04-14T14:36:58Z")

</div>

This looks like [CMake Issue 23334](https://gitlab.kitware.com/cmake/cmake/-/issues/23334), which has been fixed in more recent release candidates, and the `.0` release.
