Skip to content

Update Cmake min version and Mathcad build#55

Merged
henningjp merged 4 commits into
masterfrom
CmakeUpdate
May 16, 2026
Merged

Update Cmake min version and Mathcad build#55
henningjp merged 4 commits into
masterfrom
CmakeUpdate

Conversation

@henningjp
Copy link
Copy Markdown
Contributor

@henningjp henningjp commented May 16, 2026

Description of the Change

Several Updates to CMake

  • Minimum version updated to 3.20 (needed for cmake_path commands).
  • Fixed some messages being output from CMake during build.
  • Similar to build(MSVC): embed VERSIONINFO in CoolProp.dll (#2391) CoolProp#2863 , embedded VERSIONINFO resource into the Mathcad Prime IF97 wrapper. Only executed if the generator is MSVC.
  • Added dynamic detection of the latest Mathcad Prime version on the system to set Mathcad Prime root directory.
  • Added validation check if user specified root directory with -DIF97_PRIME_ROOT
  • Updated build instructions in the README file to reflect these changes

Benefits

  1. Mathcad Prime wrapper DLL is built with version information that can be checked by right-clicking the DLL file. Assists in determining the IF97 version of the DLL without having to load it and run it.
  2. Simplifies cmake command line by dynamically finding a valid Mathcad Prime installation on the sytem

Possible Drawbacks

None. No code changes to the IF97 library itself.

Verification Process

  • CMake configure succeeds on Test Build (non-Mathcad)
  • CMake configure succeeds when building Mathcad PRIME DLL and -DIF97_PRIME_ROOT is specified
  • CMake configure succeeds when building Mathcad PRIME DLL and -DIF97_PRIME_ROOT is omitted. CMake correctly finds the most recent version of Mathcad Prime installed on the system.
  • Mathcad Prime add-in DLL has been verified to contain the correct version information
image

Applicable Issues

Same as issue CoolProp/CoolProp#2391

Summary by CodeRabbit

  • Chores

    • Removed legacy Visual Studio project/solution files; builds now managed exclusively via CMake
    • Raised minimum CMake requirement to 3.20
    • Improved project version reporting and exposed build-version in build messages
  • Improvements

    • Enhanced Windows build handling with automatic detection, validation and Windows-only constraint for the Prime integration
    • Embedded Windows version/resource info for clearer binary metadata
  • Documentation

    • Reformatted build instructions for clarity

Review Change Stack

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 16, 2026

📝 Walkthrough

Walkthrough

Raises CMake minimum to 3.20, sets project versioning and IF97_VERSION, enforces Windows-only Mathcad Prime module with auto-detection and resource embedding, removes Visual Studio project files, and reformats Mathcad build instructions.

Changes

Mathcad Build System Modernization

Layer / File(s) Summary
CMake version and project versioning setup
CMakeLists.txt
CMake minimum raised to 3.20; project("IF97" ... VERSION ${VERSION}) used; version log prefix changed to [IF97]; IF97_VERSION computed by replacing dots with commas for resource usage.
Mathcad Prime auto-detection and Windows resource embedding
CMakeLists.txt, wrapper/Mathcad/dev/IF97.rc.in
Enforced Windows-only IF97_PRIME_MODULE. When IF97_PRIME_ROOT is empty, CMake searches typical "Program Files/PTC/Mathcad Prime*" directories, finds MathcadPrime.exe, derives/validates the root and extracts a 4-part version from the path. On MSVC, IF97.rc is configured from IF97.rc.in and added to the shared library sources.
Removed Visual Studio solution and project files
wrapper/Mathcad/IF97.sln, wrapper/Mathcad/IF97.vcxproj
Legacy Visual Studio solution and project files were removed (Debug/Release Win32 project configuration and MSBuild project content deleted).
Build instruction documentation
wrapper/Mathcad/README.md
Mathcad Prime and Legacy Mathcad build command sections reformatted into fenced code blocks; existing CMake options and notes unchanged.

Poem

🐰 In the warren CMake hums anew,
It hunts Prime paths where binaries flew,
Versions stitched in a tiny .rc seam,
Old VS projects hop off the team,
Build notes snug like carrots in dew.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately reflects the main changes: updating CMake minimum version to 3.20 and substantially refactoring the Mathcad build configuration including dynamic version detection and resource embedding.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch CmakeUpdate

Tip

💬 Introducing Slack Agent: The best way for teams to turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
CMakeLists.txt (1)

14-23: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Allow multi-digit version components in get_version().

The current regex only accepts single-digit major.minor.patch. As soon as IF97.h moves to something like 2.10.0, configuration will fail with a FATAL_ERROR since the pattern [0-9]\.[0-9]\.[0-9] matches only 2.1 and leaves .0 unmatched.

Suggested fix
-  string(REGEX MATCH "[0-9]\\.[0-9]\\.[0-9]" SECOND_MATCH "${FIRST_MATCH}")
+  string(REGEX MATCH "[0-9]+\\.[0-9]+\\.[0-9]+" SECOND_MATCH "${FIRST_MATCH}")
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@CMakeLists.txt` around lines 14 - 23, The version regex in get_version() only
accepts single-digit components; update both regexes to allow multi-digit parts
so versions like 2.10.0 are matched. In the file(STRINGS ...) call that
currently uses "(.*IF97VERSION.*\")(v[0-9](\\.[0-9])*)(\".*)" replace the
version capture with something like "v[0-9]+(\\.[0-9]+){2}" (or
"v[0-9]+(\\.[0-9]+)*" if you want variable length components), and in the
string(REGEX MATCH "[0-9]\\.[0-9]\\.[0-9]" SECOND_MATCH ...) replace the pattern
with "[0-9]+\\.[0-9]+\\.[0-9]+" so FIRST_MATCH/SECOND_MATCH correctly capture
multi-digit major/minor/patch values before set(${output} ...).
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@CMakeLists.txt`:
- Around line 99-101: The find_program() invocation that sets MATHCAD_EXE
currently can return cached or PATH-located executables, so unset the cached
MATHCAD_EXE before each search (use unset(MATHCAD_EXE CACHE)) and add the
NO_DEFAULT_PATH option to the find_program() calls (the ones that locate
MathcadPrime.exe) so the search is constrained to the provided PATHS; update
both occurrences tied to the IF97_PRIME_ROOT logic and the other Mathcad search
to follow this pattern.

In `@wrapper/Mathcad/README.md`:
- Around line 71-77: Remove the blank line that splits the blockquote so the
entire note and preceding quoted lines form a single contiguous blockquote;
specifically, edit the README.md block that begins with the quote lines ("Insert
your version of Mathcad Prime...", the `-A x64` note, and the line starting with
"**NOTE:**") and join them without an empty line between them to satisfy
markdownlint MD028.
- Around line 57-60: Update the two plain triple-backtick fenced blocks that
contain the shell commands "mkdir buildPrime / cd buildPrime" and "mkdir build15
/ cd build15" to include a language identifier (e.g., ```bash) so the fences
become fenced bash blocks; simply change the opening backticks for each block to
```bash to satisfy markdownlint MD040 and match the existing CMake examples.

---

Outside diff comments:
In `@CMakeLists.txt`:
- Around line 14-23: The version regex in get_version() only accepts
single-digit components; update both regexes to allow multi-digit parts so
versions like 2.10.0 are matched. In the file(STRINGS ...) call that currently
uses "(.*IF97VERSION.*\")(v[0-9](\\.[0-9])*)(\".*)" replace the version capture
with something like "v[0-9]+(\\.[0-9]+){2}" (or "v[0-9]+(\\.[0-9]+)*" if you
want variable length components), and in the string(REGEX MATCH
"[0-9]\\.[0-9]\\.[0-9]" SECOND_MATCH ...) replace the pattern with
"[0-9]+\\.[0-9]+\\.[0-9]+" so FIRST_MATCH/SECOND_MATCH correctly capture
multi-digit major/minor/patch values before set(${output} ...).
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: baf2ecf0-1e73-4a34-9d80-a18032cbefc5

📥 Commits

Reviewing files that changed from the base of the PR and between 51a5a6f and 819d932.

📒 Files selected for processing (5)
  • CMakeLists.txt
  • wrapper/Mathcad/IF97.sln
  • wrapper/Mathcad/IF97.vcxproj
  • wrapper/Mathcad/README.md
  • wrapper/Mathcad/dev/IF97.rc.in
💤 Files with no reviewable changes (2)
  • wrapper/Mathcad/IF97.sln
  • wrapper/Mathcad/IF97.vcxproj

Comment thread CMakeLists.txt Outdated
Comment thread wrapper/Mathcad/README.md Outdated
Comment thread wrapper/Mathcad/README.md Outdated
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

♻️ Duplicate comments (1)
wrapper/Mathcad/README.md (1)

71-77: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Keep the note as one contiguous blockquote.

There is still a blank separator in this quoted note section (MD028). Remove the empty quoted break so the whole note remains one continuous blockquote.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@wrapper/Mathcad/README.md` around lines 71 - 77, The blockquote in README.md
describing Mathcad Prime options contains an empty quoted line that breaks the
note into multiple blockquote paragraphs (MD028); remove the blank quoted
separator so the entire NOTE (the paragraph that mentions "-DIF97_PRIME_ROOT",
the Mathcad Prime root directory, and CMake behavior) is one contiguous
blockquote without intervening empty quote lines.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Duplicate comments:
In `@wrapper/Mathcad/README.md`:
- Around line 71-77: The blockquote in README.md describing Mathcad Prime
options contains an empty quoted line that breaks the note into multiple
blockquote paragraphs (MD028); remove the blank quoted separator so the entire
NOTE (the paragraph that mentions "-DIF97_PRIME_ROOT", the Mathcad Prime root
directory, and CMake behavior) is one contiguous blockquote without intervening
empty quote lines.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 1a44a697-a85b-49b0-8c89-44f23a4eb4c0

📥 Commits

Reviewing files that changed from the base of the PR and between 819d932 and bafcc7e.

📒 Files selected for processing (1)
  • wrapper/Mathcad/README.md

henningjp and others added 2 commits May 16, 2026 12:45
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Updated formatting and improved clarity in README instructions for Mathcad and Visual Studio versions.
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🧹 Nitpick comments (1)
wrapper/Mathcad/README.md (1)

64-64: 💤 Low value

Consider using a standard language identifier.

The cmake identifier is non-standard for fenced code blocks. Since this is a shell invocation of the cmake command, consider using bash or shell for consistent syntax highlighting.

📝 Suggested change
-    ```cmake
+    ```bash
     cmake .. -DIF97_PRIME_MODULE=ON 
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@wrapper/Mathcad/README.md` at line 64, The fenced code block in README.md
currently uses the non-standard language identifier "cmake"; change that fence
language to a standard shell language such as "bash" or "shell" so the line
starting with the triple backticks becomes ```bash (or ```shell) to ensure
correct syntax highlighting for the shell invocation `cmake ..
-DIF97_PRIME_MODULE=ON`.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@wrapper/Mathcad/README.md`:
- Around line 71-75: Fix the markdown list indentation and remove the stray
period: adjust the three list items that currently have 4-space indentation
("Insert your version of Mathcad Prime...", "Insert your version of Visual
Studio...", "Note that Mathcad Prime...") to use the normal single-space bullet
indentation consistent with the surrounding list to satisfy markdownlint MD005,
and delete the orphaned line that contains only "." so the README.md bullets are
properly formatted and no empty period remains.
- Around line 99-101: The markdown list items "Legacy Mathcad was 32-bit and
requires a 32-bit add-in DLL." and "Prior to VS2017, use something like `-G
"Visual Studio 14 2015` as 32-bit was the default." have 4-space indentation
causing MD005; change their indentation to a single space (align them with the
other list items) so each line begins with one space then the hyphen, ensuring
consistent list indentation in README.md.

---

Nitpick comments:
In `@wrapper/Mathcad/README.md`:
- Line 64: The fenced code block in README.md currently uses the non-standard
language identifier "cmake"; change that fence language to a standard shell
language such as "bash" or "shell" so the line starting with the triple
backticks becomes ```bash (or ```shell) to ensure correct syntax highlighting
for the shell invocation `cmake .. -DIF97_PRIME_MODULE=ON`.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 5411c00e-5294-48ba-ab8b-ed1154e177af

📥 Commits

Reviewing files that changed from the base of the PR and between 004158b and 88da926.

📒 Files selected for processing (1)
  • wrapper/Mathcad/README.md

Comment thread wrapper/Mathcad/README.md
Comment thread wrapper/Mathcad/README.md
Comment on lines +99 to +101
- Insert your version of Visual Studio for the -G option.
- Legacy Mathcad was 32-bit and requires a 32-bit add-in DLL.
- Prior to VS2017, use something like `-G "Visual Studio 14 2015` as 32-bit was the default.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Fix inconsistent list indentation.

Lines 100-101 use 4-space indentation where 1-space is expected, triggering markdownlint MD005.

📐 Proposed fix
-         
-	- Insert your version of Visual Studio for the -G option.  
-    - Legacy Mathcad was 32-bit and requires a 32-bit add-in DLL.  
-    - Prior to VS2017, use something like `-G "Visual Studio 14 2015` as 32-bit was the default.
+
+ - Insert your version of Visual Studio for the -G option.  
+ - Legacy Mathcad was 32-bit and requires a 32-bit add-in DLL.  
+ - Prior to VS2017, use something like `-G "Visual Studio 14 2015` as 32-bit was the default.
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
- Insert your version of Visual Studio for the -G option.
- Legacy Mathcad was 32-bit and requires a 32-bit add-in DLL.
- Prior to VS2017, use something like `-G "Visual Studio 14 2015` as 32-bit was the default.
- Insert your version of Visual Studio for the -G option.
- Legacy Mathcad was 32-bit and requires a 32-bit add-in DLL.
- Prior to VS2017, use something like `-G "Visual Studio 14 2015` as 32-bit was the default.
🧰 Tools
🪛 LanguageTool

[style] ~101-~101: ‘Prior to’ might be wordy. Consider a shorter alternative.
Context: ...d requires a 32-bit add-in DLL. - Prior to VS2017, use something like `-G "Visual ...

(EN_WORDINESS_PREMIUM_PRIOR_TO)

🪛 markdownlint-cli2 (0.22.1)

[warning] 100-100: Inconsistent indentation for list items at the same level
Expected: 1; Actual: 4

(MD005, list-indent)


[warning] 101-101: Inconsistent indentation for list items at the same level
Expected: 1; Actual: 4

(MD005, list-indent)

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@wrapper/Mathcad/README.md` around lines 99 - 101, The markdown list items
"Legacy Mathcad was 32-bit and requires a 32-bit add-in DLL." and "Prior to
VS2017, use something like `-G "Visual Studio 14 2015` as 32-bit was the
default." have 4-space indentation causing MD005; change their indentation to a
single space (align them with the other list items) so each line begins with one
space then the hyphen, ensuring consistent list indentation in README.md.

@henningjp henningjp merged commit 0be7b51 into master May 16, 2026
5 checks passed
@henningjp henningjp deleted the CmakeUpdate branch May 16, 2026 17:18
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.

1 participant