[coolprop] Fix usage, re-fix installation (#18305)

* [coolprop] Fix usage, re-fix installation

* update version record

* Update ports/coolprop/vcpkg.json

Co-authored-by: NancyLi1013 <46708020+NancyLi1013@users.noreply.github.com>

* Update versions/c-/coolprop.json

* Update versions/c-/coolprop.json

Co-authored-by: NancyLi1013 <46708020+NancyLi1013@users.noreply.github.com>
This commit is contained in:
Jack·Boos·Yu 2021-06-12 00:21:54 +08:00 committed by GitHub
parent 1ca6c59b71
commit 0fa821a46e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 61 additions and 31 deletions

View File

@ -1,5 +0,0 @@
Source: coolprop
Version: 6.4.1
Homepage: https://github.com/CoolProp/CoolProp
Description: Thermophysical properties for the masses
Build-Depends: catch, eigen3, pybind11, if97, fmt, rapidjson, msgpack, refprop-headers

View File

@ -0,0 +1,31 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 80ac50a..36819dd 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -493,13 +493,13 @@ IF ( COOLPROP_OBJECT_LIBRARY OR COOLPROP_STATIC_LIBRARY OR COOLPROP_SHARED_LIBRA
SET_PROPERTY(TARGET ${LIB_NAME} PROPERTY RELEASE_POSTFIX )
modify_msvc_flags("/MD") # Note that the default is not used if ${COOLPROP_MSVC_REL} or ${COOLPROP_MSVC_DBG} is set
ENDIF (MSVC)
- INSTALL(TARGETS ${LIB_NAME} DESTINATION static_library/${CMAKE_SYSTEM_NAME}/${BITNESS}bit_${CMAKE_CXX_COMPILER_ID}_${CMAKE_CXX_COMPILER_VERSION} )
- INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${COOLPROP_LIBRARY_HEADER} DESTINATION static_library)
+ INSTALL(TARGETS ${LIB_NAME} RUNTIME DESTINATION bin LIBRARY DESTINATION lib ARCHIVE DESTINATION lib)
+ INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${COOLPROP_LIBRARY_HEADER} DESTINATION include)
ELSEIF (COOLPROP_SHARED_LIBRARY)
LIST(APPEND APP_SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/${COOLPROP_LIBRARY_SOURCE}")
ADD_LIBRARY(${LIB_NAME} SHARED ${APP_SOURCES} ${COOLPROP_LIBRARY_EXPORTS})
- INSTALL(TARGETS ${LIB_NAME} DESTINATION shared_library/${CMAKE_SYSTEM_NAME}/${BITNESS}bit${CONVENTION} )
- INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${COOLPROP_LIBRARY_HEADER} DESTINATION shared_library)
+ INSTALL(TARGETS ${LIB_NAME} RUNTIME DESTINATION bin LIBRARY DESTINATION lib ARCHIVE DESTINATION lib)
+ INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${COOLPROP_LIBRARY_HEADER} DESTINATION include)
SET_PROPERTY (TARGET ${LIB_NAME} APPEND_STRING PROPERTY COMPILE_FLAGS " -DCOOLPROP_LIB")
# Now all the compiler specific settings for Visual Studio
IF (MSVC)
@@ -732,7 +732,7 @@ if (COOLPROP_EES_MODULE)
VERBATIM
)
# install the generated library and the other files
- install(TARGETS COOLPROP_EES DESTINATION "${CMAKE_INSTALL_PREFIX}/EES/${CMAKE_SYSTEM_NAME}")
+ install(TARGETS COOLPROP_EES RUNTIME DESTINATION bin LIBRARY DESTINATION lib ARCHIVE DESTINATION lib)
install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/wrappers/EES/CoolProp.htm" DESTINATION "${CMAKE_INSTALL_PREFIX}/EES/${CMAKE_SYSTEM_NAME}")
install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/wrappers/EES/CoolProp.LIB" DESTINATION "${CMAKE_INSTALL_PREFIX}/EES/${CMAKE_SYSTEM_NAME}")
install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/wrappers/EES/CoolProp_EES_Sample.EES" DESTINATION "${CMAKE_INSTALL_PREFIX}/EES/${CMAKE_SYSTEM_NAME}")

View File

@ -10,6 +10,7 @@ vcpkg_from_github(
fmt-fix.patch
fix-builderror.patch
fix-dependency.patch
fix-install.patch
)
vcpkg_find_acquire_program(PYTHON2)
@ -89,32 +90,13 @@ vcpkg_configure_cmake(
vcpkg_install_cmake()
vcpkg_copy_pdbs()
if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic")
set(TARGET_FOLDER "shared_library")
else()
set(TARGET_FOLDER "static_library")
if (VCPKG_TARGET_IS_WINDOWS AND COOLPROP_SHARED_LIBRARY)
vcpkg_replace_string(${CURRENT_PACKAGES_DIR}/include/CoolPropLib.h
"#if defined(COOLPROP_LIB)" "#if 1"
)
endif()
file(GLOB_RECURSE COOLPROP_HEADERS "${CURRENT_PACKAGES_DIR}/${TARGET_FOLDER}/*.h")
file(INSTALL ${COOLPROP_HEADERS} DESTINATION ${CURRENT_PACKAGES_DIR}/include)
file(GLOB_RECURSE COOLPROP_LIBS "${CURRENT_PACKAGES_DIR}/${TARGET_FOLDER}/*.lib")
file(GLOB_RECURSE COOLPROP_DLLS "${CURRENT_PACKAGES_DIR}/${TARGET_FOLDER}/*.dll")
file(INSTALL ${COOLPROP_LIBS} DESTINATION ${CURRENT_PACKAGES_DIR}/lib)
if(COOLPROP_DLLS)
file(INSTALL ${COOLPROP_DLLS} DESTINATION ${CURRENT_PACKAGES_DIR}/bin)
endif()
file(GLOB_RECURSE COOLPROP_DEBUG_LIBS "${CURRENT_PACKAGES_DIR}/debug/${TARGET_FOLDER}/*.lib")
file(GLOB_RECURSE COOLPROP_DEBUG_DLLS "${CURRENT_PACKAGES_DIR}/debug/${TARGET_FOLDER}/*.dll")
file(INSTALL ${COOLPROP_DEBUG_LIBS} DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib)
if(COOLPROP_DEBUG_DLLS)
file(INSTALL ${COOLPROP_DEBUG_DLLS} DESTINATION ${CURRENT_PACKAGES_DIR}/debug/bin)
endif()
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/${TARGET_FOLDER} ${CURRENT_PACKAGES_DIR}/${TARGET_FOLDER})
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
# Handle copyright
file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)
file(INSTALL "${SOURCE_PATH}/LICENSE" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)

17
ports/coolprop/vcpkg.json Normal file
View File

@ -0,0 +1,17 @@
{
"name": "coolprop",
"version-semver": "6.4.1",
"port-version": 1,
"description": "Thermophysical properties for the masses",
"homepage": "https://github.com/CoolProp/CoolProp",
"dependencies": [
"catch",
"eigen3",
"fmt",
"if97",
"msgpack",
"pybind11",
"rapidjson",
"refprop-headers"
]
}

View File

@ -1374,7 +1374,7 @@
},
"coolprop": {
"baseline": "6.4.1",
"port-version": 0
"port-version": 1
},
"coroutine": {
"baseline": "1.5.0",

View File

@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "61676b5a1e9b82c4b88fd3bf37b684f592f9103e",
"version-semver": "6.4.1",
"port-version": 1
},
{
"git-tree": "5b29615cb7e9dffd253398cd0d7d06a9b9b9fcb2",
"version-string": "6.4.1",