forked from microsoft/vcpkg
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[libconfig] Cleanup, fix libconfig++ cmake export (microsoft#34646)
* [libconfig] No vendored CMakeLists.txt * [libconfig] Cleanup * [libconfig] Fix libconfig++ cmake export
- Loading branch information
Showing
6 changed files
with
45 additions
and
95 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt | ||
index 3a64deb..233c89f 100644 | ||
--- a/lib/CMakeLists.txt | ||
+++ b/lib/CMakeLists.txt | ||
@@ -112,7 +112,7 @@ install(TARGETS ${libname} | ||
) | ||
|
||
install(TARGETS ${libname}++ | ||
- EXPORT libconfig++Targets | ||
+ EXPORT libconfigTargets | ||
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} | ||
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} | ||
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} | ||
@@ -121,7 +121,7 @@ install(TARGETS ${libname}++ | ||
|
||
|
||
include(CMakePackageConfigHelpers) | ||
-foreach(target_name libconfig libconfig++) | ||
+foreach(target_name libconfig) | ||
write_basic_package_version_file("${target_name}ConfigVersion.cmake" | ||
VERSION ${PACKAGE_VERSION} | ||
COMPATIBILITY SameMajorVersion |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,52 +1,28 @@ | ||
vcpkg_from_github( | ||
OUT_SOURCE_PATH SOURCE_PATH | ||
REPO hyperrealm/libconfig | ||
REF v1.7.3 | ||
REF "v${VERSION}" | ||
SHA512 3749bf9eb29bab0f6b14f4fc759f0c419ed27a843842aaabed1ec1fbe0faa8c93322ff875ca1291d69cb28a39ece86d512aec42c2140d566c38c56dc616734f4 | ||
HEAD_REF master | ||
PATCHES | ||
libconfig++-cmake-export.diff | ||
) | ||
|
||
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_cmake_configure( | ||
SOURCE_PATH "${SOURCE_PATH}" | ||
OPTIONS_DEBUG -DDISABLE_INSTALL_HEADERS=ON | ||
) | ||
else() | ||
vcpkg_cmake_configure( | ||
SOURCE_PATH "${SOURCE_PATH}" | ||
OPTIONS | ||
-DBUILD_EXAMPLES=OFF | ||
-DBUILD_TESTS=OFF | ||
) | ||
endif() | ||
|
||
vcpkg_cmake_configure( | ||
SOURCE_PATH "${SOURCE_PATH}" | ||
OPTIONS | ||
-DBUILD_EXAMPLES=OFF | ||
-DBUILD_TESTS=OFF | ||
) | ||
vcpkg_cmake_install() | ||
|
||
vcpkg_copy_pdbs() | ||
vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/libconfig) | ||
|
||
if (VCPKG_USE_HEAD_VERSION) | ||
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include") | ||
vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/libconfig) | ||
endif() | ||
|
||
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}") | ||
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include") | ||
|
||
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() | ||
if(VCPKG_LIBRARY_LINKAGE STREQUAL "static") | ||
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/libconfig.h" "defined(LIBCONFIG_STATIC)" "1") | ||
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/libconfig.h++" "defined(LIBCONFIGXX_STATIC)" "1") | ||
endif() | ||
|
||
file(INSTALL "${SOURCE_PATH}/LICENSE" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright) | ||
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters