vcpkg/ports/jsoncpp/portfile.cmake

43 lines
1.2 KiB
CMake
Raw Normal View History

2017-08-27 13:24:51 +00:00
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO open-source-parsers/jsoncpp
REF 1.9.2
SHA512 7c7188199d62ae040d458d507ba62f0370c53f39c580760ee5485cae5c08e5ced0c9aea7c14f54dfd041999a7291e4d0f67f8ccd8b1030622c85590774688640
2017-08-27 13:24:51 +00:00
HEAD_REF master
PATCHES
allow-disable-examples.patch
2016-11-16 15:10:35 +00:00
)
if (VCPKG_LIBRARY_LINKAGE STREQUAL static)
2016-11-16 21:13:08 +00:00
set(JSONCPP_STATIC ON)
else()
set(JSONCPP_STATIC OFF)
2016-11-16 21:13:08 +00:00
endif()
2016-11-16 15:10:35 +00:00
vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
2017-08-27 13:24:51 +00:00
PREFER_NINJA
OPTIONS
-DJSONCPP_WITH_CMAKE_PACKAGE=ON
-DBUILD_STATIC_LIBS=${JSONCPP_STATIC}
-DJSONCPP_WITH_PKGCONFIG_SUPPORT=OFF
-DJSONCPP_WITH_POST_BUILD_UNITTEST=OFF
-DJSONCPP_WITH_TESTS=OFF
-DJSONCPP_WITH_EXAMPLE=OFF
2016-11-16 15:10:35 +00:00
)
vcpkg_install_cmake()
# Fix CMake files
2017-08-27 13:24:51 +00:00
vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/jsoncpp)
2016-11-16 15:10:35 +00:00
2017-08-27 13:24:51 +00:00
# Remove includes in debug
2016-11-16 15:10:35 +00:00
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
# Handle copyright
file(COPY ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/jsoncpp)
file(RENAME ${CURRENT_PACKAGES_DIR}/share/jsoncpp/LICENSE ${CURRENT_PACKAGES_DIR}/share/jsoncpp/copyright)
# Copy pdb files
vcpkg_copy_pdbs()