-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updated Build Scripts to support Mathcad 15 and Prime wrappers (#21)
* Update CMakeLists.txt to Build Wrappers - Build for either Mathcad 15 or Mathcad Prime 3.x - Slight mod to IF97.cpp for WIN32 builds - Updated README with Build instructions * Included Mathad wrapper header files in VS project via CMake script * Fix memory allocation for Mathcad if97_getvers() function, which returns a string * Added utility routines for forward and reverse vapor quality - Calc vapor quality within vapor dome - Calc H, S, U, V in terms of P & Q - Update documentation - Minor fixups with CMake script - Minor fixes to eliminate compiler warnings - Updated version to 2.1.0
- Loading branch information
Showing
19 changed files
with
938 additions
and
112 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,87 @@ | ||
project(IF97) | ||
cmake_minimum_required(VERSION 2.8.11) | ||
|
||
####################################### | ||
# PROJECT INFORMATION # | ||
#-------------------------------------# | ||
# This CMakeLists.txt file is for the # | ||
# IAPWS-IF97 thermodynamic library # | ||
# written by Ian Bell and Jeff # | ||
# Henning. The following section # | ||
# contains project and version # | ||
# information. # | ||
####################################### | ||
|
||
# Project name | ||
set(project_name "IF97") | ||
set(app_name ${project_name}) | ||
project(${project_name}) | ||
|
||
SET(CMAKE_BUILD_TYPE Release) | ||
|
||
######################################################################### | ||
# WRAPPER MODULES # | ||
#-----------------------------------------------------------------------# | ||
# Wrapper module compilation should be flagged from the command line. # | ||
# Each wrapper should set(IF97_FLAG ON) to indicate a module was built. # | ||
# If no module is specified on the command line, the IF97_FLAG is not # | ||
# set and the default test program is built. # | ||
######################################################################### | ||
|
||
######################### | ||
# MATHCAD PRIME MODULE # | ||
######################### | ||
|
||
if (IF97_PRIME_MODULE) | ||
set(IF97_FLAG ON) | ||
if(NOT WIN32) | ||
message(FATAL_ERROR "IF97_PRIME_MODULE can only be used on windows host") | ||
endif() | ||
IF( "${IF97_PRIME_ROOT}" STREQUAL "") | ||
message(FATAL_ERROR "You must provide the path to MathCAD Prime Root directory using something like -DIF97_PRIME_ROOT=\"C:/Program Files/PTC/Mathcad Prime 3.1\"") | ||
else() | ||
message(STATUS "IF97_PRIME_ROOT: ${IF97_PRIME_ROOT}") | ||
endif() | ||
FILE(GLOB_RECURSE IF97_HEADERS "${CMAKE_CURRENT_SOURCE_DIR}/wrapper/Mathcad/includes/*.h") | ||
include_directories("${IF97_PRIME_ROOT}/Custom Functions" "${CMAKE_CURRENT_SOURCE_DIR}" "${CMAKE_CURRENT_SOURCE_DIR}/wrapper/Mathcad/includes") | ||
add_library(IF97 SHARED ${IF97_HEADERS} "${CMAKE_CURRENT_SOURCE_DIR}/IF97.h" "${CMAKE_CURRENT_SOURCE_DIR}/wrapper/MathCAD/IF97.cpp") | ||
target_link_libraries(IF97 "${IF97_PRIME_ROOT}/Custom Functions/mcaduser.lib") | ||
SET_TARGET_PROPERTIES(IF97 PROPERTIES LINK_FLAGS "/ENTRY:\"DllEntryPoint\"") | ||
set_target_properties(IF97 PROPERTIES SUFFIX ".dll" PREFIX "") | ||
# install (TARGETS IF97 DESTINATION "${IF97_INSTALL_PREFIX}/MathCADPrime") | ||
# install (FILES "${CMAKE_CURRENT_SOURCE_DIR}/wrappers/MathCAD/if97_validation.mcdx" DESTINATION MathCADPrime) | ||
endif() | ||
|
||
######################### | ||
# MATHCAD 15 MODULE # | ||
######################### | ||
|
||
if (IF97_MATHCAD15_MODULE) | ||
set(IF97_FLAG ON) | ||
if(NOT WIN32) | ||
message(FATAL_ERROR "IF97_MATHCAD15_MODULE can only be used on windows host") | ||
endif() | ||
IF( "${IF97_MATHCAD15_ROOT}" STREQUAL "") | ||
message(FATAL_ERROR "You must provide the path to MathCAD 15 Root directory using something like -DIF97_MATHCAD15_ROOT=\"C:/Program Files (x86)/Mathcad/Mathcad 15\"") | ||
else() | ||
message(STATUS "IF97_MATHCAD15_ROOT: ${IF97_MATHCAD15_ROOT}") | ||
endif() | ||
FILE(GLOB_RECURSE IF97_HEADERS "${CMAKE_CURRENT_SOURCE_DIR}/wrapper/Mathcad/includes/*.h") | ||
include_directories("${IF97_MATHCAD15_ROOT}/userefi/microsft/include" "${CMAKE_CURRENT_SOURCE_DIR}" "${CMAKE_CURRENT_SOURCE_DIR}/wrapper/Mathcad/includes") | ||
add_library(IF97 SHARED ${IF97_HEADERS} "${CMAKE_CURRENT_SOURCE_DIR}/IF97.h" "${CMAKE_CURRENT_SOURCE_DIR}/wrapper/MathCAD/IF97.cpp") | ||
target_link_libraries(IF97 "${IF97_MATHCAD15_ROOT}/userefi/microsft/lib/mcaduser.lib") | ||
SET_TARGET_PROPERTIES(IF97 PROPERTIES LINK_FLAGS "/ENTRY:\"DllEntryPoint\"") | ||
set_target_properties(IF97 PROPERTIES SUFFIX ".dll" PREFIX "") | ||
# install (TARGETS IF97 DESTINATION "${IF97_INSTALL_PREFIX}/MathCAD15") | ||
# install (FILES "${CMAKE_CURRENT_SOURCE_DIR}/wrappers/MathCAD/if97_validation.xmcdz" DESTINATION MathCAD15) | ||
# install (FILES "${CMAKE_CURRENT_SOURCE_DIR}/wrappers/MathCAD/if97_EN.xml" DESTINATION MathCAD15) | ||
endif() | ||
|
||
######################### | ||
# TEST MODULE (DEFAULT) # | ||
######################### | ||
|
||
if (NOT IF97_FLAG) | ||
message(STATUS "Stand-alone IF97 Test.") | ||
add_executable(IF97 "${CMAKE_CURRENT_SOURCE_DIR}/IF97.cpp") | ||
endif() | ||
|
||
add_executable(IF97 IF97.cpp) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.