vcpkg/ports/celero/portfile.cmake
John Farrier 88b757e5e6
[celero] Update to v2.8.5. (#28567)
* [celero] Update to v2.8.4.

* [celero] Update to v2.8.4.

* [celero] Update to v2.8.5

* [Celero] Update to version v2.8.5

* Update ports/celero/portfile.cmake

Co-authored-by: Lily Wang <94091114+LilyWangLL@users.noreply.github.com>

* Update ports/celero/portfile.cmake

Co-authored-by: Lily Wang <94091114+LilyWangLL@users.noreply.github.com>

* Update celero.json

Co-authored-by: Lily Wang <94091114+LilyWangLL@users.noreply.github.com>
2022-12-29 23:58:50 -08:00

34 lines
1.2 KiB
CMake

vcpkg_minimum_required(VERSION 2022-10-12) # for ${VERSION}
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO DigitalInBlue/Celero
REF "v${VERSION}"
SHA512 7f2c22cd030ce59641636aa162b422694f79860c8a76d2227c706af9959d2c5269ae861c123e656ed3ae91835eb7e2b22501bca20fcd6ad0223ae95f312e73aa
HEAD_REF master
PATCHES
fix-bin-install-path.patch
)
string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "dynamic" CELERO_COMPILE_DYNAMIC_LIBRARIES)
vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}"
OPTIONS
-DCELERO_ENABLE_EXPERIMENTS=OFF
-DCELERO_ENABLE_TESTS=OFF
-DCELERO_COMPILE_DYNAMIC_LIBRARIES=${CELERO_COMPILE_DYNAMIC_LIBRARIES}
-DCELERO_TREAT_WARNINGS_AS_ERRORS=OFF
)
vcpkg_cmake_install()
vcpkg_cmake_config_fixup(CONFIG_PATH "lib/cmake/${PORT}")
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
if(VCPKG_LIBRARY_LINKAGE STREQUAL static)
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/celero/Export.h" "#ifdef CELERO_STATIC" "#define CELERO_STATIC\n#ifdef CELERO_STATIC")
endif()
file(INSTALL "${SOURCE_PATH}/license.txt" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)