Skip to content

Commit

Permalink
Try to build Emgu.CV.runtime.macos nuget package.
Browse files Browse the repository at this point in the history
  • Loading branch information
emgucv committed Feb 16, 2023
1 parent 54a5423 commit 370bf3e
Show file tree
Hide file tree
Showing 4 changed files with 64 additions and 1 deletion.
17 changes: 16 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1178,6 +1178,10 @@ IF(WITH_OPENVINO OR WITH_INF_ENGINE)
SET(EMGUCV_WINDOWS_NUGET_ID "${EMGUCV_WINDOWS_NUGET_ID}.dldt")
ENDIF()

SET(EMGUCV_MACOS_NUGET_FILE_LIST "")
IF(HAVE_MACOS)
SET(EMGUCV_MACOS_NUGET_FILE_LIST "${EMGUCV_MACOS_NUGET_FILE_LIST} <file src=\"..\\..\\..\\libs\\runtimes\\osx\\native\\*.*\"/>")
ENDIF()

SET(EMGUCV_WINDOWS_NUGET_FILE_LIST "")
IF(HAVE_WINDESKTOP_X86)
Expand Down Expand Up @@ -1569,6 +1573,12 @@ SET(EMGUCV_WINDOWS_NUGET_TITLE "EMGU CV ${EMGUCV_NUGET_TITLE_ARCH}")
STRING(STRIP "${EMGUCV_WINDOWS_NUGET_TITLE}" EMGUCV_WINDOWS_NUGET_TITLE)
SET(EMGUCV_WINDOWS_NUGET_TITLE "${EMGUCV_WINDOWS_NUGET_TITLE} runtime for windows")

SET(EMGUCV_MACOS_NUGET_DEPENDENCY "${EMGUCV_MACOS_NUGET_DEPENDENCY}<dependency id=\"${EMGUCV_NUGET_ID}\" version=\"${CPACK_PACKAGE_DEPENDENCY_VERSION}\" />")

SET(EMGUCV_MACOS_NUGET_TITLE "EMGU CV")
STRING(STRIP "${EMGUCV_MACOS_NUGET_TITLE}" EMGUCV_MACOS_NUGET_TITLE)
SET(EMGUCV_MACOS_NUGET_TITLE "${EMGUCV_MACOS_NUGET_TITLE} runtime for MacOS")

IF(WITH_CUDA)

SET(EMGUCV_WINDOWS_NUGET_TITLE "${EMGUCV_WINDOWS_NUGET_TITLE} with CUDA support")
Expand Down Expand Up @@ -1765,6 +1775,10 @@ SET(EMGUCV_WINDOWS_NUGET_DEPENDENCY " <dependencies>
${EMGUCV_WINDOWS_NUGET_DEPENDENCY}
</dependencies>")

SET(EMGUCV_MACOS_NUGET_DEPENDENCY " <dependencies>
${EMGUCV_MACOS_NUGET_DEPENDENCY}
</dependencies>")

#SET(EMGUCV_WINDOWS_NUGET_DEPENDENCY " <dependencies>
# <group targetFramework=\"net461\">${EMGUCV_WINDOWS_NETFRAMEWORK_NUGET_DEPENDENCY}</group>
# <group targetFramework=\".NETStandard2.0\">${EMGUCV_WINDOWS_NETSTANDARD_NUGET_DEPENDENCY}</group>
Expand Down Expand Up @@ -1875,7 +1889,8 @@ ENDIF()

IF(HAVE_MACOS)
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/cmake/Emgu.CV.runtime.xamarin.macos.Package.nuspec.in ${CMAKE_CURRENT_SOURCE_DIR}/platforms/nuget/Emgu.CV.runtime.xamarin.macos/Package.nuspec)
#CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/cmake/Emgu.CV.runtime.maui.macos.Package.nuspec.in ${CMAKE_CURRENT_SOURCE_DIR}/platforms/nuget/Emgu.CV.runtime.maui.macos/Package.nuspec)
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/cmake/Emgu.CV.runtime.macos.Package.nuspec.in ${CMAKE_CURRENT_SOURCE_DIR}/platforms/nuget/Emgu.CV.runtime.macos/Package.nuspec)
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/cmake/Emgu.CV.runtime.macos.Package.README.md.in ${CMAKE_CURRENT_SOURCE_DIR}/platforms/nuget/Emgu.CV.runtime.macos/docs/README.md)
ENDIF()

IF(HAVE_MAUI)
Expand Down
19 changes: 19 additions & 0 deletions cmake/Emgu.CV.runtime.macos.Package.README.md.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
## About this package

This package is part of the ${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH} release of Emgu CV.

${EMGUCV_MINI_RELEASE_NOTE}

For online documentation please visit
<${NUGET_EMGU_URL}/wiki/files/${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}/document/index.html>

Release note can be found at
<${NUGET_EMGU_URL}/wiki/index.php/Version_History#Emgu.CV-${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}>

## Note

If you are targeting .Net Framework, please read this first:
<${NUGET_EMGU_URL}/wiki/index.php/Download_And_Installation#Targeting_.Net_Framework>

If you have issues getting the pacakge installed for your project, and your project use packages.config to manage nuget packages, the following instructions will help:
<${NUGET_EMGU_URL}/wiki/index.php/Download_And_Installation#Upgrade_from_packages.config_to_package_reference>
27 changes: 27 additions & 0 deletions cmake/Emgu.CV.runtime.macos.Package.nuspec.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?xml version="1.0"?>
<package >
<metadata>
<id>${EMGUCV_MACOS_NUGET_ID}</id>
<title>${EMGUCV_MACOS_NUGET_TITLE}</title>
<version>${CPACK_PACKAGE_VERSION}</version>
<authors>${CPACK_PACKAGE_VENDOR}</authors>
<owners>${CPACK_PACKAGE_VENDOR}</owners>
<license type="file">${EMGUCV_LICENSE_FILE}</license>
<projectUrl>${NUGET_EMGU_URL}</projectUrl>
<repository type="git" url="https://github.com/emgucv/emgucv" />
<icon>icon.png</icon>
<requireLicenseAcceptance>true</requireLicenseAcceptance>
<summary>Runtime package of Emgu CV for Mac OS using .Net runtime (not compatible with MAUI / Xamarin )</summary>
<description>This package contains the native runtime of Emgu CV for Mac OS using .Net runtime (not compatible with MAUI / Xamarin )</description>
<releaseNotes>This is the ${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH} release of Emgu CV. For online documentation please visit
${NUGET_EMGU_URL}/wiki/files/${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}/document/index.html
</releaseNotes>
<readme>docs/README.md</readme>
${EMGUCV_WINDOWS_NUGET_DEPENDENCY}
<copyright>© ${CPACK_PACKAGE_VENDOR} ${CURRENT_YEAR}. All rights reserved.</copyright>
<tags>opencv emgu emgucv ai image macos</tags>
</metadata>
<files>
${EMGUCV_MACOS_NUGET_FILE_LIST}
</files>
</package>
2 changes: 2 additions & 0 deletions platforms/nuget/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ ADD_SUBDIRECTORY("Emgu.CV.runtime.xamarin.android")
#ADD_SUBDIRECTORY("Emgu.CV.runtime.maui.android")
ADD_SUBDIRECTORY("Emgu.CV.runtime.maui")

ADD_SUBDIRECTORY("Emgu.CV.runtime.macos")

#IF (HAVE_LINUX_ARM)
add_subdirectory("Emgu.CV.runtime.debian-arm")
add_subdirectory("Emgu.CV.runtime.debian-arm64")
Expand Down

0 comments on commit 370bf3e

Please sign in to comment.