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.
[EIPScanner] add new port (microsoft#43569)
Co-authored-by: Kai Pastor <[email protected]>
- Loading branch information
Showing
6 changed files
with
140 additions
and
0 deletions.
There are no files selected for viewing
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,82 @@ | ||
diff --git a/cmake/EIPScannerConfig.cmake.in b/cmake/EIPScannerConfig.cmake.in | ||
new file mode 100644 | ||
index 0000000..3e16bd1 | ||
--- /dev/null | ||
+++ b/cmake/EIPScannerConfig.cmake.in | ||
@@ -0,0 +1,6 @@ | ||
+@PACKAGE_INIT@ | ||
+ | ||
+include("${CMAKE_CURRENT_LIST_DIR}/EIPScannerTargets.cmake") | ||
+ | ||
+check_required_components(EIPScanner) | ||
+ | ||
diff --git a/CMakeLists.txt b/CMakeLists.txt | ||
index 68a291e..d2562a8 100644 | ||
--- a/CMakeLists.txt | ||
+++ b/CMakeLists.txt | ||
@@ -13,6 +13,7 @@ option(TEST_ENABLED "Enable unit test" OFF) | ||
option(EXAMPLE_ENABLED "Build examples" OFF) | ||
|
||
add_subdirectory(src) | ||
+ | ||
if (EXAMPLE_ENABLED) | ||
add_subdirectory(examples) | ||
endif() | ||
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt | ||
index dc2bbb9..d8d3cfa 100644 | ||
--- a/src/CMakeLists.txt | ||
+++ b/src/CMakeLists.txt | ||
@@ -64,7 +64,18 @@ set_target_properties( | ||
VERSION ${EIPSCANNER_FULL_VERSION} | ||
SOVERSION ${EIPSCANNER_MAJOR_VERSION}) | ||
|
||
-install(TARGETS EIPScanner EIPScannerS | ||
+if(BUILD_SHARED_LIBS) | ||
+ set(install_target EIPScanner) | ||
+ set_target_properties(EIPScanner PROPERTIES EXPORT_NAME eipscanner) | ||
+ set_target_properties(EIPScannerS PROPERTIES EXCLUDE_FROM_ALL 1) | ||
+else() | ||
+ set(install_target EIPScannerS) | ||
+ set_target_properties(EIPScannerS PROPERTIES EXPORT_NAME eipscanner) | ||
+ set_target_properties(EIPScanner PROPERTIES EXCLUDE_FROM_ALL 1) | ||
+endif() | ||
+ | ||
+install(TARGETS ${install_target} | ||
+ EXPORT ${install_target} | ||
LIBRARY | ||
DESTINATION lib | ||
ARCHIVE | ||
@@ -73,3 +84,33 @@ install(TARGETS EIPScanner EIPScannerS | ||
install(DIRECTORY ${CMAKE_SOURCE_DIR}/src/ | ||
DESTINATION include/EIPScanner | ||
FILES_MATCHING PATTERN "*.h*") | ||
+ | ||
+target_include_directories(${install_target} | ||
+ INTERFACE | ||
+ $<INSTALL_INTERFACE:include/EIPScanner> | ||
+) | ||
+ | ||
+include(CMakePackageConfigHelpers) | ||
+configure_package_config_file( | ||
+ ../cmake/EIPScannerConfig.cmake.in | ||
+ ${CMAKE_CURRENT_BINARY_DIR}/EIPScannerConfig.cmake | ||
+ INSTALL_DESTINATION lib/cmake/eipscanner | ||
+) | ||
+ | ||
+write_basic_package_version_file( | ||
+ ${CMAKE_CURRENT_BINARY_DIR}/EIPScannerConfigVersion.cmake | ||
+ VERSION ${PROJECT_VERSION} | ||
+ COMPATIBILITY SameMajorVersion | ||
+) | ||
+ | ||
+install(FILES | ||
+ ${CMAKE_CURRENT_BINARY_DIR}/EIPScannerConfig.cmake | ||
+ ${CMAKE_CURRENT_BINARY_DIR}/EIPScannerConfigVersion.cmake | ||
+ DESTINATION lib/cmake/eipscanner | ||
+) | ||
+ | ||
+install(EXPORT ${install_target} | ||
+ FILE EIPScannerTargets.cmake | ||
+ NAMESPACE unofficial::eipscanner:: | ||
+ DESTINATION lib/cmake/eipscanner | ||
+) |
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,23 @@ | ||
vcpkg_from_github( | ||
OUT_SOURCE_PATH SOURCE_PATH | ||
REPO nimbuscontrols/EIPScanner | ||
REF ${VERSION} | ||
SHA512 24612e6eec97aa67dfd83ec90d3f1a961c69a63a17cb09679b9eb453750049628def8d488b9debbf1f322a800f9f54933dedca9b37fb1c5703e95460b89f2f43 | ||
HEAD_REF master | ||
PATCHES | ||
package.patch | ||
) | ||
vcpkg_cmake_configure( | ||
SOURCE_PATH "${SOURCE_PATH}" | ||
) | ||
|
||
vcpkg_cmake_install() | ||
vcpkg_copy_pdbs() | ||
vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/eipscanner) | ||
vcpkg_fixup_pkgconfig() | ||
|
||
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include") | ||
|
||
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE") | ||
|
||
file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}") |
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,4 @@ | ||
The package EIPScanner provides CMake targets: | ||
|
||
find_package(EIPScanner CONFIG REQUIRED) | ||
target_link_libraries(main PRIVATE unofficial::eipscanner::eipscanner) |
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,18 @@ | ||
{ | ||
"name": "eipscanner", | ||
"version": "1.3.0", | ||
"description": "Free implementation of EtherNet/IP in C++ ", | ||
"homepage": "https://eipscanner.readthedocs.io", | ||
"license": "MIT", | ||
"supports": "!windows", | ||
"dependencies": [ | ||
{ | ||
"name": "vcpkg-cmake", | ||
"host": true | ||
}, | ||
{ | ||
"name": "vcpkg-cmake-config", | ||
"host": true | ||
} | ||
] | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"versions": [ | ||
{ | ||
"git-tree": "4d614cf97b912cc20cca14a566542f106db03246", | ||
"version": "1.3.0", | ||
"port-version": 0 | ||
} | ||
] | ||
} |