Skip to content

Conversation

@mhucka
Copy link
Contributor

@mhucka mhucka commented Oct 21, 2025

This does a minor cleanup of a few issues with CMakeLists.txt:

  • Remove references to variable PYMATCHING_SOURCE_FILES_NO_MAIN. This variable is not defined anywhere in Chromobius and does not exist in Pymatching, so as far as I can tell, its value is always empty and thus has no effect in this CMakeLists.txt file.

  • Set variable CHROMOBIUS_VERSION_INFO from setup.py. Previously, the CMakeLists.txt file had this in it:

    add_compile_definitions(CHROMOBIUS_VERSION_INFO=${CHROMOBIUS_VERSION_INFO})

    However, the variable on the RHS (${CHROMOBIUS_VERSION_INFO}) is not set when CMake is processing the file. This PR changes it to extract the version number from the setup.py file.

  • Wrap long lines and normalize indentation to 4 spaces.

This variable is not defined anywhere in Chromobius and does not exist
in Pymatching, so it has no value and no effect in this CMakeLists.txt
file.
The `CMakeLists.txt file had this in it:

```cmake
add_compile_definitions(CHROMOBIUS_VERSION_INFO=${CHROMOBIUS_VERSION_INFO})
```

However, the variable on the RHS (`CHROMOBIUS_VERSION_INFO`) is not set
when CMake is processing the file.

The new code extracts the version number from the `setup.py` file and
sets the variable before the `add_compile_definitions()` statement.
This wraps some of the very long lines to stay within the 120 column
length used in the C++ files, and normalizes indentation to 4 spaces.
@mhucka mhucka changed the title Fix minor issues with CMakeLists.txt Fix a few minor issues with CMakeLists.txt Oct 21, 2025
@mhucka mhucka marked this pull request as ready for review October 24, 2025 22:01
@mhucka mhucka requested a review from Strilanc October 24, 2025 22:02
@mhucka mhucka added this pull request to the merge queue Oct 24, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Oct 24, 2025
@mhucka mhucka enabled auto-merge October 25, 2025 01:18
@mhucka mhucka added this pull request to the merge queue Oct 25, 2025
Merged via the queue into quantumlib:main with commit cc8798e Oct 25, 2025
96 of 97 checks passed
@mhucka mhucka deleted the mh-minor-cmakelists-fixes branch October 25, 2025 02:33
mhucka added a commit that referenced this pull request Dec 1, 2025
This does a minor cleanup of a few issues with `CMakeLists.txt`:

* Remove references to variable `PYMATCHING_SOURCE_FILES_NO_MAIN`. This
variable is not defined anywhere in Chromobius and does not exist in
Pymatching, so as far as I can tell, its value is always empty and thus
has no effect in this `CMakeLists.txt` file.

* Set variable `CHROMOBIUS_VERSION_INFO` from `setup.py`. Previously,
the `CMakeLists.txt` file had this in it:
   ```cmake

add_compile_definitions(CHROMOBIUS_VERSION_INFO=${CHROMOBIUS_VERSION_INFO})
   ```
However, the variable on the RHS (`${CHROMOBIUS_VERSION_INFO}`) is not
set when CMake is processing the file. This PR changes it to extract the
version number from the `setup.py` file.

* Wrap long lines and normalize indentation to 4 spaces.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants