diff --git a/ports/wincpp/fix-install-and-w32.patch b/ports/wincpp/fix-install-and-w32.patch new file mode 100644 index 00000000000000..9b676a08ba577c --- /dev/null +++ b/ports/wincpp/fix-install-and-w32.patch @@ -0,0 +1,106 @@ +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +index 9d5adce..eff939d 100644 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -1,5 +1,5 @@ + cmake_path(SET include_dir "${CMAKE_CURRENT_SOURCE_DIR}/../include") +- ++include(GNUInstallDirs) + # Add the header files to the project + set(header_files + "${include_dir}/wincpp/process.hpp" +@@ -36,21 +36,21 @@ set(header_files + + # Add the library to the project + add_library(_wincpp_core INTERFACE) +- + # Add the include directory to the project +-target_sources(_wincpp_core INTERFACE ${header_files}) ++target_sources(_wincpp_core INTERFACE $) + + # Add the include directories + target_include_directories(_wincpp_core SYSTEM INTERFACE + $ +- $ ++ $ + ) + + # Add the library to the project +-add_library(wincpp STATIC) ++add_library(wincpp) ++set_target_properties(wincpp PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS ON) + + # Link the library to the core +-target_link_libraries(wincpp INTERFACE _wincpp_core) ++target_link_libraries(wincpp PUBLIC _wincpp_core) + + # Add the source files to the project + target_sources(wincpp PRIVATE +@@ -89,3 +89,38 @@ target_sources(wincpp PRIVATE + + # Add the include directory to the project + target_include_directories(wincpp PRIVATE ${include_dir}) ++ ++# Install wincpp library ++install(TARGETS wincpp _wincpp_core EXPORT wincpp-export ++ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ++ INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} ++) ++ ++install(DIRECTORY "${CMAKE_CURRENT_LIST_DIR}/../include/wincpp" DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}") ++ ++include(CMakePackageConfigHelpers) ++write_basic_package_version_file( ++ "${CMAKE_CURRENT_BINARY_DIR}/wincppConfigVersion.cmake" ++ VERSION 1.5.3.6 ++ COMPATIBILITY AnyNewerVersion ++) ++ ++file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/wincppConfig.cmake" ++ "include(\${CMAKE_CURRENT_LIST_DIR}/wincppTargets.cmake)\n" ++) ++ ++set(wincpp_CONFFILE_DEST "${CMAKE_INSTALL_DATAROOTDIR}/wincpp") ++ ++install(FILES ++ "${CMAKE_CURRENT_BINARY_DIR}/wincppConfig.cmake" ++ "${CMAKE_CURRENT_BINARY_DIR}/wincppConfigVersion.cmake" ++ DESTINATION ${wincpp_CONFFILE_DEST} ++) ++ ++install(EXPORT wincpp-export ++ FILE wincppTargets.cmake ++ NAMESPACE wincpp:: ++ DESTINATION ${wincpp_CONFFILE_DEST} ++) +diff --git a/src/memory_factory.cpp b/src/memory_factory.cpp +index 50cd83d..82c1474 100644 +--- a/src/memory_factory.cpp ++++ b/src/memory_factory.cpp +@@ -24,7 +24,7 @@ namespace wincpp + } + case wincpp::memory_type::remote_t: + { +- std::size_t read; ++ SIZE_T read; + + if ( !ReadProcessMemory( p->handle->native, reinterpret_cast< void* >( address ), buffer, size, &read ) || read != size ) + return false; +@@ -61,7 +61,7 @@ namespace wincpp + } + case wincpp::memory_type::remote_t: + { +- std::size_t written; ++ SIZE_T written; + + WriteProcessMemory( p->handle->native, reinterpret_cast< void* >( address ), buffer, size, &written ); + return written; +@@ -201,4 +201,4 @@ namespace wincpp + + return nullptr; + } +-} // namespace wincpp +\ No newline at end of file ++} // namespace wincpp diff --git a/ports/wincpp/portfile.cmake b/ports/wincpp/portfile.cmake new file mode 100644 index 00000000000000..f730c74944b2a3 --- /dev/null +++ b/ports/wincpp/portfile.cmake @@ -0,0 +1,22 @@ +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO atrexus/wincpp + REF "v${VERSION}" + SHA512 43674f7e899ce1d4088ad76f4f224c8202aa6af508211cbbae69366ca6467cf61520e0c65d852d0ad805045e9b3d69d414b6ba434d4c8b64becac120d28df294 + HEAD_REF main + PATCHES + fix-install-and-w32.patch +) + +vcpkg_cmake_configure( + SOURCE_PATH "${SOURCE_PATH}" + OPTIONS + -DBUILD_EXAMPLES=OFF + -DBUILD_PACKAGE=OFF +) + +vcpkg_cmake_install() + +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include" "${CURRENT_PACKAGES_DIR}/debug/share") + +vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE") diff --git a/ports/wincpp/vcpkg.json b/ports/wincpp/vcpkg.json new file mode 100644 index 00000000000000..529265b756c2d7 --- /dev/null +++ b/ports/wincpp/vcpkg.json @@ -0,0 +1,13 @@ +{ + "name": "wincpp", + "version": "1.5.3.6", + "description": "A fully featured Win32 wrapper written in modern C++", + "license": "MIT", + "supports": "windows", + "dependencies": [ + { + "name": "vcpkg-cmake", + "host": true + } + ] +} diff --git a/versions/baseline.json b/versions/baseline.json index 6f090fd869f408..8078c97f5eee05 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -10776,6 +10776,10 @@ "baseline": "0.4.6", "port-version": 1 }, + "wincpp": { + "baseline": "1.5.3.6", + "port-version": 0 + }, "wincrypt": { "baseline": "0.0", "port-version": 4 diff --git a/versions/w-/wincpp.json b/versions/w-/wincpp.json new file mode 100644 index 00000000000000..19ca61150d5e82 --- /dev/null +++ b/versions/w-/wincpp.json @@ -0,0 +1,9 @@ +{ + "versions": [ + { + "git-tree": "b68b4c8b039836d63d3092c3c1545b90ae3400a4", + "version": "1.5.3.6", + "port-version": 0 + } + ] +}