vcpkg/ports/dimcli/portfile.cmake

40 lines
995 B
CMake
Raw Normal View History

2016-12-13 04:05:20 +08:00
include(vcpkg_common_functions)
2017-07-28 11:43:05 +08:00
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO gknowles/dimcli
REF v3.1.1
2017-11-11 15:46:58 +08:00
SHA512 ed9aeedc59a9d48c59aa8dd1adb9cb110771c1eab0bbab8f8b518e12a45cdafb0ea94301d082ed3a033ca2428c19c8d990c76f666d1e9822cddf6e744f1db701
2017-07-28 11:43:05 +08:00
HEAD_REF master
PATCHES
"${CMAKE_CURRENT_LIST_DIR}/fix-cmake.patch"
2017-07-28 11:43:05 +08:00
)
2016-12-13 04:05:20 +08:00
set(staticCrt OFF)
if(VCPKG_CRT_LINKAGE STREQUAL "static")
2016-12-13 04:05:20 +08:00
set(staticCrt ON)
endif()
if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic")
set(ENV{_CL_} "/DDIMCLI_LIB_DYN_LINK")
endif()
2016-12-13 04:05:20 +08:00
vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
OPTIONS
-DLINK_STATIC_RUNTIME:BOOL=${staticCrt}
-DINSTALL_LIBS:BOOL=ON
-DRECURSIVE_GENERATE=ON
2016-12-13 04:05:20 +08:00
)
vcpkg_install_cmake()
# Remove includes from ${CMAKE_INSTALL_PREFIX}/debug
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
# Handle copyright
file(
INSTALL "${SOURCE_PATH}/LICENSE"
2016-12-13 04:05:20 +08:00
DESTINATION "${CURRENT_PACKAGES_DIR}/share/dimcli"
RENAME copyright
)