You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Update Cmake min version and Mathcad build
* Fix code block formatting in README.md
* Update CMakeLists.txt with NO_DEFAULT_ROOT finding Mathcad
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
* Refine README.md formatting and instructions
Updated formatting and improved clarity in README instructions for Mathcad and Visual Studio versions.
---------
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
# Make sure we're on Winows - the only platform on which Mathad Prime runs
78
79
if(NOTWIN32)
79
80
message(FATAL_ERROR"[${PROJECT_NAME}] - IF97_PRIME_MODULE can only be used on windows host")
80
81
endif()
82
+
# Check for valid Mathacd Prime Root directory provided by user. If not provided, try to find it on our own.
81
83
if( "${IF97_PRIME_ROOT}"STREQUAL"")
82
-
message(FATAL_ERROR"[${PROJECT_NAME}] - You must provide the path to MathCAD Prime Root directory using something like -DIF97_PRIME_ROOT=\"C:/Program Files/PTC/Mathcad Prime 3.1\"")
84
+
# PTC/Mathcad convention is a directory labeled "C:\Program Files\PTC\Mathad Prime X.X.X.X"
85
+
# Find all of these directories on the system and try to set IF97_PRIME_ROOT dynamically
86
+
file(GLOBPTC_CONTENTS
87
+
LIST_DIRECTORIEStrue
88
+
"C:/Program Files/PTC/Mathcad Prime*"
89
+
)
90
+
# Add them to a list, sorted by most recent Marhcad Prime release first
message(STATUS"[${PROJECT_NAME}] - Linking with Mathcad Prime Library v${MATHCAD_VERSION}\"")
112
+
else()
113
+
message(STATUS"[${PROJECT_NAME}] - Could not Dynamically Locate Mathcad Prime on this System")
114
+
message(FATAL_ERROR"[${PROJECT_NAME}] - You must provide the path to MathCAD Prime Root directory using something like -DIF97_PRIME_ROOT=\"C:/Program Files/PTC/Mathcad Prime 11.0.0.0\"")
message(STATUS"[${PROJECT_NAME}] - Linking with Mathcad Prime Library v${MATHCAD_VERSION}\"")
124
+
else()
125
+
message(STATUS"[${PROJECT_NAME}] - Could not find Mathcad Prime at ${IF97_PRIME_ROOT}")
126
+
message(FATAL_ERROR"[${PROJECT_NAME}] - Check the path to the MathCAD Prime Root directory provided using something like -DIF97_PRIME_ROOT=\"C:/Program Files/PTC/Mathcad Prime 11.0.0.0\"")
127
+
endif()
128
+
endif()
129
+
# Embed Windows VERSIONINFO so IF97.dll's Properties dialog shows
130
+
# FileVersion/ProductVersion fields a la CoolProp(#2863). The .rc
131
+
# is configured from VERSION above and added to the source
132
+
# list only on MSVC and MSYS2(MinGW), where rc.exe is available.
Copy file name to clipboardExpand all lines: wrapper/Mathcad/README.md
+22-10Lines changed: 22 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -54,39 +54,51 @@ Make the Build for Mathcad Prime (any version above 3.0)
54
54
55
55
* Go to the top level IF97 directory and make a build directory (something like \build or \buildPrime):
56
56
57
+
```bash
57
58
mkdir buildPrime
58
59
cd buildPrime
60
+
```
59
61
60
62
* Build the makefile using CMake (Note: Mathcad Prime is 64-bit):
61
63
64
+
```cmake
62
65
cmake .. -DIF97_PRIME_MODULE=ON
63
66
-DIF97_PRIME_ROOT="C:/Program Files/PTC/Mathcad Prime 10.0.0.0"
64
67
-G "Visual Studio 17 2022" -A x64
65
-
-DCMAKE_VERBOSE_MAKEFILE=ON
68
+
-DCMAKE_VERBOSE_MAKEFILE=ON
69
+
```
66
70
67
-
> Insert your version of Mathcad Prime in place of "10.0.0.0".
68
-
> Insert your version of Visual Studio for the -G option.
69
-
> Note that Mathcad Prime is 64-bit and requires the `-A x64` switch on this command.
70
-
> Prior to VS 2017, use something like: `-G "Visual Studio 14 2015 Win64`
71
+
- Insert your version of Mathcad Prime in place of "10.0.0.0" (or omit).
72
+
- Insert your version of Visual Studio for the `-G` option.
73
+
- Note that Mathcad Prime is 64-bit and requires the `-A x64` switch on this command.
74
+
- Prior to VS 2017, use something like: `-G "Visual Studio 14 2015 Win64"`.
75
+
.
76
+
77
+
>**NOTE:**
78
+
> Specifying the Mathcad Prime root directory is optional. CMake will attempt to find the most recent version of Mathcad Prime on the system and use that one to link the Mathcad Prime library and header file. If a valid Mathcad Prime installation directory cannot be found, or you want to specify an older version on the system to link to, then supply the ``-DIF97_PRIME_ROOT`` flag as directed above.
71
79
72
80
Make the Build for Legacy Mathcad 15 (Discontinued by PTC)
> Insert your version of Visual Studio for the -G option.
88
-
> Legacy Mathcad was 32-bit and requires a 32-bit add-in DLL.
89
-
> Prior to VS2017, use something like `-G "Visual Studio 14 2015` as 32-bit was the default.
97
+
```
98
+
99
+
- Insert your version of Visual Studio for the -G option.
100
+
- Legacy Mathcad was 32-bit and requires a 32-bit add-in DLL.
101
+
- Prior to VS2017, use something like `-G "Visual Studio 14 2015` as 32-bit was the default.
90
102
91
103
Build the Project
92
104
-----------------
@@ -131,4 +143,4 @@ Compiler Flags
131
143
==============
132
144
The Mathcad wrapper code uses the ``REGION3_ITERATE`` flag to provide more accurate (but slightly slower) calculation of density in Region 3 (mostly super-critical), but does **_not_** use the ``IAPWS_UNITS`` flag by default, leaving all input/output values in SI units.
133
145
134
-
The `IAPWS_UNITS` flag can be set (uncommented) in the top of the IF97.cpp file to input and output IAPWS units (Pressures in MPa and energy in kJ) for easy comparison with IAPWS release documents.
146
+
The `IAPWS_UNITS` flag can be set (uncommented) in the top of the IF97.cpp file to input and output IAPWS units (Pressures in MPa and energy in kJ) for easy comparison with IAPWS release documents.
0 commit comments