2017-06-29 04:21:01 +08:00
|
|
|
vcpkg_from_github(
|
|
|
|
OUT_SOURCE_PATH SOURCE_PATH
|
|
|
|
REPO hyperrealm/libconfig
|
2021-08-19 08:24:14 +08:00
|
|
|
REF v1.7.3
|
|
|
|
SHA512 3749bf9eb29bab0f6b14f4fc759f0c419ed27a843842aaabed1ec1fbe0faa8c93322ff875ca1291d69cb28a39ece86d512aec42c2140d566c38c56dc616734f4
|
2017-06-29 04:21:01 +08:00
|
|
|
HEAD_REF master
|
|
|
|
)
|
|
|
|
|
2021-02-03 05:45:32 +08:00
|
|
|
if (NOT VCPKG_USE_HEAD_VERSION)
|
|
|
|
message("If you would like to use cmake with the port, use `--head` option with vcpkg install.")
|
|
|
|
file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH})
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if (NOT VCPKG_USE_HEAD_VERSION)
|
|
|
|
vcpkg_configure_cmake(
|
|
|
|
SOURCE_PATH ${SOURCE_PATH}
|
|
|
|
PREFER_NINJA
|
|
|
|
OPTIONS_DEBUG -DDISABLE_INSTALL_HEADERS=ON
|
|
|
|
)
|
|
|
|
else()
|
|
|
|
vcpkg_configure_cmake(
|
|
|
|
SOURCE_PATH ${SOURCE_PATH}
|
|
|
|
PREFER_NINJA
|
|
|
|
OPTIONS
|
|
|
|
-DBUILD_EXAMPLES=OFF
|
|
|
|
-DBUILD_TESTS=OFF
|
|
|
|
)
|
|
|
|
endif()
|
2017-06-30 04:38:45 +08:00
|
|
|
|
2017-06-29 05:06:52 +08:00
|
|
|
vcpkg_install_cmake()
|
2017-06-29 04:21:01 +08:00
|
|
|
|
2020-03-26 11:43:02 +08:00
|
|
|
vcpkg_copy_pdbs()
|
|
|
|
|
2021-02-03 05:45:32 +08:00
|
|
|
if (VCPKG_USE_HEAD_VERSION)
|
|
|
|
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
|
|
|
|
vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/libconfig)
|
|
|
|
endif()
|
|
|
|
|
2017-07-08 14:11:46 +08:00
|
|
|
foreach(FILE ${CURRENT_PACKAGES_DIR}/include/libconfig.h++ ${CURRENT_PACKAGES_DIR}/include/libconfig.h)
|
|
|
|
file(READ ${FILE} _contents)
|
|
|
|
string(REPLACE "defined(LIBCONFIGXX_EXPORTS)" "0" _contents "${_contents}")
|
|
|
|
string(REPLACE "defined(LIBCONFIG_EXPORTS)" "0" _contents "${_contents}")
|
|
|
|
|
|
|
|
if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic)
|
|
|
|
string(REPLACE "defined(LIBCONFIGXX_STATIC)" "0" _contents "${_contents}")
|
|
|
|
string(REPLACE "defined(LIBCONFIG_STATIC)" "0" _contents "${_contents}")
|
|
|
|
else()
|
|
|
|
string(REPLACE "defined(LIBCONFIGXX_STATIC)" "1" _contents "${_contents}")
|
|
|
|
string(REPLACE "defined(LIBCONFIG_STATIC)" "1" _contents "${_contents}")
|
|
|
|
endif()
|
|
|
|
file(WRITE ${FILE} "${_contents}")
|
|
|
|
endforeach()
|
|
|
|
|
2020-03-26 11:43:02 +08:00
|
|
|
file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)
|